@nebula.js/sn-distributionplot 0.40.3 → 0.40.4

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-distributionplot v0.40.3
2
+ * @nebula.js/sn-distributionplot v0.40.4
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -23,7 +23,7 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.le
23
23
  * Copyright (c) 2016 Jorik Tangelder;
24
24
  * Licensed under the MIT license */!function(e){!function(t,n,i,r){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function m(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=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,r,i),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var g=m((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),y=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||r,t):e}function w(e,t){return e===r?t:e}function q(e,t,n){p(_(t),(function(t){e.addEventListener(t,n,!1)}))}function S(e,t,n){p(_(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function E(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];C(r,s)<0&&i.push(e[o]),r[o]=s,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function A(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((i=(n=s[a])?n+o:t)in e)return i;a++}return r}var T=1;function I(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==r,N=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",L="mouse",F=25,z=1,j=4,H=8,B=1,V=2,$=4,W=8,U=16,Y=V|$,X=W|U,K=Y|X,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 i=n.pointers.length,o=n.changedPointers.length,s=t&z&&i-o==0,a=t&(j|H)&&i-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,o=i.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(i);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=re(l,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==z&&o.eventType!==j||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ie(t.deltaX,t.deltaY);var d=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return re(t[0],t[1],J)/re(e[0],e[1],J)}(a.pointers,i):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,i):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,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>F||a.velocity===r)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=ne(l,c,h);i=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=ie(c,h),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(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:h(),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,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:c(n/t),y:c(i/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function ie(e,t){return e===t?B:u(e)>=u(t)?e<0?V:$:t<0?W:U}function re(e,t,n){n||(n=G);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function oe(e,t,n){n||(n=G);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)}};var se={mousedown:z,mousemove:2,mouseup:j},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}v(ce,Z,{handler:function(e){var t=se[e.type];t&z&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=j),this.pressed&&(t&j&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var ue={pointerdown:z,pointermove:2,pointerup:j,pointercancel:H,pointerout:H},he={2:P,3:"pen",4:L,5:"kinect"},de="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=de,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(de="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),v(pe,Z,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=ue[i],o=he[e.pointerType]||e.pointerType,s=o==P,a=C(t,e.pointerId,"pointerId");r&z&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):r&(j|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var me={touchstart:z,touchmove:2,touchend:j,touchcancel:H};function ge(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=k(e.touches),i=k(e.changedTouches);return t&(j|H)&&(n=E(n.concat(i),"identifier",!0)),[n,i]}v(ge,Z,{handler:function(e){var t=me[e.type];if(t===z&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(j|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 ve={touchstart:z,touchmove:2,touchend:j,touchcancel:H},be="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=k(e.touches),i=this.targetIds;if(t&(2|z)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=k(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),t===z)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),t&(j|H)&&delete i[s[r].identifier],r++;return a.length?[E(o.concat(a),"identifier",!0),a]:void 0}v(xe,Z,{handler:function(e){var t=ve[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 qe=2500;function Se(){Z.apply(this,arguments);var e=b(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function Me(e,t){e&z?(this.primaryTouch=t.changedPointers[0].identifier,De.call(this,t)):e&(j|H)&&De.call(this,t)}function De(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),qe)}}function _e(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}v(Se,Z,{handler:function(e,t,n){var i=n.pointerType==P,r=n.pointerType==L;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Me.call(this,t,n);else if(r&&_e.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ce=A(a.style,"touchAction"),ke=Ce!==r,Ee="compute",Ae="auto",Te="manipulation",Ie="none",Re="pan-x",Oe="pan-y",Ne=function(){if(!ke)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!n||t.CSS.supports("touch-action",i)})),e}();function Pe(e,t){this.manager=e,this.set(t)}Pe.prototype={set:function(e){e==Ee&&(e=this.compute()),ke&&this.manager.element.style&&Ne[e]&&(this.manager.element.style[Ce]=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(D(e,Ie))return Ie;var t=D(e,Re),n=D(e,Oe);if(t&&n)return Ie;if(t||n)return t?Re:Oe;if(D(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 i=this.actions,r=D(i,Ie)&&!Ne[Ie],o=D(i,Oe)&&!Ne[Oe],s=D(i,Re)&&!Ne[Re];if(r){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&n&Y||s&&n&X?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Le=1,Fe=32;function ze(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 je(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(){ze.apply(this,arguments)}function $e(){Ve.apply(this,arguments),this.pX=null,this.pY=null}function We(){Ve.apply(this,arguments)}function Ue(){ze.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Ve.apply(this,arguments)}function Xe(){Ve.apply(this,arguments)}function Ke(){ze.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)}ze.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===C(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=C(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 i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+je(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+je(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Fe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Fe|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=Fe);56&this.state&&(this.state=Le),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Ve,ze,{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,i=6&t,r=this.attrTest(e);return i&&(n&H||!r)?16|t:i||r?n&j?8|t:2&t?4|t:2:Fe}}),v($e,Ve,{defaults:{event:"pan",threshold:10,pointers:1,direction:K},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&X&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,s=e.deltaY;return r&t.direction||(t.direction&Y?(r=0===o?B:o<0?V:$,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===s?B:s<0?W:U,n=s!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&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)}}),v(We,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},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)}}),v(Ue,ze,{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,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||e.eventType&(j|H)&&!r)this.reset();else if(e.eventType&z)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&j)return 8;return Fe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&j?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(Ye,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Xe,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|X,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|X)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&X&&(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&j},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Ke,ze,{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,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),e.eventType&z&&0===this.count)return this.failTimeout();if(i&&r&&n){if(e.eventType!=j)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||re(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=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Fe},failTimeout:function(){return this._timer=d((function(){this.state=Fe}),this.options.interval,this),Fe},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:Ee,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Xe,{direction:Y}],[$e,{direction:Y},["swipe"]],[Ke],[Ke,{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:N?xe:R?Se: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,i=e.element;i.style&&(p(e.options.cssProps,(function(r,o){n=A(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.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 i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ze)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=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return p(_(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return p(_(e),(function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=n.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&Ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Ge,{INPUT_START:z,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:H,STATE_POSSIBLE:Le,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Fe,DIRECTION_NONE:B,DIRECTION_LEFT:V,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:X,DIRECTION_ALL:K,Manager:Je,Input:Z,TouchAction:Pe,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:Se,SingleTouchInput:ge,Recognizer:ze,AttrRecognizer:Ve,Tap:Ke,Pan:$e,Swipe:Xe,Pinch:We,Rotate:Ye,Press:Ue,on:q,off:S,each:p,merge:y,extend:g,assign:o,inherit:v,bindFn:b,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ge,"function"==typeof r&&r.amd?r((function(){return Ge})):e.exports?e.exports=Ge:t.Hammer=Ge}(window,document)}(kg);var Eg=n(kg.exports);function Ag(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tg={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:i}}=this.settings,r="top"!==i&&"bottom"!==i||!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}(i,this.rect),s="center"===i?t:`* ${t}`,a="center"!==i?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:r},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Ig(e){const t=Fp();return t.renderer.prio([e||"canvas"]),t.use(Mg),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Cg(e))};e.interaction("hammer",Cg(Hammer))}(Eg)),t.use(Ag),t.component("disclaimer",Tg),t}const Rg={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ng(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(n),!0).forEach((function(t){Lg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Og(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pg(e){return Pg="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},Pg(e)}function Lg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fg(e){return function(e){if(Array.isArray(e))return zg(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 zg(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)?zg(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 zg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var jg=Object.prototype.hasOwnProperty,Hg=Object.prototype.toString,Bg=Object.defineProperty,Vg=Object.getOwnPropertyDescriptor,$g=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Hg.call(e)},Wg=function(e){if(!e||"[object Object]"!==Hg.call(e))return!1;var t,n=jg.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&jg.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||jg.call(e,t)},Ug=function(e,t){Bg&&"__proto__"===t.name?Bg(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Yg=function(e,t){if("__proto__"===t){if(!jg.call(e,t))return;if(Vg)return Vg(e,t).value}return e[t]},Xg=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,i,r,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)i=Yg(a,n),a!==(r=Yg(t,n))&&(u&&r&&(Wg(r)||(o=$g(r)))?(o?(o=!1,s=i&&$g(i)?i:[]):s=i&&Wg(i)?i:{},Ug(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Ug(a,{name:n,newValue:r}));return a}));function Kg(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function Gg(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function Jg(e,t,n,i,r){var o,s,a=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return a(i,c)}return{}}function Zg(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Qg(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ty(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ny(){}var iy=1/.7,ry="\\s*([+-]?\\d+)\\s*",oy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ay=/^#([0-9a-f]{3,8})$/,ly=new RegExp(`^rgb\\(${ry},${ry},${ry}\\)$`),cy=new RegExp(`^rgb\\(${sy},${sy},${sy}\\)$`),uy=new RegExp(`^rgba\\(${ry},${ry},${ry},${oy}\\)$`),hy=new RegExp(`^rgba\\(${sy},${sy},${sy},${oy}\\)$`),dy=new RegExp(`^hsl\\(${oy},${sy},${sy}\\)$`),fy=new RegExp(`^hsla\\(${oy},${sy},${sy},${oy}\\)$`),py={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 my(){return this.rgb().formatHex()}function gy(){return this.rgb().formatRgb()}function yy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ay.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vy(t):3===n?new qy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?by(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?by(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=ly.exec(e))?new qy(t[1],t[2],t[3],1):(t=cy.exec(e))?new qy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=uy.exec(e))?by(t[1],t[2],t[3],t[4]):(t=hy.exec(e))?by(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dy.exec(e))?ky(t[1],t[2]/100,t[3]/100,1):(t=fy.exec(e))?ky(t[1],t[2]/100,t[3]/100,t[4]):py.hasOwnProperty(e)?vy(py[e]):"transparent"===e?new qy(NaN,NaN,NaN,0):null}function vy(e){return new qy(e>>16&255,e>>8&255,255&e,1)}function by(e,t,n,i){return i<=0&&(e=t=n=NaN),new qy(e,t,n,i)}function xy(e){return e instanceof ny||(e=yy(e)),e?new qy((e=e.rgb()).r,e.g,e.b,e.opacity):new qy}function wy(e,t,n,i){return 1===arguments.length?xy(e):new qy(e,t,n,null==i?1:i)}function qy(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Sy(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}`}function My(){const e=Dy(this.opacity);return`${1===e?"rgb(":"rgba("}${_y(this.r)}, ${_y(this.g)}, ${_y(this.b)}${1===e?")":`, ${e})`}`}function Dy(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 Cy(e){return((e=_y(e))<16?"0":"")+e.toString(16)}function ky(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ay(e,t,n,i)}function Ey(e){if(e instanceof Ay)return new Ay(e.h,e.s,e.l,e.opacity);if(e instanceof ny||(e=yy(e)),!e)return new Ay;if(e instanceof Ay)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Ay(s,a,l,e.opacity)}function Ay(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ty(e){return(e=(e||0)%360)<0?e+360:e}function Iy(e){return Math.max(0,Math.min(1,e||0))}function Ry(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ey(ny,yy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:my,formatHex:my,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ey(this).formatHsl()},formatRgb:gy,toString:gy}),ey(qy,wy,ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new qy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qy(_y(this.r),_y(this.g),_y(this.b),Dy(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:Sy,formatHex:Sy,formatHex8:function(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}${Cy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),ey(Ay,(function(e,t,n,i){return 1===arguments.length?Ey(e):new Ay(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new Ay(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ay(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new qy(Ry(e>=240?e-240:e+120,r,i),Ry(e,r,i),Ry(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ay(Ty(this.h),Iy(this.s),Iy(this.l),Dy(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=Dy(this.opacity);return`${1===e?"hsl(":"hsla("}${Ty(this.h)}, ${100*Iy(this.s)}%, ${100*Iy(this.l)}%${1===e?")":`, ${e})`}`}}));const Oy=Math.PI/180,Ny=180/Math.PI,Py=4/29,Ly=6/29,Fy=3*Ly*Ly;function zy(e){if(e instanceof jy)return new jy(e.l,e.a,e.b,e.opacity);if(e instanceof Wy)return Uy(e);e instanceof qy||(e=xy(e));var t,n,i=$y(e.r),r=$y(e.g),o=$y(e.b),s=Hy((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=Hy((.4360747*i+.3850649*r+.1430804*o)/.96422),n=Hy((.0139322*i+.0971045*r+.7141733*o)/.82521)),new jy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function jy(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Hy(e){return e>.008856451679035631?Math.pow(e,1/3):e/Fy+Py}function By(e){return e>Ly?e*e*e:Fy*(e-Py)}function Vy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $y(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Wy(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Uy(e){if(isNaN(e.h))return new jy(e.l,0,0,e.opacity);var t=e.h*Oy;return new jy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ey(jy,(function(e,t,n,i){return 1===arguments.length?zy(e):new jy(e,t,n,null==i?1:i)}),ty(ny,{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 qy(Vy(3.1338561*(t=.96422*By(t))-1.6168667*(e=1*By(e))-.4906146*(n=.82521*By(n))),Vy(-.9787684*t+1.9161415*e+.033454*n),Vy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ey(Wy,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Wy)return new Wy(e.h,e.c,e.l,e.opacity);if(e instanceof jy||(e=zy(e)),0===e.a&&0===e.b)return new Wy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ny;return new Wy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Wy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Wy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Wy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Uy(this).rgb()}}));var Yy=e=>()=>e;function Xy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yy(isNaN(e)?t:e)}var Ky=function e(t){var n=function(e){return 1==(e=+e)?Xy:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Yy(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=wy(e)).r,(t=wy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=Xy(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1),Gy=/^class(-pyramid)?/,Jy=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(Fg(u))),o=Math.max.apply(Math,[o].concat(Fg(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],s=[];if(i.length)if(i[i.length-1]<t)s.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)s.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)s.push(t),o.push(r[0]);else{s.push(t);for(var a=0;a<i.length;a++)if(t<i[a]){o.push(r[a]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(s.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)s.push(n),o.push(r[i.length]),o.push(r[i.length]);else{s.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Ky(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Zy(e,t,n,i,r){var o,s,a,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Zy(e,t,n,i+1,r)}var Qy=function(e,t,n,i){var r,o,s=t.theme,a=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Fg(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,Fg(u)),c.max=Math.max.apply(Math,Fg(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&Gy.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Fg(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?Zy(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function ev(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function tv(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),Ng(Ng({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===a?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return Ng(Ng({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,s,i):null}function nv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function iv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),i.push(s.primary)):i[a]=s.primary,e[o]=null}else if(s){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function rv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?ev:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=Qy(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&Xg(c,Jy(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Zg:r,s=i.getCByField,a=void 0===s?Qg:s,l=i.getPersistence,c=void 0===l?Jg:l,u=o(t,n),h=a(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),Xg(p,c(t,n,u,h,{byRow:Gg,byElemNo:Kg})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=Qy(0,{hc:r,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return tv({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(nv(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=iv(e.measureOverrides,e.explicit),nv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=iv(e.measureOverrides),s}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ov(e){var t=Ng({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Xg(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=Xg(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=Xg(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return Jy(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=i[0],l=i[1]?i[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,s=Ng({},e);Xg(s,Kg(o,o.raw().qCardinal));var a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,Xg(s,Kg(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),Xg(s,Kg(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,s=[];o=[];for(var a=0;a<r.items.length;a++){var l=r.items[a],c=(l.text||l).label;i[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(i[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,r,{external:t,field:n.pic.field(e.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=Ng(Ng({},e),i.getDataColorSpecials())),n.settings=Xg(e,rv(this,n,t,e))}return n.settings}};return r}var sv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(i.legendDataPage=o),s&&(i.dimValsData=s.colorMap)}return i},av=function(e){throw e.isHandled=!0,e},lv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},cv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},uv=function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(av):Promise.reject()};function hv(e){return function(t){return"object"===Pg(t.datum[e])?t.datum[e].value:void 0}}function dv(e){return"object"===Pg(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function fv(e){return-3===e.datum.value}var pv={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function mv(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:pv.TITLE.COLOR,fontSize:pv.TITLE.FONT_SIZE,fontFamily:pv.TITLE.FONT_FAMILY},label:{color:pv.LABEL.COLOR,fontSize:pv.LABEL.FONT_SIZE,fontFamily:pv.LABEL.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==s?void 0:s.color,"legend.title","color",pv.TITLE.COLOR),r.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",pv.TITLE.FONT_SIZE),r.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",pv.TITLE.FONT_FAMILY),r.label.color=l(null==a?void 0:a.color,"legend.label","color",pv.LABEL.COLOR),r.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",pv.LABEL.FONT_SIZE),r.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",pv.LABEL.FONT_FAMILY),r}var gv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},yv=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function vv(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=mv({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:gv(s,r,o)},show:"function"==typeof s.show?function(){return yv(s,c,a)}:yv(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function bv(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=vv(e,t);if(!i.show)return!1;var r,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=mv({theme:f,key:s,styleOverrides:a}),g=i.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return Xg(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:Ng({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=vv(e,t);if(!d.show)return!1;var f=mv({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),Xg(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}function xv(e,t,n){var i=[],r=[],o=bv(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var r;return this.started===n||!t||!(null!=s&&null!==(r=s.interact)&&void 0!==r&&r.enabled&&!s.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:(e={},Lg(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),Lg(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),Lg(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:r,components:i}}var wv=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function qv(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ov(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,i=t.app;return lv(e,{layout:n,app:i})})).getMeasure((function(e,t){var n=t.layout,i=t.app;return cv(e,{layout:n,app:i})})).getAttributeDimension((function(e,t){var n=t.layout,i=t.model,r=t.app;return uv(e,{layout:n,model:i,app:r})}));return n.getSnapshotData=sv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=Ng({},r),i={},!n.key)throw new Error("Missing key");t.set(Ng(Ng({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=Ng(Ng({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,s=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===a}))[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(Fg(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,s=e.picasso,a={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Fg((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Fg((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=Ng(Ng({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};a[l]=Xg({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=Xg({},m,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=hv(i),o=hv("".concat(i,"IsAnOther")),s=function(e,t){var i=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return fv(e)||o(e)?c:l}:n[t]?function(e){return fv(e)?c:dv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===a?function(e){return fv(e)||o(e)?c:dv(e)?l:u}:"color"===h?function(e){return fv(e)||o(e)?c:dv(e)?l:r(e)||c}:null},a=s(t,i);if(t.measureOverrides){var l=hv("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&s(e)}));return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[s]&&"field"===r.mode&&(t=o[s].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?wv(e.qNum):e.qText&&yy(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=Lg({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xv({eventName:t,key:i,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Sv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Mv(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(Sv),o=i.some(Sv),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!r?"off":s}function Dv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ng(Ng(Ng({},e),t),{},{colorProps:Ng(Ng({},e.colorProps),t.colorProps||{})})}var _v=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Cv(e){var t,n=e.qHyperCube.qDimensionInfo.some(_v),i=e.qHyperCube.qMeasureInfo.some(_v),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var kv=function(){};function Ev(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(void 0===r[s])return n;r=r[s]}return r}var Av,Tv=["__proto__","constructor"];function Iv(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!Tv.some((function(e){return i.includes(e)}))){for(var o=e,s=0;s<i.length-1;++s){var a=i[s];void 0===o[a]&&(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}}}function Rv(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Ov(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Pv)):void 0===t&&(t=Nv);for(var n,i,r,o,s,a=new zv(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new zv(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Fv)}function Nv(e){return e.children}function Pv(e){return Array.isArray(e)?e[1]:null}function Lv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Fv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function zv(e){this.data=e,this.depth=this.height=0,this.parent=null}zv.prototype=Ov.prototype={constructor:zv,count:function(){return this.eachAfter(Rv)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ov(this).eachBefore(Lv)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}},Av=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,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",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(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}},Av({exports:{}});var jv=["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"],Hv=["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 Bv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Vv(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Fg(new Set([i].concat(Fg(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Fg(o.map((function(e){return Bv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Fg(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Hv:jv}(r).map((function(e){return Bv(e)}))))}function $v(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,s=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Vv({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Wv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Uv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Yv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,Fg(new Set([n].concat(Fg(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Fg(i.map((function(e){return Uv(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Fg(Wv.map((function(e){return Uv(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Xv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:$v({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:Yv({theme:t,translator:n,id:i,path:r})}}function Kv(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var i=e.split("."),r=c,s=0;s<i.length;s++){var l=i[s];s===i.length-1?r[l]=Xv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}const Gv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Jv=function(){};function Zv(e,t,n,i){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,i)}Jv.extend=function e(t,n){const i=this.prototype;"string"!=typeof t&&(n=t,t="Class");const r=Object.create(this.prototype);for(const e in n)r[e]="function"==typeof n[e]&&"function"==typeof i[e]&&Gv.test(n[e])?function(e,t){return function(){const n=this._super;this._super=i[e];const r=t.apply(this,arguments);return this._super=n,r}}(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=r,o.prototype.constructor=o,o.extend=e,o},Zv.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Zv(this.x,this.y,this.width,this.height)},set(e,t,n,i){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),i>=0?(this.y=t,this.height=i):(this.y=t+i,this.height=-i)},setLTRB(e,t,n,i){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=i?(this.y=t,this.height=i-t):(this.y=i,this.height=t-i)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),i=Math.min(e.x,this.x),r=Math.min(e.y,this.y);return new Zv(i,r,Math.max(0,t-i),Math.max(0,n-r))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Zv(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Zv(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Zv(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,i=t*this.height/2;this.x-=n,this.y-=i,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Qv=new Zv(0,0,0,0),eb=new Zv(0,0,0,0),tb=Jv.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Qv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),eb.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=eb.intersection(Qv,!0),i.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){Qv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),eb.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Qv.intersection(eb,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let nb;function ib(e,t){let n;const i={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(i[n]=e[n]);return t.push(i),i}function rb(e,t,n){let i,r,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),i=0;i<n.length;++i)if(r=n[i],r.qSubNodes.length>0&&(a=rb(e,t,r.qSubNodes)),o=null,(0===r.qSubNodes.length&&nb>=e&&nb<=e+t||a.length>0)&&(o=ib(r,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+i),o.qSubNodes=a),0===r.qSubNodes.length&&nb++,nb===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-i));break}return s}function ob(e,t,n){return nb=0,rb(e,t,n)}const sb=new Zv(0,0,0,0),ab=new Zv(0,0,0,0),lb=tb.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,sb.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ab.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=ab.intersection(sb,!0),i.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){sb.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ab.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=sb.intersection(ab,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qLeft:ob(i,n.height,t.qLeft),qTop:ob(r,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function cb(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new lb;else{if("table"!==e.visualization)return;this.slicer=new tb}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class ub{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,cb.call(this,e)}getData(e){!function(e,t,n,i){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[i]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[i]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Ev(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const hb={version:"0.40.3",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function db(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function fb(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function pb(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let i;return i=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(i)},added(e,t){db(t),fb(t)},moved(e,t){db(t),fb(t)},removed(e,t){db(t),fb(t)}},i={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:i}}var mb={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.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(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.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(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){n.r(t);var i=n(0),r=n.n(i),o=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],s=e;for(i=0;i<r.length-1;++i)void 0===s[r[i]]&&(s[r[i]]=Number.isNaN(+r[i+1])?{}:[]),s=s[r[i]];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 i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a="".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,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=i.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).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 m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,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 v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=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(i&&1===i.length){var c=y(u(i[0],r),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(s,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(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:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(s,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+a.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=r&&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 q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var S=r.a.bind(null,!0),M={},D=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function C(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){A(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!A(e[i],t[i]))return!1;return!0}return e===t}M.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?S({},{val:e}).val:e}(t[r]),s=e[r],a="".concat(n,"/").concat(r);A(o,s)||k(t,r)||(C(s)?i.push({op:"add",path:a,value:o}):_(o)&&_(s)?i=i.concat(M.generate(s,o,a)):D(o)&&D(s)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(A(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var a=r.length-1;a>=0;a-=1)-1===(o=s(t,r[a].qInfo&&r[a].qInfo.qId,a))?(i.push({op:"remove",path:"".concat(n,"/").concat(a)}),r.splice(a,1)):i=i.concat(M.generate(r[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!k(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},M.apply=function(e,t){t.forEach((function(t){var n,i=E(e,t.path),r=t.path.split("/").splice(-1)[0],o=r&&Number.isNaN(+r)?i[r]:i[+r]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,o=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===r&&(r=i.length),i.splice(+r,"add"===t.op?0:1,t.value);else if(D(o)&&D(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(_(o)&&_(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),S(o,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[r]=t.value}else if("move"===t.op){var c=E(e,t.from);D(i)?i.splice(+r,0,c.splice(+s,1)[0]):(i[r]=c[s],delete c[s])}else"remove"===t.op&&(D(i)?i.splice(+r,1):delete i[r])}))},M.clone=function(e){return S({},e)},M.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},M.updateObject=function(e,t){Object.keys(e).length?M.apply(e,M.generate(e,t)):S(e,t)};var T=M,I=function(e,t,n){if(!e)return Promise.resolve();var i=T.generate(t,n);return r()(!0,t,n),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===R)return n[i]}function N(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===R)return i;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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:i,layout:r})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}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(N(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(N(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(N(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(N(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 i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function j(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},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,i=e.modifier,r=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:r,layout:o}));var u=s(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(i,c),p=w.getAboveComp(i,c,d,f);if(i.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:i,properties:r,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=i.showExcludedValues?w.getExcludedComp({modifier:i,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(j(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(j(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(j(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(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===V)return n[i]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===V)return i;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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:i,layout:r})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={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 i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;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,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var i=Q(t,0);t.splice(i,1)}return t}(r,o),function(e,t,n){if(0===e){var i=Q(t,1);t.splice(i,1)}return t}(J(e,i).selectionScope,o)}function te(e,t,n){var i=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var i=Q(t,0);t.splice(i,1)}return t}(J(e,n).dimensionalScope,i)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function ie(e){return 2===e?"{1}":""}function re(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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,s){var a=ie(t),l=re(t,n,i),c=""===a&&""===l?"":a||l,u=oe(r,o),h=se(r,o,s),d=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(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,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:X.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===X.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===X.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:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,i){return ee(n,i,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)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ie,getFieldSelectionComp:re,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 he(e){return(he="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 de={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:me,cleanUpMeasure:ge,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:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:i})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=we(e);ke({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Re({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,i=e.isSnapshot,o=void 0!==i&&i,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"===he(n))return me({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return ke({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=r()(!0,{},e);Se(n);var i=Oe(n);return Ee({model:t}).then((function(r){return Ae({libraryIds:i,model:t}).then((function(i){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ce({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&De(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:r})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,i=Oe(n);return Ne({model:t,libraryIds:i}).then((function(){var e=r()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,i=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?r()(!0,{},i):i),Se(i);var d=Oe(i);return Ne({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,i=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 ge(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ee({model:i,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:i,libraryItemsProps:o}).then((function(i){t.forEach((function(t){ke({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,i=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"===he(e)&&!e.disabled){if(a++,"object"!==he(de[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)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:i,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=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,i.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:i,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=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(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:i,dimensionAndFieldList:e}),Me(t)):ge(t)}))}))}))}({measures:o,properties:i,model:t,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:i,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Me(e)}function ye(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return ke({modifiers:we(e),properties:n,layout:i})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(de[i.type]&&!i.disabled)return i}}function be(e){var t=ve(e);return!t||de[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 qe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Se(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=r()(!0,{},t.base)))}(e)}))}function Me(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function De(e){return e.base||e.qDef&&e.qDef.base}function _e(e){var t=De(e);return e.qLibraryId||t&&t.qLibraryId}function Ce(e){var t=e.measure,n=e.properties,i=e.layout;return!_e(t)&&ke({modifiers:we(t),properties:n,layout:i})}function ke(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===r[e.type]&&(r[e.type]=de[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var s=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(s),Promise.all(i).then((function(){return r}))}function Ae(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return r.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 Ie(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=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 r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&s(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):I(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Re(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Oe(e){var t=xe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=we(t);if(ke({modifiers:i,properties:e})){var o=_e(t);o&&n.push(o),r=r||Re({modifiers:i,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function Ne(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,i={},r={},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(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(i).forEach((function(e){r[e]||o[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!i[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({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 i(e){var t=function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?i(n)+t:t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(""!==s){if(void 0===r[s]||null===r[s])return n;r=r[s]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return i(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,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,s(i.qDimensions));var a,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=r.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var s,a=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=r.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},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 m(e,t,n){var i,r,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((r=(r=(i=JSON.stringify(s)).match(/:\{/g))?r.length:0)>2)return;s=JSON.parse(i)}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 g=n(0),y=n.n(g);function v(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 b(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 q(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(e){return function(e){if(Array.isArray(e))return D(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 D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(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 D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _={importCommonProperties:function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},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,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},s=i.measures||{max:0},a=x(s.max,r.dimensions.length,w),l=x(s.min,r.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,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=y()(!0,{},n,r)).components&&(r.components=[]),r},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>r&&r>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>i||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!r&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=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>i)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>r&&r>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&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,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=q(r.qDimensions);r.qDimensions=[],s.forEach((function(e){r.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=M(r.qMeasures);r.qMeasures=[],s.forEach((function(e){r.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 C(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 k={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:r,qHyperCubeDef:l}),p.addMeasures({exportFormat:r,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:r,properties:s}),n&&(r.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:r,properties:s}),i||p.storeMeasuresModifiers(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(m(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(m(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(m(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,s=void 0===r?{}:r,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=_.createNewProperties({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,D=void 0===M?_.getDefaultDimension():M,k=l.defaultMeasure,E=void 0===k?_.getDefaultMeasure():k;v.qDimensions.length=0,v.qMeasures.length=0,_.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S})&&_.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S,newHyperCubeDef:v}),_.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:D}),_.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:S,newHyperCubeDef:v,defaultMeasure:E}),_.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),_.copyPropertyIfExist("qMaxStackedCells",y,v),_.copyPropertyIfExist("qNoOfLeftDims",y,v),_.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),_.copyPropertyOrSetDefault("qMode",y,v,"S"),_.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),_.copyPropertyOrSetDefault("qSortbyYValue",y,v),_.copyPropertyOrSetDefault("qIndentMode",y,v),_.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),_.importCommonProperties(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return _.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&C(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&C(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var s=e.splice(r,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(A(s,t,i,r),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}}},N={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:N,"sn-scatter-plot":N,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 i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function F(e,t){var n=I.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 z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,s=e.measures,a=e.label;F(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;r||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,i){var r,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":(r=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=r,a.id=r,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i))&&(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,i){var r=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),r){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)}i||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),s=Number(r[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===i&&"point"===a}(n,e,t)?0:n.length-1],r=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return V(e,H("dimension",!!s,s||i)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=H("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,V(e,r)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=H("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,V(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],s=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||i[0])),!!a}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,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 i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var i=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?F(r,a):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions;return!t&&"byDimension"===n&&i.length>0}({auto:i,colorMode:n,dimensions:r})?W(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==a&&!r.length)}({auto:i,colorMode:n,dimensions:r,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),F(i,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,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.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}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=k.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=I.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(s,[],"qAttributeDimensions",c),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=k.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?C(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):C(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,s=r.qHyperCubeDef,a=r.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:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),K.includes(i)&&t[r].type[i]++,t[r].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,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),a=s.properties;return o?(m(a,"measureAxis.min","supportedAutoMinMax"),m(a,"measureAxis.max","supportedAutoMinMax")):(m(a,"measureAxis.min","unsupportedAutoMinMax"),m(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),G.setInterColumnSortOrder(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.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,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,s);if(void 0!==a){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=Z(n,i,l);o.setValue(t,c,a),o.setValue(r,s,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,"qDef.cId");if(a){var l=Z(n,i,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,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:k,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:C,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(mb);var gb=n(mb.exports);const yb=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function vb(e,t,n){for(let i=0;i<n.length;++i){const r=n[i];void 0!==e[r]&&(t[r]=e[r],delete e[r])}}var bb={importColors:function(e){e.color.point=e.color.point||{},vb(e.color,e.color.point,yb),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){vb(e.color.point,e.color,yb),e.color.colorExpression=Ev(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function xb({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:i}){const r=gb.axisChart.importProperties({exportFormat:n,initialProperties:i,dataDefinition:e,defaultPropertyValues:t}),o=r.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),bb.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,r}function wb({propertyTree:e,viewDataMode:t}){const n=gb.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return bb.exportColors(e.qProperty),n}var qb=e=>{const t=pb(e);return{properties:hb,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>xb({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:wb}},Sb=Object.prototype.hasOwnProperty,Mb=Object.prototype.toString,Db=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,Cb=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Mb.call(e)},kb=function(e){if(!e||"[object Object]"!==Mb.call(e))return!1;var t,n=Sb.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Sb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Sb.call(e,t)},Eb=function(e,t){Db&&"__proto__"===t.name?Db(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(!Sb.call(e,t))return;if(_b)return _b(e,t).value}return e[t]},Tb=function e(){var t,n,i,r,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)i=Ab(a,n),a!==(r=Ab(t,n))&&(u&&r&&(kb(r)||(o=Cb(r)))?(o?(o=!1,s=i&&Cb(i)?i:[]):s=i&&kb(i)?i:{},Eb(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Eb(a,{name:n,newValue:r}));return a},Ib=n(Tb);const Rb={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Ob={replaceExpressionTokens:function(e,t,n){const i={start:n&&n.start||"{{",end:n&&n.end||"}}"};let r,o,s=e;for(const e in t)r=t[e],o=i.start+e+i.end,s=s.replace(Nb(o,!0),r);return s},createRegExp:Nb};function Nb(e,t,n){const i=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const r=n?`(${i})`:i;return t?new RegExp(r,"g"):new RegExp(r)}const Pb={generateExpression:function(e,t){const n={};if(t)for(const e in t){const i=t[e],r=i.wrap?Rb.wrapExpression(i.value):i.value;n[e]=r;(i.variations||[]).forEach((t=>{const i=Lb(t,r,e);n[t]=i}))}return Ob.replaceExpressionTokens(e,n)}};function Lb(e,t,n){if(""===t)return"";const i=Ob.createRegExp(n,!0,!0),r=e.split(i);let o="";return r.forEach((e=>{o+=e!==n?e:t})),o}const Fb={generateHyperCubeDef:function(e,t,n,i,r){return function(e,t,n,i){const r={};let o,s;const a=[];let l;e.forEach((e=>{o=Vb(e.match(Bb("Dim"))),o.forEach((e=>{a.push(zb(t.qDimensions[e],i,e,n).then((t=>{r[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=Vb(e.match(Bb("Mea"))),s.forEach((e=>{a.push(jb(t.qMeasures[e],i).then((t=>{r[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(r))):Promise.resolve(r);return l}(e.dimensions.concat(e.measures),t,n,i).then((n=>{const i=Ib({},n,r),o=Ib(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Pb.generateExpression(e,i)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Pb.generateExpression(e,i)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const i=e.qDimensions.map(((e,i)=>zb(e,n,i,t))),r=e.qMeasures.map((e=>jb(e,n)));return{dimensions:await Promise.all(i),measures:await Promise.all(r)}}};function zb(e,t,n,i){if(e.qLibraryId)return Hb(e.qLibraryId,"dimension",t,n,i);const r=i.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[r])}function jb(e,t){return e.qLibraryId?Hb(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Hb(e,t,n,i,r){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[r.qDimensionInfo[i].qGroupPos]:e.qMeasure.qDef))))}function Bb(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Vb(e){return e?e.map((e=>e.substr(6,1))):[]}function $b(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const i=e();switch(t){case"descending":n("integer",i?1:-1);break;case"ascending":n("integer",i?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Wb={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,i){if(n){let n=e()?-1:1;n*=t,i("integer",n)}else i("integer",0)}}},enumConvertFunctions:$b,invertedEnumConvertFunctions:function(e){return $b((function(){return!e||!e()}))}};const Ub=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Yb(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Ub,convertFunctions:n.sorting,show:t=>0!==Ev(t,e,0)}}}}var Xb={state:function(e,t){return Yb(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Yb(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.enumConvertFunctions(t)})},numeric:function(e,t){return Yb(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Wb.booleanConvertFunctions(t,-1),sorting:Wb.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Wb.booleanConvertFunctions(t),sorting:Wb.enumConvertFunctions(t)},i=Yb(e,"properties.sorting.sortByExpression",n);return i.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Ev(t,e,0)},i},frequency:function(e,t){return Yb(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.invertedEnumConvertFunctions(t)})}};const Kb=(e,t,n)=>{const i={getOptions:(i,r)=>{const o=(e,t)=>({ref:`${r}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${r}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:i,items:{fontFamily:{ref:`${r}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${r}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${r}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${r}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${r}.fontSize`),defaultValue:()=>e.getDefaultValue(`${r}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return i},Gb=(e,t,n,i,r)=>i({theme:e,translator:t,flags:r,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Jb=(e,t)=>(t.components||[]).find((t=>t.key===e)),Zb=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3364")?null===(r=Jb("axis",n))||void 0===r?void 0:r.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")}}},Qb=(e,t,n,i)=>{var r,o,s,a,l,c,u,h;const d=i.isEnabled("CLIENT_IM_3364")?null===(r=Jb("axis",n))||void 0===r?void 0:r.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},ex=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3051")?null===(r=Jb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.title","color")}},tx=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3051")?null===(r=Jb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==c||null===(o=c.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==c||null===(s=c.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==c||null===(a=c.label)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.label","color")}},nx={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function ix(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(nx);const rx={hasMultipleDimensions:ix,getOuterDimensionCardinality:function(e){const t=Ev(e,nx.HYPERCUBE_PATH);return ix(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Ev(e,nx.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByAscii`,0)}},ox={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var sx={create(e,t){if(!e||!ox[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let i=-1;return e&&(n=n||"id",e.forEach(((e,r)=>{e[n]===t&&(i=r)}))),i},moveById(e,t,n,i){const r=this.getIndexById(e,n,i);t=t||[];const o=this.getIndexById(t,n,i);if(-1!==r&&-1===o){const n=e.splice(r,1);t.push(n[0])}return t},moveAllById(e,t,n,i){const r=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),s=r.filter((e=>!(o.filter((t=>t[i]===e[i])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,i,r),a!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),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"}};var ax={getColorByDefinition:function(e,t,n){const i={};let r,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(i.type="dimension",i.name=n.qLibraryId,i.id=n.qLibraryId):(i.type="field",t?(i.name=n.label||n.qDef,i.id=n.qDef):(r=n.qDef,o=!!r.qLabelExpression,s=r.qFieldLabels&&r.qFieldLabels[0],i.name=r.qFieldDefs[0],i.label=o?r.qLabelExpression:s?r.qFieldLabels[0]:r.qFieldDefs[0])),i}};var lx={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const cx=["scatterplot","map"],ux=["map"];var hx={baseColor:{isSupported:e=>e&&e.length&&-1===cx.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==ux.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,i){this.updateColorDef(e,i,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]);let a,l,c,u;if(!r&&"byDimension"===i&&o.length)a=Ev(n,"byDimDef"),a&&yx(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=ax.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,mx(n,u)):a&&a.key||(l=o[o.length-1],c=sx.getById(l.qAttributeDimensions,sx.IDMAP.COLOR_BY_ALTERNATIVE),mx(n,ax.getColorByDefinition("dimension",!!c,c||l)));else{if(!r&&"byMeasure"===i&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===i&&s.length<2&&Iv(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]),a=Ev(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!r&&"byDimension"===i&&o.length?gx(n,!0,o,a,s,Ev(n,"byDimDef.label")):!r&&"byMeasure"===i&&o.length?gx(n,!1,o,a,s,Ev(n,"byMeasureDef.label")):dx(o,a)},setColorByPropertyDef:mx,resolveColorByPropertyDef:gx,clearColorByItem:dx};function dx(e,t){e.forEach((e=>{fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function fx(e,t,n){if(e[n]){const i=sx.getIndexById(e[n],t);i>=0&&e[n].splice(i,1)}else e[n]=[]}function px(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function mx(e,t,n,i){const r=n?"expression":t.type;let o=e.mode;switch(yx(e,t.label||t.name||""),r){case"field":o="byDimension",e.byDimDef={label:t.label||px(t.name),key:px(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&lx.useMasterNumberFormat(e.formatting)}i||(e.auto=!1,e.mode=o)}function gx(e,t,n,i,r,o){dx(n,i);const s=n[n.length-1];if(s){const n=Ev(e,t?"byDimDef":"byMeasureDef"),i=Ev(e,"formatting.qNumFormat"),a=Ev(e,"formatting.isCustomFormatted");if(n){const e=sx.create(sx.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,i&&(e.qNumFormat=i,e.isCustomFormatted=a));break;case"libraryItem":if(!t){let t=-1;r.forEach(((e,i)=>{n.key===e.qLibraryId&&(t=i)})),e.matchMeasure=t,i&&(e.qNumFormat=i,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function yx(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function vx(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function bx(e){return"libraryItem"===Ev(e,"color.point.byDimDef.type")}function xx(e){return"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}function wx(e){return!0===Ev(e,"color.point.auto")}function qx(e){return!wx(e)&&"byDimension"===Ev(e,"color.point.mode")}function Sx(e){return!wx(e)&&"byMeasure"===Ev(e,"color.point.mode")}var Mx={measuresHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!vx(e))).length>0},dimensionsHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!vx(e))).length>0},onGlobalChangeColors:function(e){hx.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&i&&(i.qCalcCond=n.qCalcCond,i.qCalcCondition=n.qCalcCondition)},isColorByDimension:qx,isColorByMeasure:Sx,isColorAuto:wx,isColorByExpression:function(e){return!wx(e)&&"byExpression"===Ev(e,"color.point.mode")},isColorBySingle:function(e){return!wx(e)&&"primary"===Ev(e,"color.point.mode","primary")},isDimensionLibraryItem:bx,isMeasureLibraryItem:xx,showLegend:function(e){const t=Ev(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===wx(e)},showColorByLabel:function(e){const t=qx(e)&&!1===bx(e),n=Sx(e)&&!1===xx(e),i=Ev(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!i||n},hasDimValueColors:function(e,t){var n,i,r;return null===(n=null===(i=e.layout.qHyperCube.qDimensionInfo[t])||void 0===i||null===(r=i.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function Dx(e,t){this.getSettings=e,this.getElements=t}function _x(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],i=this.getSettings();Iv(n,"qSortByExpression",i.SORT_BY_EXPRESSION),Iv(n,"qSortByAscii",i.SORT_BY_ASCII),Iv(n,"qSortByNumeric",i.SORT_BY_NUMERIC),Iv(n,"qSortByLoadOrder",i.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const r=Cx(this.getElements());n.qExpression.qv=r.exp}function Cx(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Dx.prototype.applyAutoSorting=_x,Dx.prototype.applyDefaultCustomSorting=function(e,t){_x.call(this,e);const n=Cx(this.getElements()),i=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Iv(t.sortCriteria,"sortByExpression",i.qSortByExpression),Iv(t.sortCriteria,"sortByAscii",i.qSortByAscii),Iv(t.sortCriteria,"sortByNumeric",i.qSortByNumeric),Iv(t.sortCriteria,"sortByLoadOrder",i.qSortByLoadOrder)},Dx.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Iv(n,"qSortByExpression",t.sortCriteria.sortByExpression),Iv(n,"qSortByAscii",t.sortCriteria.sortByAscii),Iv(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Iv(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const kx={create:function(e,t){return new Dx(e,t)}};const Ex={applySorting:function(e,t,n){const i=n.autoSort,r=!!n.sortCriteria;i?e.applyAutoSorting(t):r?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Ax={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Ax.ASCII),Object.freeze(Ax);const Tx=Ib(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Ax);const Ix={getSettings:function(e){return Ev(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Tx.DIST_MAX:Tx.ASCII}};function Rx(e,t,n,i){let r="Fractile";0===e?r="Min":1===e&&(r="Max");const o=t?Rb.wrapExpression(t):"",s=n?Rb.wrapExpression(n):"";return`${r}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(i||"").replace(/^=/,""))}const Ox={getElementIds:function(){return[nx.SORTING_ELEMENT_MIN_ID,nx.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,i){const r=t[0],o=t[1],s=e[0],a=Rx(0,r,o,s),l=Rx(1,r,o,s);return[{id:nx.SORTING_ELEMENT_MIN_ID,label:i.get("properties.distributionPlot.min"),exp:a,isDefault:nx.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:nx.SORTING_ELEMENT_MAX_ID,label:i.get("properties.distributionPlot.max"),exp:l,isDefault:nx.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Rx};function Nx(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Px(e,t,n,i){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const r=e.qUndoExclude.qHyperCubeDef.qDimensions;r.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Ix.getSettings(t)},s=kx.create(o,(function(){const e=o();return Ox.getElements(n.measures,n.dimensions,e,i)})),a=r[0],l=e.sorting;Ex.applySorting(s,a,l)}const Lx={applySorting:function(e,t,n,i,r){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Nx("'qHyperCubeDef.qDimensions' has no outer dimension"):Nx("no 'qHyperCubeDef.qMeasures' in properties arg"):Nx("no 'qHyperCubeDef.qDimensions' in properties arg"):Nx("no 'qHyperCubeDef' in properties arg")}(e),i?Px(e,t,i,r):Fb.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Px(e,t,n,r)}))}},Fx=`${nx.SORT_CRITERIA}.sortByExpression`;const zx={updateSortOrder:function(e,t){if(!t)return;const n=Ev(e,Fx);if(!(-1===n||1===n))return;const i=Ev(e,nx.SORTING_ELEMENT_ID),r=Ev(t,nx.SORTING_ELEMENT_ID),o=!!r,s=i===nx.SORTING_ELEMENT_MIN_ID,a=i===nx.SORTING_ELEMENT_MAX_ID,l=r===nx.SORTING_ELEMENT_MIN_ID,c=r===nx.SORTING_ELEMENT_MAX_ID,u=s&&c,h=a&&(!o||l),d=Ev(t,Fx),f=a&&!(-1===d||1===d)&&1===n;u?Iv(e,Fx,1):(h||f)&&Iv(e,Fx,-1)}},jx=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Hx=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:jx(n,t)});function Bx(e){return!Ev(e,"color.point.auto")&&"byDimension"===Ev(e,"color.point.mode")&&Ev(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Vx(e){const{flags:t,translator:n}=e,i=e.anything.sense.theme,r=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:i.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!Ev(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!Ev(e,"color.point.auto",!0)&&"primary"===Ev(e,"color.point.mode","primary"),defaultValue(){const e=i.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!Ev(e,"color.point.auto")&&"byExpression"===Ev(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=Gb(i,n,nx.CHART_ID,Kv,t),u=Kb(c,i,nx.CHART_ID),h={type:"items",translation:"properties.presentation",items:{styleEditor:r&&Hx(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},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}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:nx.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,i){const{autoMinMax:r,minMax:o,min:s}=(null==i?void 0:i.measureAxis)||{};return!0===r?"lowest":r||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,i,r){"zero"===e?(Iv(r,"measureAxis.autoMinMax",!1),Iv(r,"measureAxis.minMax","min"),Iv(r,"measureAxis.min",0)):Iv(r,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Ev(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=Ev(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,i,r;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l,c;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",i=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(c=l.qHyperCube)||void 0===c?void 0:c.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<i.length;e++){const t=i[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(i=null===(r=e.color.point.byDimDef)||void 0===r?void 0:r.label)&&void 0!==i?i:""},g=(e,t,i)=>{var r,o;if(null!==(r=e.qHyperCubeDef)&&void 0!==r&&null!==(o=r.qDimensions)&&void 0!==o&&o.length){var s,a,l,c,u;const t=null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(a=null===(l=e.color)||void 0===l||null===(c=l.point)||void 0===c||null===(u=c.byDimDef)||void 0===u?void 0:u.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,i)}),t}return[]},y=(e,t)=>{const n="measure"===Ev(e,"color.point.useBaseColors")&&Mx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Mx.dimensionsHasBaseColors(t);return Mx.isColorBySingle(e)&&!n&&!i},v=(e,t)=>!Ev(e,"color.point.auto",void 0)&&"primary"===Ev(e,"color.point.mode",void 0)&&!y(e,t),b={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&v(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!v(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>Ev(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Ev(e,"color.point.auto")||(Iv(e,"color.point.mode","primary"),Iv(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===Ev(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Mx.isColorAuto(e),change(e){if("primary"===Ev(e,"color.point.mode",void 0)){const t=Ev(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Iv(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Mx.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const i=Ev(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Mx.isColorAuto(e)&&"primary"===i&&(Mx.measuresHasBaseColors(n)||Mx.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,i){var r,o,s;const a=null!==(r=null===(o=e.color.point)||void 0===o||null===(s=o.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==r?r:null,l=Mx.hasDimValueColors(i.handler,a);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Mx.isColorByDimension(e)&&Mx.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Mx.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),Ev(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Mx.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Mx.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Mx.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Mx.showColorByLabel,change(e){const t=Ev(e,"color.point.mode"),n=Ev(e,"color.point.altLabel","");let i;switch(t){case"byMeasure":i=e.color.point.byMeasureDef;break;case"byDimension":i=e.color.point.byDimDef}i&&(i.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=Ev(e,"color.point.mode","primary");return!Mx.isColorAuto(e)&&"primary"===n&&(Mx.measuresHasBaseColors(t)||Mx.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Ev(e,"color.point.auto")&&"byMultiple"===Ev(e,"color.point.mode")&&"measure"===Ev(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Mx.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Ev(e,"color.point.useBaseColors")&&Mx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Mx.dimensionsHasBaseColors(t);return Mx.isColorBySingle(e)&&!n&&!i}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Mx.isColorByDimension(e)&&Mx.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=Ev(e,"color.point.auto"),n=Ev(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Ev(e,"color.point.auto")||"byDimension"!==Ev(e,"color.point.mode")||"libraryItem"!==Ev(e,"color.point.byDimDef.type")?Bx(e):Bx(e)&&!Ev(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Mx.isColorAuto(e)&&Mx.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Mx.isColorAuto(e)&&Mx.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Mx.isColorByDimension(e)&&(!Mx.isDimensionLibraryItem(e)||!Ev(e,"color.point.useDimColVal"))},customRange:{show:e=>!Mx.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Mx.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Mx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Mx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Mx.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Mx.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Mx.showLegend(e)&&Ev(e,"legend.show",!0)},showTitle:{show:e=>Mx.showLegend(e)&&Ev(e,"legend.show",!0)}}}}},w={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,r){r.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:w,general:l,presentation:h,colors:x||a,measureAxis:d,dimensionAxis:f}},S={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Mx.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},M=Xb.expression(`${nx.SORT_CRITERIA}.sortByExpression`),D={type:"items",items:{toggled:M.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:nx.SORTING_EXPRESSION,elementRef:nx.SORTING_ELEMENT_ID,show:rx.isSortByExpression,elements:e=>Fb.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const i=Ix.getSettings(e.layout);return Ox.getElements(t.measures,t.dimensions,i,n)}))},order:M.items.order}},_={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&zx.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:nx.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:rx.hasMultipleDimensions,change(e,t,i,r){if(e&&rx.hasMultipleDimensions(e)&&t.layout)return Lx.applySorting(e,t.layout,r.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:nx.SORTING_EXPRESSION,elementRef:nx.SORTING_ELEMENT_ID,sortCriteriasRef:nx.SORT_CRITERIA,show:e=>rx.hasMultipleDimensions(e)&&!rx.isAutoSort(e),elements:e=>Fb.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const i=Ix.getSettings(e.layout);return Ox.getElements(t.measures,t.dimensions,i,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>rx.hasMultipleDimensions(e)&&!rx.isAutoSort(e),items:{expression:D,numeric:Xb.numeric(`${nx.SORT_CRITERIA}.sortByNumeric`),ascii:Xb.ascii(`${nx.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!rx.isSortByExpression(e)&&!rx.isSortByNumeric(e)&&!rx.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!rx.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:_,addons:S,settings:q}}}const $x={buildDefinition:function(e,t,n,i,r){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Ev(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=Wx(e,o).chart;l||(l="sortByAscii");const c=Ev(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=i(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=r(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=Wx(e,o).dimension;return t?Ev(e,o+t):0}}}};return s}};function Wx(e,t){const n={chart:"",dimension:""};return 0!==Ev(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Ev(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Ev(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Ux={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:$x.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Ix.getSettings,Ox.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Yx={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Mx.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Mx.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Mx.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Mx.showLegend}}}}};function Xx(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Vx(e),softDefinition:Ux,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Mx.onGlobalChangeColors(t)},importProperties:(t,n,i)=>{const r=pb(e);i.mapProperties();return xb({dataDefinition:r,defaultPropertyValues:{defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>wb({propertyTree:e,viewDataMode:n})}}Ib(!0,Ux,Yx);const Kx={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 Gx(){return Kx.id()}const Jx="scrollbar";function Zx(e,t,n){return"y"===e?Qx(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Qx(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var ew={getAxisDock:Zx,getOppositeAxisDock:function(e,t,n){return Zx(e,"far"===t?"near":"far",n)},getYAxisDock:Qx};const tw=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),nw=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),iw=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function rw(e){return tw.test(e)}function ow(e){return nw.test(e)||iw.test(e)}var sw={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],rw(i))return"ltr";if(ow(i))return"rtl"}return"ltr"}};var aw={lineSettings:function(e,t){var n;const i={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 Ib(!0,i,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let i=t.theme.getStyle(n,"referenceLine.label.name","color");const r=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?i=t.theme.getColorPickerColor(t.paletteColor):i||(i="transparent"),Ib(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:i,fontFamily:o,fontSize:r,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} ${sw.lrm}(${n})${sw.lrm}`:`${sw.lrm}(${n})${sw.lrm}`:!1!==e.showLabel?t:""}};const lw={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}}};lw.DEFAULT_CHART_ORIENTATION=lw.HORIZONTAL;const cw=100;function uw(e,t){const n=t||{},i=n.measureAxisProperties||{},r=n.dimensionAxisProperties||{},o=n.orientation||lw.DEFAULT_CHART_ORIENTATION,s=o===lw.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=lw.SHOW_AXIS_LABELS_OPTIONS,u=lw.SHOW_TITLE_OPTIONS,h=c.includes(i.show),d=!!n.measureTitleText&&u.includes(i.show),f=n.includeDimensionAxis&&c.includes(r.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(r.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,i){let r={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:i&&!i.autoMinMax&&i.showBounds};r=Ib(r,lw.LAYOUTSETTINGS.measureAxis);const o=dw(t,n);e.addComponent(`${n}-axis`,r,o)}(e,n,a,i),d&&function(e,t,n){let i={text:t.measureTitleText,style:t.axisTitleStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.measureAxisTitle);const r=function(e,t){return dw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,a),function(e,t,n,i){let r=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:i};i&&i.spacing>0&&(r=Ib(!0,r||{},{component:{ticks:{distance:i.spacing*cw}}}));e.addScale("measure-scale",r,o)}(e,n,o,i),f&&function(e,t,n){let i={scale:"dimension",settings:t.axisLabelStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.dimensionAxis);const r=fw(t,n);Ib(!0,i,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,i,r)}(e,n,l),p&&function(e,t,n){let i={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.dimensionAxisTitle);const r=function(e,t){return fw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const i={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===lw.HORIZONTAL?lw.VERTICAL:lw.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,i)}(e,n,o),m&&function(e,t,n){let i={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};i=Ib(i,lw.LAYOUTSETTINGS.gridLines),i[n]={scale:"measure"},e.addComponent("grid-line",i)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,i){const r=e.getSettings();r.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:!i},s=Ib({},lw.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),hw(t,function(e){function t(t,n){if(!n||!e())return!1;const i={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(i).some((e=>e.settings.key===Jx))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Jx).emit("tap",e)}}},i={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Jx).emit("panStart",e)},pan(e){this.chart.component(Jx).emit("panMove",e)},panend(e){this.chart.component(Jx).emit("panEnd",e)},pancancel(e){this.chart.component(Jx).emit("panCancel",e)}}};return[n,i]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,i){const r=ew.getAxisDock(n,i.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Ib(o,lw.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Gx()}`,require:["renderer","chart"],dock:ew.getOppositeAxisDock(n,i.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,i=this.chart.formatter({data:e.settings.scales.measure.data}),r=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${i(e.value)})`:"",r=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:r,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=r[0];for(let e=1;e<r.length;e++)r[e].wanted>o.wanted&&(o.wanted=r[e].wanted),r[e].required>o.required&&(o.required=r[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Ib(s,lw.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((i=>{if(!i.show)return;const a=i.refLineExpr&&i.refLineExpr.value,l=Ib(!0,{},t,{paletteColor:i.paletteColor,style:i.style,chartID:e.options.chartID}),c=aw.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=aw.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==i.showLabel?i.label:"",showValue:!1!==i.showValue}},l);"x"===n?u.label.vAlign="near"===r?1:0:u.label.align="near"===r?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,i),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",lw.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeDim"};o=Ib(o,lw.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.dimRange||{},s,fw(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMeasure"};o=Ib(o,lw.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.measureRange||{},s,dw(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMinor"};o=Ib(o,lw.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:i,isRtl:r,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,fw(n,l).dock,n.isRtl)}n.brushActions&&hw(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function hw(e,t){t.forEach((t=>{e.push(t)}))}function dw(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function fw(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function pw(e,t){const n=t||{},i=!n.orientation||"horizontal"===n.orientation,r=!!n.isRtl,o={name:n.name||"scale",component:{invert:i&&r,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Ib(!0,{},o,e||{})}function mw(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 gw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=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"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:mw(t.flags),dock:ew.getAxisDock(r,i,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Ib(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function yw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=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:ew.getAxisDock(r,i,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Ib(!0,{},c,e||{})}pw.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const i={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},r=t&&t.measureAxisProperties;r&&!r.autoMinMax&&(["min","minMax"].includes(r.minMax)&&(i.component.min=r.min),["max","minMax"].includes(r.minMax)&&(i.component.max=r.max));const o=pw(Ib(!0,i,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},pw.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 pw(Ib(!0,n,e||{}),t)},gw.xAxis=function(e,t){return gw(Ib(!0,{key:"x-axis",scale:"x"},e||{}),t)},gw.yAxis=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis",scale:"y",dock:ew.getYAxisDock(n,i)};return gw(Ib(!0,r,e||{}),t)},yw.xAxisTitle=function(e,t){return yw(Ib(!0,{key:"x-axis-title"},e||{}),t)},yw.yAxisTitle=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis-title",dock:ew.getYAxisDock(n,i)||"left"};return yw(Ib(!0,r,e||{}),t)};var vw={getBublesAlign:function(e,t,n){let i=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(i=!i),i?"start":"end"},getDock:function(e,t){const n=[];let i;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(i=n.join(",")),i}};const bw={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 xw(){return bw}function ww(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}xw.getLayoutModeKeys=function(){const e=[];let t;for(t in bw)e.push(t);return e};const qw={left:"left",right:"right",up:"top",down:"bottom"};function Sw(e,t,n){switch(e){case"scale":return pw(t,n);case"measure-scale":return pw.measureScale(t,n);case"dimension-scale":return pw.dimensionScale(t,n);case"axis":return gw(t,n);case"box-marker":return function(e){return Ib(!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 Ib(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,i=t&&t.chartID,r=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:r?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(i,"","backgroundColor"),invert:n&&r}};return Ib(!0,{},o,e||{})}(t,n);case"text":return yw(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushComponents?t.brushComponents:[],r=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 i.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:r})})),Ib(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=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:vw.getDock(i,r),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vw.getBublesAlign(s,a,l)}}};return Ib(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=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 h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:vw.getDock(i,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vw.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return r.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Ib(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t&&t.dock||"auto";const o=t&&t.show;"auto"===r&&(r=t.chartHeight/t.chartWidth<1?i?"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"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:mw(t.flags),dock:r,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:i?"rtl":"ltr",size:"top"===r||"bottom"===r?2:1,vertical:"top"===r||"bottom"===r?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-${qw[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,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 Ib(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t.dock||"auto";"auto"===r&&(r=t.chartHeight<t.chartWidth?i?"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 h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:r,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(i?"right":"left"),major:{invert:"left"===r||"right"===r||i},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Ib(!0,{},d,e)}(t,n);case"x-axis":return gw.xAxis(t,n);case"y-axis":return gw.yAxis(t,n);case"x-axis-title":return yw.xAxisTitle(t,n);case"y-axis-title":return yw.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"grid.line.major","color");return Ib(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:i},minorTicks:{stroke:i}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Ib(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),r=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Ib(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:r,text:{fill:i},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Ib(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"label.value","color"),r=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:mw(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(r),align:.5,labels:[{placements:[{position:"outside",fill:i,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:ww}]}}}]}};return Ib(!0,{},s,e||{})}(t,n);default:return}}function Mw(e){this.options=e||{},this.settings={dockLayout:{layoutModes:xw()},components:[],scales:{}}}Mw.prototype.addComponent=function(e,t,n){const i=Sw(e,t,Ib(!0,{},this.options,n||{}));return this.settings.components.push(i),i},Mw.prototype.addInteraction=function(e,t){const n=Sw("interaction",e,Ib(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Mw.prototype.addScale=function(e,t,n){const i=Sw(e,t,Ib(!0,{},this.options,n||{}));this.settings.scales[i.name]=i.component},Mw.prototype.getSettings=function(){return this.settings},Mw.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Mw.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");uw(t,n)}(e,this,t)},Mw.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))},Mw.create=function(e){return new Mw(e)},Mw.createComponent=Sw;const Dw={CENTER:0,BOTTOM:1};var _w={DISCLAIMERS:[{label:"NoDataExist",alignment:Dw.CENTER,default:!0},{label:"RequireNumericDimension",alignment:Dw.CENTER,default:!1},{label:"OnlyNanData",alignment:Dw.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:Dw.CENTER,default:!1},{label:"LimitedData",alignment:Dw.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:Dw.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:Dw.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:Dw.BOTTOM,default:!1}],ALIGNMENT:Dw};const Cw={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,i=!1;var r;return e?void 0!==t.explicitLimitedData?i=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?i=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(r=e.qStackedDataPages)&&r[0]&&r[0].qData[0]&&r[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,i=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):i=!0===t.explicitLimitedData,i},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 i,r,o,s,a;for(e&&(r=!(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,i=0;i<n;i++)if(s=Math.min(s,t[i].qMin),a=Math.max(a,t[i].qMax),s<=0&&a>=0)return!0;return s=r?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},i={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,_w.DISCLAIMERS.forEach((e=>{i[e.label]=!1})),t&&t.qHyperCube?(i.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),i.NoDataExist?i:(i.RequireNumericDimension=n.explicitRequireNumericDimension,i.RequireNumericDimension||(i.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),i.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),i.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),i)):i}};function kw(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Ew(e,t){return e&&t&&t[e]}function Aw(e){this.environment=e,this.clear()}kw.prototype.isValidAndSupported=function(e,t){return Ew(e.label,this.dataAttributes)&&(e.default||Ew(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},kw.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((i=>{n.isValidAndSupported(i,e)&&(t=!0)})),t},kw.prototype.getMessage=function(e,t){let n="";const i=this;return t&&this.disclaimersConfig.forEach((r=>{i.isValidAndSupported(r,e)&&(n+=`${t.get(`Object.Disclaimer.${r.label}`)} `)})),n},Aw.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Aw._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Aw.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,i=Ib(!0,{},this.vizAttributes.supportedDisclaimers),r=new kw(_w.DISCLAIMERS,this.dataAttributes,i);let o,s;if(r.isAnyValidDisclaimer(_w.ALIGNMENT.CENTER))o=r.getMessage(_w.ALIGNMENT.CENTER,n),s="center";else{if(!r.isAnyValidDisclaimer(_w.ALIGNMENT.BOTTOM))return;o=r.getMessage(_w.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)}}},Aw.prototype.set=function(e){if(this.clear(),!e)throw new Error(Aw.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Cw.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Aw.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Tw=Jv.extend({init(e,t,n,i,r){this.$element=t,this.environment=n,this.backendApi=i,this._selectionsApi=r,this._on=!1,this._disclaimer=new Aw(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:[Mw.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 i,r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,i=Math.floor(1e4/e);r={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,i):i}}else r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};i="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([r],null,t).then((e=>{t[i]=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),i=this.createChartSettings(this.layout);n?i.components=[t]:t&&i.components.push(t),Mw.validateComponentKeys(i.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,i),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=Ib(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var i,r;const o=null!==(i=null===(r=this.environment.appLayout)||void 0===r?void 0:r.qLocaleInfo)&&void 0!==i?i:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Ev(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})});function Iw(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}const Rw={generateHash:function(e){return Iw(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Rw.generateHash(t)}};const Ow={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:Pw(t),dimensionExpressions:Nw(t),measureExpressions:e})))}};function Nw(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Pw(e){const t=function(e){return Ev(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Lw={},Fw=Ib.bind(null,!0);function zw(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const jw=Array.isArray,Hw=function(e){return void 0===e},Bw=function(e){return"function"==typeof e};function Vw(e,t){return Bw(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function $w(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach(((t,r)=>{r!==n.length&&(i=+t,e[i||t]=Hw(e[i||t])?Number.isNaN(+i)?{}:[]:e[t],e=e[i||t])})),e}function Ww(e,t){if(zw(e)&&zw(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Ww(e[n],t[n]))return!1;return!0}if(jw(e)&&jw(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!Ww(e[n],t[n]))return!1;return!0}return e===t}Lw.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach((r=>{const o=function(e){return e&&(e=Fw({},{val:e}).val),e}(t[r]),s=e[r],a=`${n}/${r}`;Ww(o,s)||Vw(t,r)||(Hw(s)?i.push({op:"add",path:a,value:o}):zw(o)&&zw(s)?i=i.concat(Lw.generate(s,o,a)):jw(o)&&jw(s)?i=i.concat(function(e,t,n){let i=[];const r=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Hw(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Ww(t,r))return i;if(null===t[0]||!Hw(t[0])&&Hw(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(o=r.length-1;o>=0;--o)a=l(t,r[o]&&r[o].qInfo&&r[o].qInfo.qId,o),-1===a?(i.push({op:"remove",path:`${n}/${o}`}),r.splice(o,1)):i=i.concat(Lw.generate(r[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(r,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(i.push({op:"add",path:`${n}/${o}`,value:t[o]}),r.splice(o,0,t[o])):a!==o&&(i.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),r.splice(o,0,r.splice(a,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:`${n}/${r}`,value:o}))})),Object.keys(e).forEach((r=>{Hw(t[r])&&!Vw(e,r)&&i.push({op:"remove",path:`${n}/${r}`})})),i},Lw.apply=function(e,t){t.forEach((t=>{const n=$w(e,t.path);let i=t.path.split("/").splice(-1)[0];const r=i&&Number.isNaN(+i)?n[i]:n[+i]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(jw(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(jw(r)&&jw(t.value)){const e=t.value.slice();r.length=0,r.push.apply(r,e)}else zw(r)&&zw(t.value)?(s=r,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Vw(s,e)&&delete s[e]})),Fw(r,t.value)):n[i]=t.value;else if("move"===t.op){const r=$w(e,t.from);jw(n)?n.splice(+i,0,r.splice(+o,1)[0]):(n[i]=r[o],delete r[o])}else"remove"===t.op&&(jw(n)?n.splice(+i,1):delete n[i]);var s}))},Lw.clone=function(e){return Fw({},e)},Lw.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},Lw.updateObject=function(e,t){Object.keys(e).length?Lw.apply(e,Lw.generate(e,t)):Fw(e,t)};class Uw{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Lw.generate(e,t);return Ib(!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,i=await t;if(n.qExtendsId)return;const r=Lw.generate(n,i);Lw.apply(n,r);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Yw={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 Xw={saveDerivedProperties:function(e,t,n,i){if(Yw.canModifyHardProperties(t))return e.setProperties(n);return new Uw(e).saveSoftProperties(i,n)}};var Kw={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Gw(){this._generationInProgress=!1}function Jw(e){Kw.validate(e);const t=e.properties,n=Rw.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Gw.prototype.isDerivedUpToDate=Jw,Gw.prototype.updateDerivedProperties=function(e){if(Kw.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Jw(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,i=e.layout,r=Ib(!0,{},e.properties),o=Ib(!0,{},r);return this._generationInProgress=!0,Rw.updateHash(r,e.hashData),e.generateDerivedProperties(i,r).then((()=>Xw.saveDerivedProperties(n,i,r,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Gw.prototype.addDefaultHyperCubeHash=function(e,t,n,i){return Ow.getDefaultHashDataForHyperCube(e,t,n).then((e=>Ib(!0,i,e)))};var Zw={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(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 r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=r(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)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||s.call(e,t)},d=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,i,r,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)i=f(a,n),a!==(r=f(t,n))&&(p&&r&&(h(r)||(o=u(r)))?(o?(o=!1,s=i&&u(i)?i:[]):s=i&&h(i)?i:{},d(a,{name:n,newValue:e(p,s,r)})):void 0!==r&&d(a,{name:n,newValue:r}));return a};function m(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.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 g(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function y(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=m(r.field,s,{cache:t},d);if(-1===e)return;f=p({qRow:a},e(l))}u[h]=g(r,f,{key:c})}function v(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),S=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(S[h[e]]=[]);for(let o=0;o<r.length;o++)y({cache:n,f:l,mainCell:q,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:i.fields?S[h[e]]:S,targetProp:i.fields?o:h[e],columnOrder:s.qColumnOrder});if(i.fields){const t=S[h[e]].map((e=>e.value)),n=S[h[e]].map((e=>e.label));S[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(S[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:q,obj:S,target:b,tracker:v,trackType:f}),x.push(S)}}}const w=d?i.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function q(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this}function S(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function M(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function D(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))}function _(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function C(e){for(var t=this,n=k(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function k(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function E(){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 I(){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,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,i,r,o,s,a=new j(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new j(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(z)}function N(){return O(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(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}j.prototype=O.prototype={constructor:j,count:x,each:w,eachAfter:S,eachBefore:q,find:M,sum:D,sort:_,path:C,ancestors:E,descendants:A,leaves:T,links:I,copy:N,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function X(){var e,t=U,n=Y;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>K(e(t,n,i)))),n=t.map(G),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new j(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.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],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(z),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=H(e),i):t},i.parentId=function(e){return arguments.length?(n=H(e),i):n},i.path=function(t){return arguments.length?(e=H(t),i):e},i}function K(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 i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Z(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Z(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Q(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Q(e[r].children,t-1,n)]);return i}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 i=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,i-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,ie=/^\/?qMeasureInfo\/(\d+)/,re=/\/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 i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(r=!0,o=+ne.exec(h)[1],h=i.replace(ne,"")),ie.test(h)&&("K"===n.qMode?c=+ie.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ie.exec(h)[1],u=0):u=+ie.exec(h)[1],h=h.replace(ie,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:re.exec(h)&&(s=+re.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,i,r=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ue(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function he(e){let{propsArr:t,props:n,item:i,itemData:r,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 h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const de=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Z(i,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[r])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],i=se(e),r=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const i=t[e];let r="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=i[o[e]],s="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:r,qValues:[]},t),c=!0),r=s}if(c)for(let e=0;e<s.length;e++){const t=i[s[e]];a[r].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=X().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:i,cache:r,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:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,i,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=i.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=i.fields[e]}const{props:l,main:u}=r.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:i}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:i,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,i=c[h[e].depth].main,r=u[e],o=r.data,a=ue(i,o,{key:s});he({propsArr:t,props:n,item:r,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function ge(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const S=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...S]}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 ve=ye((function(e){
26
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",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(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}},Av({exports:{}});var jv=["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"],Hv=["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 Bv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Vv(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Fg(new Set([i].concat(Fg(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Fg(o.map((function(e){return Bv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Fg(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Hv:jv}(r).map((function(e){return Bv(e)}))))}function $v(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,s=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Vv({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Wv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Uv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Yv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,Fg(new Set([n].concat(Fg(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Fg(i.map((function(e){return Uv(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Fg(Wv.map((function(e){return Uv(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Xv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:$v({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:Yv({theme:t,translator:n,id:i,path:r})}}function Kv(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var i=e.split("."),r=c,s=0;s<i.length;s++){var l=i[s];s===i.length-1?r[l]=Xv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}const Gv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Jv=function(){};function Zv(e,t,n,i){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,i)}Jv.extend=function e(t,n){const i=this.prototype;"string"!=typeof t&&(n=t,t="Class");const r=Object.create(this.prototype);for(const e in n)r[e]="function"==typeof n[e]&&"function"==typeof i[e]&&Gv.test(n[e])?function(e,t){return function(){const n=this._super;this._super=i[e];const r=t.apply(this,arguments);return this._super=n,r}}(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=r,o.prototype.constructor=o,o.extend=e,o},Zv.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Zv(this.x,this.y,this.width,this.height)},set(e,t,n,i){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),i>=0?(this.y=t,this.height=i):(this.y=t+i,this.height=-i)},setLTRB(e,t,n,i){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=i?(this.y=t,this.height=i-t):(this.y=i,this.height=t-i)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),i=Math.min(e.x,this.x),r=Math.min(e.y,this.y);return new Zv(i,r,Math.max(0,t-i),Math.max(0,n-r))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Zv(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Zv(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Zv(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,i=t*this.height/2;this.x-=n,this.y-=i,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Qv=new Zv(0,0,0,0),eb=new Zv(0,0,0,0),tb=Jv.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Qv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),eb.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=eb.intersection(Qv,!0),i.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){Qv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),eb.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Qv.intersection(eb,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let nb;function ib(e,t){let n;const i={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(i[n]=e[n]);return t.push(i),i}function rb(e,t,n){let i,r,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),i=0;i<n.length;++i)if(r=n[i],r.qSubNodes.length>0&&(a=rb(e,t,r.qSubNodes)),o=null,(0===r.qSubNodes.length&&nb>=e&&nb<=e+t||a.length>0)&&(o=ib(r,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+i),o.qSubNodes=a),0===r.qSubNodes.length&&nb++,nb===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-i));break}return s}function ob(e,t,n){return nb=0,rb(e,t,n)}const sb=new Zv(0,0,0,0),ab=new Zv(0,0,0,0),lb=tb.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,sb.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ab.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=ab.intersection(sb,!0),i.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){sb.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ab.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=sb.intersection(ab,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qLeft:ob(i,n.height,t.qLeft),qTop:ob(r,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function cb(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new lb;else{if("table"!==e.visualization)return;this.slicer=new tb}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class ub{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,cb.call(this,e)}getData(e){!function(e,t,n,i){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[i]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[i]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Ev(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const hb={version:"0.40.4",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function db(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function fb(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function pb(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let i;return i=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(i)},added(e,t){db(t),fb(t)},moved(e,t){db(t),fb(t)},removed(e,t){db(t),fb(t)}},i={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:i}}var mb={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.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(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.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(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){n.r(t);var i=n(0),r=n.n(i),o=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],s=e;for(i=0;i<r.length-1;++i)void 0===s[r[i]]&&(s[r[i]]=Number.isNaN(+r[i+1])?{}:[]),s=s[r[i]];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 i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a="".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,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=i.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).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 m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,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 v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=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(i&&1===i.length){var c=y(u(i[0],r),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(s,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(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:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(s,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+a.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=r&&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 q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var S=r.a.bind(null,!0),M={},D=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function C(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){A(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!A(e[i],t[i]))return!1;return!0}return e===t}M.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?S({},{val:e}).val:e}(t[r]),s=e[r],a="".concat(n,"/").concat(r);A(o,s)||k(t,r)||(C(s)?i.push({op:"add",path:a,value:o}):_(o)&&_(s)?i=i.concat(M.generate(s,o,a)):D(o)&&D(s)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(A(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var a=r.length-1;a>=0;a-=1)-1===(o=s(t,r[a].qInfo&&r[a].qInfo.qId,a))?(i.push({op:"remove",path:"".concat(n,"/").concat(a)}),r.splice(a,1)):i=i.concat(M.generate(r[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!k(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},M.apply=function(e,t){t.forEach((function(t){var n,i=E(e,t.path),r=t.path.split("/").splice(-1)[0],o=r&&Number.isNaN(+r)?i[r]:i[+r]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,o=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===r&&(r=i.length),i.splice(+r,"add"===t.op?0:1,t.value);else if(D(o)&&D(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(_(o)&&_(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),S(o,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[r]=t.value}else if("move"===t.op){var c=E(e,t.from);D(i)?i.splice(+r,0,c.splice(+s,1)[0]):(i[r]=c[s],delete c[s])}else"remove"===t.op&&(D(i)?i.splice(+r,1):delete i[r])}))},M.clone=function(e){return S({},e)},M.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},M.updateObject=function(e,t){Object.keys(e).length?M.apply(e,M.generate(e,t)):S(e,t)};var T=M,I=function(e,t,n){if(!e)return Promise.resolve();var i=T.generate(t,n);return r()(!0,t,n),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===R)return n[i]}function N(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===R)return i;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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:i,layout:r})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}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(N(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(N(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(N(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(N(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 i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function j(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},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,i=e.modifier,r=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:r,layout:o}));var u=s(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(i,c),p=w.getAboveComp(i,c,d,f);if(i.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:i,properties:r,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=i.showExcludedValues?w.getExcludedComp({modifier:i,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(j(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(j(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(j(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(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===V)return n[i]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===V)return i;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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:i,layout:r})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={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 i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;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,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var i=Q(t,0);t.splice(i,1)}return t}(r,o),function(e,t,n){if(0===e){var i=Q(t,1);t.splice(i,1)}return t}(J(e,i).selectionScope,o)}function te(e,t,n){var i=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var i=Q(t,0);t.splice(i,1)}return t}(J(e,n).dimensionalScope,i)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function ie(e){return 2===e?"{1}":""}function re(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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,s){var a=ie(t),l=re(t,n,i),c=""===a&&""===l?"":a||l,u=oe(r,o),h=se(r,o,s),d=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(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,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:X.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===X.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===X.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:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,i){return ee(n,i,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)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ie,getFieldSelectionComp:re,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 he(e){return(he="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 de={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:me,cleanUpMeasure:ge,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:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:i})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=we(e);ke({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Re({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,i=e.isSnapshot,o=void 0!==i&&i,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"===he(n))return me({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return ke({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=r()(!0,{},e);Se(n);var i=Oe(n);return Ee({model:t}).then((function(r){return Ae({libraryIds:i,model:t}).then((function(i){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ce({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&De(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:r})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,i=Oe(n);return Ne({model:t,libraryIds:i}).then((function(){var e=r()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,i=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?r()(!0,{},i):i),Se(i);var d=Oe(i);return Ne({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,i=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 ge(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ee({model:i,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:i,libraryItemsProps:o}).then((function(i){t.forEach((function(t){ke({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,i=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"===he(e)&&!e.disabled){if(a++,"object"!==he(de[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)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:i,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=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,i.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:i,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=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(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:i,dimensionAndFieldList:e}),Me(t)):ge(t)}))}))}))}({measures:o,properties:i,model:t,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:i,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Me(e)}function ye(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return ke({modifiers:we(e),properties:n,layout:i})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(de[i.type]&&!i.disabled)return i}}function be(e){var t=ve(e);return!t||de[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 qe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Se(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=r()(!0,{},t.base)))}(e)}))}function Me(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function De(e){return e.base||e.qDef&&e.qDef.base}function _e(e){var t=De(e);return e.qLibraryId||t&&t.qLibraryId}function Ce(e){var t=e.measure,n=e.properties,i=e.layout;return!_e(t)&&ke({modifiers:we(t),properties:n,layout:i})}function ke(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===r[e.type]&&(r[e.type]=de[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var s=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(s),Promise.all(i).then((function(){return r}))}function Ae(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return r.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 Ie(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=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 r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&s(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):I(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Re(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Oe(e){var t=xe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=we(t);if(ke({modifiers:i,properties:e})){var o=_e(t);o&&n.push(o),r=r||Re({modifiers:i,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function Ne(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,i={},r={},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(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(i).forEach((function(e){r[e]||o[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!i[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({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 i(e){var t=function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?i(n)+t:t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(""!==s){if(void 0===r[s]||null===r[s])return n;r=r[s]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return i(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,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,s(i.qDimensions));var a,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=r.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var s,a=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=r.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},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 m(e,t,n){var i,r,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((r=(r=(i=JSON.stringify(s)).match(/:\{/g))?r.length:0)>2)return;s=JSON.parse(i)}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 g=n(0),y=n.n(g);function v(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 b(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 q(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(e){return function(e){if(Array.isArray(e))return D(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 D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(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 D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _={importCommonProperties:function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},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,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},s=i.measures||{max:0},a=x(s.max,r.dimensions.length,w),l=x(s.min,r.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,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=y()(!0,{},n,r)).components&&(r.components=[]),r},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>r&&r>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>i||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!r&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=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>i)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>r&&r>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&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,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=q(r.qDimensions);r.qDimensions=[],s.forEach((function(e){r.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=M(r.qMeasures);r.qMeasures=[],s.forEach((function(e){r.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 C(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 k={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:r,qHyperCubeDef:l}),p.addMeasures({exportFormat:r,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:r,properties:s}),n&&(r.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:r,properties:s}),i||p.storeMeasuresModifiers(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(m(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(m(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(m(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,s=void 0===r?{}:r,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=_.createNewProperties({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,D=void 0===M?_.getDefaultDimension():M,k=l.defaultMeasure,E=void 0===k?_.getDefaultMeasure():k;v.qDimensions.length=0,v.qMeasures.length=0,_.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S})&&_.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S,newHyperCubeDef:v}),_.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:D}),_.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:S,newHyperCubeDef:v,defaultMeasure:E}),_.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),_.copyPropertyIfExist("qMaxStackedCells",y,v),_.copyPropertyIfExist("qNoOfLeftDims",y,v),_.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),_.copyPropertyOrSetDefault("qMode",y,v,"S"),_.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),_.copyPropertyOrSetDefault("qSortbyYValue",y,v),_.copyPropertyOrSetDefault("qIndentMode",y,v),_.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),_.importCommonProperties(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return _.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&C(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&C(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var s=e.splice(r,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(A(s,t,i,r),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}}},N={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:N,"sn-scatter-plot":N,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 i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function F(e,t){var n=I.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 z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,s=e.measures,a=e.label;F(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;r||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,i){var r,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":(r=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=r,a.id=r,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i))&&(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,i){var r=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),r){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)}i||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),s=Number(r[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===i&&"point"===a}(n,e,t)?0:n.length-1],r=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return V(e,H("dimension",!!s,s||i)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=H("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,V(e,r)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=H("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,V(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],s=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||i[0])),!!a}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,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 i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var i=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?F(r,a):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions;return!t&&"byDimension"===n&&i.length>0}({auto:i,colorMode:n,dimensions:r})?W(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==a&&!r.length)}({auto:i,colorMode:n,dimensions:r,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),F(i,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,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.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}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=k.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=I.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(s,[],"qAttributeDimensions",c),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=k.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?C(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):C(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,s=r.qHyperCubeDef,a=r.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:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),K.includes(i)&&t[r].type[i]++,t[r].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,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),a=s.properties;return o?(m(a,"measureAxis.min","supportedAutoMinMax"),m(a,"measureAxis.max","supportedAutoMinMax")):(m(a,"measureAxis.min","unsupportedAutoMinMax"),m(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),G.setInterColumnSortOrder(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.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,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,s);if(void 0!==a){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=Z(n,i,l);o.setValue(t,c,a),o.setValue(r,s,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,"qDef.cId");if(a){var l=Z(n,i,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,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:k,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:C,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(mb);var gb=n(mb.exports);const yb=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function vb(e,t,n){for(let i=0;i<n.length;++i){const r=n[i];void 0!==e[r]&&(t[r]=e[r],delete e[r])}}var bb={importColors:function(e){e.color.point=e.color.point||{},vb(e.color,e.color.point,yb),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){vb(e.color.point,e.color,yb),e.color.colorExpression=Ev(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function xb({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:i}){const r=gb.axisChart.importProperties({exportFormat:n,initialProperties:i,dataDefinition:e,defaultPropertyValues:t}),o=r.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),bb.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,r}function wb({propertyTree:e,viewDataMode:t}){const n=gb.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return bb.exportColors(e.qProperty),n}var qb=e=>{const t=pb(e);return{properties:hb,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>xb({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:wb}},Sb=Object.prototype.hasOwnProperty,Mb=Object.prototype.toString,Db=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,Cb=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Mb.call(e)},kb=function(e){if(!e||"[object Object]"!==Mb.call(e))return!1;var t,n=Sb.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Sb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Sb.call(e,t)},Eb=function(e,t){Db&&"__proto__"===t.name?Db(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(!Sb.call(e,t))return;if(_b)return _b(e,t).value}return e[t]},Tb=function e(){var t,n,i,r,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)i=Ab(a,n),a!==(r=Ab(t,n))&&(u&&r&&(kb(r)||(o=Cb(r)))?(o?(o=!1,s=i&&Cb(i)?i:[]):s=i&&kb(i)?i:{},Eb(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Eb(a,{name:n,newValue:r}));return a},Ib=n(Tb);const Rb={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Ob={replaceExpressionTokens:function(e,t,n){const i={start:n&&n.start||"{{",end:n&&n.end||"}}"};let r,o,s=e;for(const e in t)r=t[e],o=i.start+e+i.end,s=s.replace(Nb(o,!0),r);return s},createRegExp:Nb};function Nb(e,t,n){const i=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const r=n?`(${i})`:i;return t?new RegExp(r,"g"):new RegExp(r)}const Pb={generateExpression:function(e,t){const n={};if(t)for(const e in t){const i=t[e],r=i.wrap?Rb.wrapExpression(i.value):i.value;n[e]=r;(i.variations||[]).forEach((t=>{const i=Lb(t,r,e);n[t]=i}))}return Ob.replaceExpressionTokens(e,n)}};function Lb(e,t,n){if(""===t)return"";const i=Ob.createRegExp(n,!0,!0),r=e.split(i);let o="";return r.forEach((e=>{o+=e!==n?e:t})),o}const Fb={generateHyperCubeDef:function(e,t,n,i,r){return function(e,t,n,i){const r={};let o,s;const a=[];let l;e.forEach((e=>{o=Vb(e.match(Bb("Dim"))),o.forEach((e=>{a.push(zb(t.qDimensions[e],i,e,n).then((t=>{r[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=Vb(e.match(Bb("Mea"))),s.forEach((e=>{a.push(jb(t.qMeasures[e],i).then((t=>{r[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(r))):Promise.resolve(r);return l}(e.dimensions.concat(e.measures),t,n,i).then((n=>{const i=Ib({},n,r),o=Ib(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Pb.generateExpression(e,i)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Pb.generateExpression(e,i)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const i=e.qDimensions.map(((e,i)=>zb(e,n,i,t))),r=e.qMeasures.map((e=>jb(e,n)));return{dimensions:await Promise.all(i),measures:await Promise.all(r)}}};function zb(e,t,n,i){if(e.qLibraryId)return Hb(e.qLibraryId,"dimension",t,n,i);const r=i.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[r])}function jb(e,t){return e.qLibraryId?Hb(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Hb(e,t,n,i,r){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[r.qDimensionInfo[i].qGroupPos]:e.qMeasure.qDef))))}function Bb(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Vb(e){return e?e.map((e=>e.substr(6,1))):[]}function $b(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const i=e();switch(t){case"descending":n("integer",i?1:-1);break;case"ascending":n("integer",i?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Wb={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,i){if(n){let n=e()?-1:1;n*=t,i("integer",n)}else i("integer",0)}}},enumConvertFunctions:$b,invertedEnumConvertFunctions:function(e){return $b((function(){return!e||!e()}))}};const Ub=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Yb(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Ub,convertFunctions:n.sorting,show:t=>0!==Ev(t,e,0)}}}}var Xb={state:function(e,t){return Yb(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Yb(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.enumConvertFunctions(t)})},numeric:function(e,t){return Yb(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Wb.booleanConvertFunctions(t,-1),sorting:Wb.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Wb.booleanConvertFunctions(t),sorting:Wb.enumConvertFunctions(t)},i=Yb(e,"properties.sorting.sortByExpression",n);return i.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Ev(t,e,0)},i},frequency:function(e,t){return Yb(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Wb.booleanConvertFunctions(t),sorting:Wb.invertedEnumConvertFunctions(t)})}};const Kb=(e,t,n)=>{const i={getOptions:(i,r)=>{const o=(e,t)=>({ref:`${r}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${r}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:i,items:{fontFamily:{ref:`${r}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${r}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${r}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${r}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${r}.fontSize`),defaultValue:()=>e.getDefaultValue(`${r}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return i},Gb=(e,t,n,i,r)=>i({theme:e,translator:t,flags:r,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Jb=(e,t)=>(t.components||[]).find((t=>t.key===e)),Zb=(e,t,n,i)=>{var r,o,s,a;const l=i.isEnabled("CLIENT_IM_3364")?null===(r=Jb("axis",n))||void 0===r?void 0:r.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")}}},Qb=(e,t,n,i)=>{var r,o,s,a;const l=i.isEnabled("CLIENT_IM_3364")?null===(r=Jb("axis",n))||void 0===r?void 0:r.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")}}},ex=(e,t,n,i)=>{var r,o,s,a;const l=i.isEnabled("CLIENT_IM_3051")?null===(r=Jb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==l||null===(o=l.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==l||null===(s=l.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==l||null===(a=l.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"legend.title","color")}},tx=(e,t,n,i)=>{var r,o,s,a;const l=i.isEnabled("CLIENT_IM_3051")?null===(r=Jb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==l||null===(o=l.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==l||null===(s=l.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==l||null===(a=l.label)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"legend.label","color")}},nx={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function ix(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(nx);const rx={hasMultipleDimensions:ix,getOuterDimensionCardinality:function(e){const t=Ev(e,nx.HYPERCUBE_PATH);return ix(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Ev(e,nx.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Ev(e,`${nx.SORT_CRITERIA}.sortByAscii`,0)}},ox={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var sx={create(e,t){if(!e||!ox[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let i=-1;return e&&(n=n||"id",e.forEach(((e,r)=>{e[n]===t&&(i=r)}))),i},moveById(e,t,n,i){const r=this.getIndexById(e,n,i);t=t||[];const o=this.getIndexById(t,n,i);if(-1!==r&&-1===o){const n=e.splice(r,1);t.push(n[0])}return t},moveAllById(e,t,n,i){const r=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),s=r.filter((e=>!(o.filter((t=>t[i]===e[i])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,i,r),a!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),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"}};var ax={getColorByDefinition:function(e,t,n){const i={};let r,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(i.type="dimension",i.name=n.qLibraryId,i.id=n.qLibraryId):(i.type="field",t?(i.name=n.label||n.qDef,i.id=n.qDef):(r=n.qDef,o=!!r.qLabelExpression,s=r.qFieldLabels&&r.qFieldLabels[0],i.name=r.qFieldDefs[0],i.label=o?r.qLabelExpression:s?r.qFieldLabels[0]:r.qFieldDefs[0])),i}};var lx={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const cx=["scatterplot","map"],ux=["map"];var hx={baseColor:{isSupported:e=>e&&e.length&&-1===cx.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==ux.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,i){this.updateColorDef(e,i,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]);let a,l,c,u;if(!r&&"byDimension"===i&&o.length)a=Ev(n,"byDimDef"),a&&yx(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=ax.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,mx(n,u)):a&&a.key||(l=o[o.length-1],c=sx.getById(l.qAttributeDimensions,sx.IDMAP.COLOR_BY_ALTERNATIVE),mx(n,ax.getColorByDefinition("dimension",!!c,c||l)));else{if(!r&&"byMeasure"===i&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===i&&s.length<2&&Iv(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]),a=Ev(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!r&&"byDimension"===i&&o.length?gx(n,!0,o,a,s,Ev(n,"byDimDef.label")):!r&&"byMeasure"===i&&o.length?gx(n,!1,o,a,s,Ev(n,"byMeasureDef.label")):dx(o,a)},setColorByPropertyDef:mx,resolveColorByPropertyDef:gx,clearColorByItem:dx};function dx(e,t){e.forEach((e=>{fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),fx(e,sx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function fx(e,t,n){if(e[n]){const i=sx.getIndexById(e[n],t);i>=0&&e[n].splice(i,1)}else e[n]=[]}function px(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function mx(e,t,n,i){const r=n?"expression":t.type;let o=e.mode;switch(yx(e,t.label||t.name||""),r){case"field":o="byDimension",e.byDimDef={label:t.label||px(t.name),key:px(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&lx.useMasterNumberFormat(e.formatting)}i||(e.auto=!1,e.mode=o)}function gx(e,t,n,i,r,o){dx(n,i);const s=n[n.length-1];if(s){const n=Ev(e,t?"byDimDef":"byMeasureDef"),i=Ev(e,"formatting.qNumFormat"),a=Ev(e,"formatting.isCustomFormatted");if(n){const e=sx.create(sx.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,i&&(e.qNumFormat=i,e.isCustomFormatted=a)),e.label&&"="===e.label.charAt(0)&&(e.labelExpRef="color.altLabel");break;case"libraryItem":if(!t){let t=-1;r.forEach(((e,i)=>{n.key===e.qLibraryId&&(t=i)})),e.matchMeasure=t,i&&(e.qNumFormat=i,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function yx(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function vx(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function bx(e){return"libraryItem"===Ev(e,"color.point.byDimDef.type")}function xx(e){return"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}function wx(e){return!0===Ev(e,"color.point.auto")}function qx(e){return!wx(e)&&"byDimension"===Ev(e,"color.point.mode")}function Sx(e){return!wx(e)&&"byMeasure"===Ev(e,"color.point.mode")}var Mx={measuresHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!vx(e))).length>0},dimensionsHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!vx(e))).length>0},onGlobalChangeColors:function(e){hx.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&i&&(i.qCalcCond=n.qCalcCond,i.qCalcCondition=n.qCalcCondition)},isColorByDimension:qx,isColorByMeasure:Sx,isColorAuto:wx,isColorByExpression:function(e){return!wx(e)&&"byExpression"===Ev(e,"color.point.mode")},isColorBySingle:function(e){return!wx(e)&&"primary"===Ev(e,"color.point.mode","primary")},isDimensionLibraryItem:bx,isMeasureLibraryItem:xx,showLegend:function(e){const t=Ev(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===wx(e)},showColorByLabel:function(e){const t=qx(e)&&!1===bx(e),n=Sx(e)&&!1===xx(e),i=Ev(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!i||n},hasDimValueColors:function(e,t){var n,i;return null===(n=null===(i=e.layout.qHyperCube.qDimensionInfo[t])||void 0===i||null===(i=i.coloring)||void 0===i?void 0:i.hasValueColors)||void 0===n||n}};function Dx(e,t){this.getSettings=e,this.getElements=t}function _x(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],i=this.getSettings();Iv(n,"qSortByExpression",i.SORT_BY_EXPRESSION),Iv(n,"qSortByAscii",i.SORT_BY_ASCII),Iv(n,"qSortByNumeric",i.SORT_BY_NUMERIC),Iv(n,"qSortByLoadOrder",i.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const r=Cx(this.getElements());n.qExpression.qv=r.exp}function Cx(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Dx.prototype.applyAutoSorting=_x,Dx.prototype.applyDefaultCustomSorting=function(e,t){_x.call(this,e);const n=Cx(this.getElements()),i=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Iv(t.sortCriteria,"sortByExpression",i.qSortByExpression),Iv(t.sortCriteria,"sortByAscii",i.qSortByAscii),Iv(t.sortCriteria,"sortByNumeric",i.qSortByNumeric),Iv(t.sortCriteria,"sortByLoadOrder",i.qSortByLoadOrder)},Dx.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Iv(n,"qSortByExpression",t.sortCriteria.sortByExpression),Iv(n,"qSortByAscii",t.sortCriteria.sortByAscii),Iv(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Iv(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const kx={create:function(e,t){return new Dx(e,t)}};const Ex={applySorting:function(e,t,n){const i=n.autoSort,r=!!n.sortCriteria;i?e.applyAutoSorting(t):r?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Ax={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Ax.ASCII),Object.freeze(Ax);const Tx=Ib(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Ax);const Ix={getSettings:function(e){return Ev(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Tx.DIST_MAX:Tx.ASCII}};function Rx(e,t,n,i){let r="Fractile";0===e?r="Min":1===e&&(r="Max");const o=t?Rb.wrapExpression(t):"",s=n?Rb.wrapExpression(n):"";return`${r}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(i||"").replace(/^=/,""))}const Ox={getElementIds:function(){return[nx.SORTING_ELEMENT_MIN_ID,nx.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,i){const r=t[0],o=t[1],s=e[0],a=Rx(0,r,o,s),l=Rx(1,r,o,s);return[{id:nx.SORTING_ELEMENT_MIN_ID,label:i.get("properties.distributionPlot.min"),exp:a,isDefault:nx.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:nx.SORTING_ELEMENT_MAX_ID,label:i.get("properties.distributionPlot.max"),exp:l,isDefault:nx.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Rx};function Nx(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Px(e,t,n,i){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const r=e.qUndoExclude.qHyperCubeDef.qDimensions;r.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Ix.getSettings(t)},s=kx.create(o,(function(){const e=o();return Ox.getElements(n.measures,n.dimensions,e,i)})),a=r[0],l=e.sorting;Ex.applySorting(s,a,l)}const Lx={applySorting:function(e,t,n,i,r){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Nx("'qHyperCubeDef.qDimensions' has no outer dimension"):Nx("no 'qHyperCubeDef.qMeasures' in properties arg"):Nx("no 'qHyperCubeDef.qDimensions' in properties arg"):Nx("no 'qHyperCubeDef' in properties arg")}(e),i?Px(e,t,i,r):Fb.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Px(e,t,n,r)}))}},Fx=`${nx.SORT_CRITERIA}.sortByExpression`;const zx={updateSortOrder:function(e,t){if(!t)return;const n=Ev(e,Fx);if(!(-1===n||1===n))return;const i=Ev(e,nx.SORTING_ELEMENT_ID),r=Ev(t,nx.SORTING_ELEMENT_ID),o=!!r,s=i===nx.SORTING_ELEMENT_MIN_ID,a=i===nx.SORTING_ELEMENT_MAX_ID,l=r===nx.SORTING_ELEMENT_MIN_ID,c=r===nx.SORTING_ELEMENT_MAX_ID,u=s&&c,h=a&&(!o||l),d=Ev(t,Fx),f=a&&!(-1===d||1===d)&&1===n;u?Iv(e,Fx,1):(h||f)&&Iv(e,Fx,-1)}},jx=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Hx=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:jx(n,t)});function Bx(e){return!Ev(e,"color.point.auto")&&"byDimension"===Ev(e,"color.point.mode")&&Ev(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Vx(e){const{flags:t,translator:n}=e,i=e.anything.sense.theme,r=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:i.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!Ev(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!Ev(e,"color.point.auto",!0)&&"primary"===Ev(e,"color.point.mode","primary"),defaultValue(){const e=i.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!Ev(e,"color.point.auto")&&"byExpression"===Ev(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=Gb(i,n,nx.CHART_ID,Kv,t),u=Kb(c,i,nx.CHART_ID),h={type:"items",translation:"properties.presentation",items:{styleEditor:r&&Hx(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},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}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:nx.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,i){const{autoMinMax:r,minMax:o,min:s}=(null==i?void 0:i.measureAxis)||{};return!0===r?"lowest":r||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,i,r){"zero"===e?(Iv(r,"measureAxis.autoMinMax",!1),Iv(r,"measureAxis.minMax","min"),Iv(r,"measureAxis.min",0)):Iv(r,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Ev(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>Ev(t.layout,`${nx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=Ev(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,i,r;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",i=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(l=l.qHyperCube)||void 0===l?void 0:l.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<i.length;e++){const t=i[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(i=null===(r=e.color.point.byDimDef)||void 0===r?void 0:r.label)&&void 0!==i?i:""},g=(e,t,i)=>{var r;if(null!==(r=e.qHyperCubeDef)&&void 0!==r&&null!==(r=r.qDimensions)&&void 0!==r&&r.length){var o,s,a;const t=null===(o=e.qHyperCubeDef)||void 0===o?void 0:o.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(s=null===(a=e.color)||void 0===a||null===(a=a.point)||void 0===a||null===(a=a.byDimDef)||void 0===a?void 0:a.activeDimensionIndex)&&void 0!==s?s:-1)<0&&t.push({value:-1,label:m(e,i)}),t}return[]},y=(e,t)=>{const n="measure"===Ev(e,"color.point.useBaseColors")&&Mx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Mx.dimensionsHasBaseColors(t);return Mx.isColorBySingle(e)&&!n&&!i},v=(e,t)=>!Ev(e,"color.point.auto",void 0)&&"primary"===Ev(e,"color.point.mode",void 0)&&!y(e,t),b={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&v(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!v(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>Ev(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Ev(e,"color.point.auto")||(Iv(e,"color.point.mode","primary"),Iv(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===Ev(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Mx.isColorAuto(e),change(e){if("primary"===Ev(e,"color.point.mode",void 0)){const t=Ev(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Iv(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Mx.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const i=Ev(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Mx.isColorAuto(e)&&"primary"===i&&(Mx.measuresHasBaseColors(n)||Mx.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,i){var r,o;const s=null!==(r=null===(o=e.color.point)||void 0===o||null===(o=o.byDimDef)||void 0===o?void 0:o.activeDimensionIndex)&&void 0!==r?r:null,a=Mx.hasDimValueColors(i.handler,s);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&a&&Mx.isColorByDimension(e)&&Mx.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Mx.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),Ev(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Mx.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Mx.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Mx.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Mx.showColorByLabel,change(e){const t=Ev(e,"color.point.mode"),n=Ev(e,"color.point.altLabel","");let i;switch(t){case"byMeasure":i=e.color.point.byMeasureDef;break;case"byDimension":i=e.color.point.byDimDef}i&&(i.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=Ev(e,"color.point.mode","primary");return!Mx.isColorAuto(e)&&"primary"===n&&(Mx.measuresHasBaseColors(t)||Mx.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Ev(e,"color.point.auto")&&"byMultiple"===Ev(e,"color.point.mode")&&"measure"===Ev(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Mx.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Ev(e,"color.point.useBaseColors")&&Mx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Mx.dimensionsHasBaseColors(t);return Mx.isColorBySingle(e)&&!n&&!i}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Mx.isColorByDimension(e)&&Mx.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=Ev(e,"color.point.auto"),n=Ev(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Ev(e,"color.point.auto")||"byDimension"!==Ev(e,"color.point.mode")||"libraryItem"!==Ev(e,"color.point.byDimDef.type")?Bx(e):Bx(e)&&!Ev(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Mx.isColorAuto(e)&&Mx.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Mx.isColorAuto(e)&&Mx.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Mx.isColorByDimension(e)&&(!Mx.isDimensionLibraryItem(e)||!Ev(e,"color.point.useDimColVal"))},customRange:{show:e=>!Mx.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Mx.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Mx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Mx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Mx.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(nx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Mx.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Mx.showLegend(e)&&Ev(e,"legend.show",!0)},showTitle:{show:e=>Mx.showLegend(e)&&Ev(e,"legend.show",!0)}}}}},w={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,r){r.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:w,general:l,presentation:h,colors:x||a,measureAxis:d,dimensionAxis:f}},S={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Mx.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},M=Xb.expression(`${nx.SORT_CRITERIA}.sortByExpression`),D={type:"items",items:{toggled:M.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:nx.SORTING_EXPRESSION,elementRef:nx.SORTING_ELEMENT_ID,show:rx.isSortByExpression,elements:e=>Fb.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const i=Ix.getSettings(e.layout);return Ox.getElements(t.measures,t.dimensions,i,n)}))},order:M.items.order}},_={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&zx.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:nx.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:rx.hasMultipleDimensions,change(e,t,i,r){if(e&&rx.hasMultipleDimensions(e)&&t.layout)return Lx.applySorting(e,t.layout,r.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:nx.SORTING_EXPRESSION,elementRef:nx.SORTING_ELEMENT_ID,sortCriteriasRef:nx.SORT_CRITERIA,show:e=>rx.hasMultipleDimensions(e)&&!rx.isAutoSort(e),elements:e=>Fb.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const i=Ix.getSettings(e.layout);return Ox.getElements(t.measures,t.dimensions,i,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>rx.hasMultipleDimensions(e)&&!rx.isAutoSort(e),items:{expression:D,numeric:Xb.numeric(`${nx.SORT_CRITERIA}.sortByNumeric`),ascii:Xb.ascii(`${nx.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!rx.isSortByExpression(e)&&!rx.isSortByNumeric(e)&&!rx.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!rx.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:_,addons:S,settings:q}}}const $x={buildDefinition:function(e,t,n,i,r){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Ev(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=Wx(e,o).chart;l||(l="sortByAscii");const c=Ev(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=i(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=r(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=Wx(e,o).dimension;return t?Ev(e,o+t):0}}}};return s}};function Wx(e,t){const n={chart:"",dimension:""};return 0!==Ev(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Ev(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Ev(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Ux={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:$x.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Ix.getSettings,Ox.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Yx={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Mx.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Mx.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Mx.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Mx.showLegend}}}}};function Xx(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Vx(e),softDefinition:Ux,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Mx.onGlobalChangeColors(t)},importProperties:(t,n,i)=>{const r=pb(e);i.mapProperties();return xb({dataDefinition:r,defaultPropertyValues:{defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>wb({propertyTree:e,viewDataMode:n})}}Ib(!0,Ux,Yx);const Kx={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 Gx(){return Kx.id()}const Jx="scrollbar";function Zx(e,t,n){return"y"===e?Qx(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Qx(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var ew={getAxisDock:Zx,getOppositeAxisDock:function(e,t,n){return Zx(e,"far"===t?"near":"far",n)},getYAxisDock:Qx};const tw=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),nw=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),iw=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function rw(e){return tw.test(e)}function ow(e){return nw.test(e)||iw.test(e)}var sw={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],rw(i))return"ltr";if(ow(i))return"rtl"}return"ltr"}};var aw={lineSettings:function(e,t){var n;const i={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 Ib(!0,i,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let i=t.theme.getStyle(n,"referenceLine.label.name","color");const r=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?i=t.theme.getColorPickerColor(t.paletteColor):i||(i="transparent"),Ib(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:i,fontFamily:o,fontSize:r,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} ${sw.lrm}(${n})${sw.lrm}`:`${sw.lrm}(${n})${sw.lrm}`:!1!==e.showLabel?t:""}};const lw={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}}};lw.DEFAULT_CHART_ORIENTATION=lw.HORIZONTAL;const cw=100;function uw(e,t){const n=t||{},i=n.measureAxisProperties||{},r=n.dimensionAxisProperties||{},o=n.orientation||lw.DEFAULT_CHART_ORIENTATION,s=o===lw.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=lw.SHOW_AXIS_LABELS_OPTIONS,u=lw.SHOW_TITLE_OPTIONS,h=c.includes(i.show),d=!!n.measureTitleText&&u.includes(i.show),f=n.includeDimensionAxis&&c.includes(r.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(r.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,i){let r={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:i&&!i.autoMinMax&&i.showBounds};r=Ib(r,lw.LAYOUTSETTINGS.measureAxis);const o=dw(t,n);e.addComponent(`${n}-axis`,r,o)}(e,n,a,i),d&&function(e,t,n){let i={text:t.measureTitleText,style:t.axisTitleStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.measureAxisTitle);const r=function(e,t){return dw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,a),function(e,t,n,i){let r=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:i};i&&i.spacing>0&&(r=Ib(!0,r||{},{component:{ticks:{distance:i.spacing*cw}}}));e.addScale("measure-scale",r,o)}(e,n,o,i),f&&function(e,t,n){let i={scale:"dimension",settings:t.axisLabelStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.dimensionAxis);const r=fw(t,n);Ib(!0,i,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,i,r)}(e,n,l),p&&function(e,t,n){let i={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};i=Ib(i,lw.LAYOUTSETTINGS.dimensionAxisTitle);const r=function(e,t){return fw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const i={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===lw.HORIZONTAL?lw.VERTICAL:lw.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,i)}(e,n,o),m&&function(e,t,n){let i={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};i=Ib(i,lw.LAYOUTSETTINGS.gridLines),i[n]={scale:"measure"},e.addComponent("grid-line",i)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,i){const r=e.getSettings();r.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:!i},s=Ib({},lw.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),hw(t,function(e){function t(t,n){if(!n||!e())return!1;const i={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(i).some((e=>e.settings.key===Jx))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Jx).emit("tap",e)}}},i={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Jx).emit("panStart",e)},pan(e){this.chart.component(Jx).emit("panMove",e)},panend(e){this.chart.component(Jx).emit("panEnd",e)},pancancel(e){this.chart.component(Jx).emit("panCancel",e)}}};return[n,i]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,i){const r=ew.getAxisDock(n,i.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Ib(o,lw.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Gx()}`,require:["renderer","chart"],dock:ew.getOppositeAxisDock(n,i.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,i=this.chart.formatter({data:e.settings.scales.measure.data}),r=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${i(e.value)})`:"",r=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:r,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=r[0];for(let e=1;e<r.length;e++)r[e].wanted>o.wanted&&(o.wanted=r[e].wanted),r[e].required>o.required&&(o.required=r[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Ib(s,lw.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((i=>{if(!i.show)return;const a=i.refLineExpr&&i.refLineExpr.value,l=Ib(!0,{},t,{paletteColor:i.paletteColor,style:i.style,chartID:e.options.chartID}),c=aw.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=aw.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==i.showLabel?i.label:"",showValue:!1!==i.showValue}},l);"x"===n?u.label.vAlign="near"===r?1:0:u.label.align="near"===r?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,i),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",lw.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeDim"};o=Ib(o,lw.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.dimRange||{},s,fw(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMeasure"};o=Ib(o,lw.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.measureRange||{},s,dw(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMinor"};o=Ib(o,lw.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:i,isRtl:r,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,fw(n,l).dock,n.isRtl)}n.brushActions&&hw(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function hw(e,t){t.forEach((t=>{e.push(t)}))}function dw(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function fw(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function pw(e,t){const n=t||{},i=!n.orientation||"horizontal"===n.orientation,r=!!n.isRtl,o={name:n.name||"scale",component:{invert:i&&r,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Ib(!0,{},o,e||{})}function mw(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 gw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=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"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:mw(t.flags),dock:ew.getAxisDock(r,i,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Ib(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function yw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=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:ew.getAxisDock(r,i,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Ib(!0,{},c,e||{})}pw.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const i={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},r=t&&t.measureAxisProperties;r&&!r.autoMinMax&&(["min","minMax"].includes(r.minMax)&&(i.component.min=r.min),["max","minMax"].includes(r.minMax)&&(i.component.max=r.max));const o=pw(Ib(!0,i,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},pw.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 pw(Ib(!0,n,e||{}),t)},gw.xAxis=function(e,t){return gw(Ib(!0,{key:"x-axis",scale:"x"},e||{}),t)},gw.yAxis=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis",scale:"y",dock:ew.getYAxisDock(n,i)};return gw(Ib(!0,r,e||{}),t)},yw.xAxisTitle=function(e,t){return yw(Ib(!0,{key:"x-axis-title"},e||{}),t)},yw.yAxisTitle=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis-title",dock:ew.getYAxisDock(n,i)||"left"};return yw(Ib(!0,r,e||{}),t)};var vw={getBublesAlign:function(e,t,n){let i=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(i=!i),i?"start":"end"},getDock:function(e,t){const n=[];let i;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(i=n.join(",")),i}};const bw={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 xw(){return bw}function ww(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}xw.getLayoutModeKeys=function(){const e=[];let t;for(t in bw)e.push(t);return e};const qw={left:"left",right:"right",up:"top",down:"bottom"};function Sw(e,t,n){switch(e){case"scale":return pw(t,n);case"measure-scale":return pw.measureScale(t,n);case"dimension-scale":return pw.dimensionScale(t,n);case"axis":return gw(t,n);case"box-marker":return function(e){return Ib(!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 Ib(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,i=t&&t.chartID,r=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:r?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(i,"","backgroundColor"),invert:n&&r}};return Ib(!0,{},o,e||{})}(t,n);case"text":return yw(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushComponents?t.brushComponents:[],r=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 i.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:r})})),Ib(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=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:vw.getDock(i,r),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vw.getBublesAlign(s,a,l)}}};return Ib(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=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 h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:vw.getDock(i,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vw.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return r.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Ib(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t&&t.dock||"auto";const o=t&&t.show;"auto"===r&&(r=t.chartHeight/t.chartWidth<1?i?"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"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:mw(t.flags),dock:r,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:i?"rtl":"ltr",size:"top"===r||"bottom"===r?2:1,vertical:"top"===r||"bottom"===r?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-${qw[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,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 Ib(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t.dock||"auto";"auto"===r&&(r=t.chartHeight<t.chartWidth?i?"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 h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:r,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(i?"right":"left"),major:{invert:"left"===r||"right"===r||i},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Ib(!0,{},d,e)}(t,n);case"x-axis":return gw.xAxis(t,n);case"y-axis":return gw.yAxis(t,n);case"x-axis-title":return yw.xAxisTitle(t,n);case"y-axis-title":return yw.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"grid.line.major","color");return Ib(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:i},minorTicks:{stroke:i}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Ib(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),r=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Ib(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:r,text:{fill:i},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Ib(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"label.value","color"),r=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:mw(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(r),align:.5,labels:[{placements:[{position:"outside",fill:i,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:ww}]}}}]}};return Ib(!0,{},s,e||{})}(t,n);default:return}}function Mw(e){this.options=e||{},this.settings={dockLayout:{layoutModes:xw()},components:[],scales:{}}}Mw.prototype.addComponent=function(e,t,n){const i=Sw(e,t,Ib(!0,{},this.options,n||{}));return this.settings.components.push(i),i},Mw.prototype.addInteraction=function(e,t){const n=Sw("interaction",e,Ib(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Mw.prototype.addScale=function(e,t,n){const i=Sw(e,t,Ib(!0,{},this.options,n||{}));this.settings.scales[i.name]=i.component},Mw.prototype.getSettings=function(){return this.settings},Mw.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Mw.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");uw(t,n)}(e,this,t)},Mw.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))},Mw.create=function(e){return new Mw(e)},Mw.createComponent=Sw;const Dw={CENTER:0,BOTTOM:1};var _w={DISCLAIMERS:[{label:"NoDataExist",alignment:Dw.CENTER,default:!0},{label:"RequireNumericDimension",alignment:Dw.CENTER,default:!1},{label:"OnlyNanData",alignment:Dw.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:Dw.CENTER,default:!1},{label:"LimitedData",alignment:Dw.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:Dw.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:Dw.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:Dw.BOTTOM,default:!1}],ALIGNMENT:Dw};const Cw={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,i=!1;var r;return e?void 0!==t.explicitLimitedData?i=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?i=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(r=e.qStackedDataPages)&&r[0]&&r[0].qData[0]&&r[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,i=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):i=!0===t.explicitLimitedData,i},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 i,r,o,s,a;for(e&&(r=!(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,i=0;i<n;i++)if(s=Math.min(s,t[i].qMin),a=Math.max(a,t[i].qMax),s<=0&&a>=0)return!0;return s=r?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},i={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,_w.DISCLAIMERS.forEach((e=>{i[e.label]=!1})),t&&t.qHyperCube?(i.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),i.NoDataExist?i:(i.RequireNumericDimension=n.explicitRequireNumericDimension,i.RequireNumericDimension||(i.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),i.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),i.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),i)):i}};function kw(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Ew(e,t){return e&&t&&t[e]}function Aw(e){this.environment=e,this.clear()}kw.prototype.isValidAndSupported=function(e,t){return Ew(e.label,this.dataAttributes)&&(e.default||Ew(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},kw.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((i=>{n.isValidAndSupported(i,e)&&(t=!0)})),t},kw.prototype.getMessage=function(e,t){let n="";const i=this;return t&&this.disclaimersConfig.forEach((r=>{i.isValidAndSupported(r,e)&&(n+=`${t.get(`Object.Disclaimer.${r.label}`)} `)})),n},Aw.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Aw._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Aw.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=Ib(!0,{},this.vizAttributes.supportedDisclaimers),i=new kw(_w.DISCLAIMERS,this.dataAttributes,n);let r,o;if(i.isAnyValidDisclaimer(_w.ALIGNMENT.CENTER))r=i.getMessage(_w.ALIGNMENT.CENTER,t),o="center";else{if(!i.isAnyValidDisclaimer(_w.ALIGNMENT.BOTTOM))return;r=i.getMessage(_w.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:r,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},Aw.prototype.set=function(e){if(this.clear(),!e)throw new Error(Aw.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Cw.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Aw.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Tw=Jv.extend({init(e,t,n,i,r){this.$element=t,this.environment=n,this.backendApi=i,this._selectionsApi=r,this._on=!1,this._disclaimer=new Aw(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:[Mw.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 i,r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,i=Math.floor(1e4/e);r={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,i):i}}else r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};i="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([r],null,t).then((e=>{t[i]=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),i=this.createChartSettings(this.layout);n?i.components=[t]:t&&i.components.push(t),Mw.validateComponentKeys(i.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,i),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=Ib(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var i,r;const o=null!==(i=null===(r=this.environment.appLayout)||void 0===r?void 0:r.qLocaleInfo)&&void 0!==i?i:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Ev(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})});function Iw(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}const Rw={generateHash:function(e){return Iw(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Rw.generateHash(t)}};const Ow={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:Pw(t),dimensionExpressions:Nw(t),measureExpressions:e})))}};function Nw(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Pw(e){const t=function(e){return Ev(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Lw={},Fw=Ib.bind(null,!0);function zw(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const jw=Array.isArray,Hw=function(e){return void 0===e},Bw=function(e){return"function"==typeof e};function Vw(e,t){return Bw(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function $w(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach(((t,r)=>{r!==n.length&&(i=+t,e[i||t]=Hw(e[i||t])?Number.isNaN(+i)?{}:[]:e[t],e=e[i||t])})),e}function Ww(e,t){if(zw(e)&&zw(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Ww(e[n],t[n]))return!1;return!0}if(jw(e)&&jw(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!Ww(e[n],t[n]))return!1;return!0}return e===t}Lw.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach((r=>{const o=function(e){return e&&(e=Fw({},{val:e}).val),e}(t[r]),s=e[r],a=`${n}/${r}`;Ww(o,s)||Vw(t,r)||(Hw(s)?i.push({op:"add",path:a,value:o}):zw(o)&&zw(s)?i=i.concat(Lw.generate(s,o,a)):jw(o)&&jw(s)?i=i.concat(function(e,t,n){let i=[];const r=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Hw(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Ww(t,r))return i;if(null===t[0]||!Hw(t[0])&&Hw(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(o=r.length-1;o>=0;--o)a=l(t,r[o]&&r[o].qInfo&&r[o].qInfo.qId,o),-1===a?(i.push({op:"remove",path:`${n}/${o}`}),r.splice(o,1)):i=i.concat(Lw.generate(r[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(r,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(i.push({op:"add",path:`${n}/${o}`,value:t[o]}),r.splice(o,0,t[o])):a!==o&&(i.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),r.splice(o,0,r.splice(a,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:`${n}/${r}`,value:o}))})),Object.keys(e).forEach((r=>{Hw(t[r])&&!Vw(e,r)&&i.push({op:"remove",path:`${n}/${r}`})})),i},Lw.apply=function(e,t){t.forEach((t=>{const n=$w(e,t.path);let i=t.path.split("/").splice(-1)[0];const r=i&&Number.isNaN(+i)?n[i]:n[+i]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(jw(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(jw(r)&&jw(t.value)){const e=t.value.slice();r.length=0,r.push.apply(r,e)}else zw(r)&&zw(t.value)?(s=r,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Vw(s,e)&&delete s[e]})),Fw(r,t.value)):n[i]=t.value;else if("move"===t.op){const r=$w(e,t.from);jw(n)?n.splice(+i,0,r.splice(+o,1)[0]):(n[i]=r[o],delete r[o])}else"remove"===t.op&&(jw(n)?n.splice(+i,1):delete n[i]);var s}))},Lw.clone=function(e){return Fw({},e)},Lw.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},Lw.updateObject=function(e,t){Object.keys(e).length?Lw.apply(e,Lw.generate(e,t)):Fw(e,t)};class Uw{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Lw.generate(e,t);return Ib(!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,i=await t;if(n.qExtendsId)return;const r=Lw.generate(n,i);Lw.apply(n,r);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Yw={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 Xw={saveDerivedProperties:function(e,t,n,i){if(Yw.canModifyHardProperties(t))return e.setProperties(n);return new Uw(e).saveSoftProperties(i,n)}};var Kw={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Gw(){this._generationInProgress=!1}function Jw(e){Kw.validate(e);const t=e.properties,n=Rw.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Gw.prototype.isDerivedUpToDate=Jw,Gw.prototype.updateDerivedProperties=function(e){if(Kw.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Jw(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,i=e.layout,r=Ib(!0,{},e.properties),o=Ib(!0,{},r);return this._generationInProgress=!0,Rw.updateHash(r,e.hashData),e.generateDerivedProperties(i,r).then((()=>Xw.saveDerivedProperties(n,i,r,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Gw.prototype.addDefaultHyperCubeHash=function(e,t,n,i){return Ow.getDefaultHashDataForHyperCube(e,t,n).then((e=>Ib(!0,i,e)))};var Zw={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(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 r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=r(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)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||s.call(e,t)},d=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,i,r,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)i=f(a,n),a!==(r=f(t,n))&&(p&&r&&(h(r)||(o=u(r)))?(o?(o=!1,s=i&&u(i)?i:[]):s=i&&h(i)?i:{},d(a,{name:n,newValue:e(p,s,r)})):void 0!==r&&d(a,{name:n,newValue:r}));return a};function m(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.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 g(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function y(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=m(r.field,s,{cache:t},d);if(-1===e)return;f=p({qRow:a},e(l))}u[h]=g(r,f,{key:c})}function v(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),S=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(S[h[e]]=[]);for(let o=0;o<r.length;o++)y({cache:n,f:l,mainCell:q,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:i.fields?S[h[e]]:S,targetProp:i.fields?o:h[e],columnOrder:s.qColumnOrder});if(i.fields){const t=S[h[e]].map((e=>e.value)),n=S[h[e]].map((e=>e.label));S[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(S[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:q,obj:S,target:b,tracker:v,trackType:f}),x.push(S)}}}const w=d?i.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function q(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this}function S(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function M(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function D(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))}function _(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function C(e){for(var t=this,n=k(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function k(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function E(){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 I(){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,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,i,r,o,s,a=new j(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new j(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(z)}function N(){return O(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(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}j.prototype=O.prototype={constructor:j,count:x,each:w,eachAfter:S,eachBefore:q,find:M,sum:D,sort:_,path:C,ancestors:E,descendants:A,leaves:T,links:I,copy:N,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function X(){var e,t=U,n=Y;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>K(e(t,n,i)))),n=t.map(G),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new j(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.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],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(z),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=H(e),i):t},i.parentId=function(e){return arguments.length?(n=H(e),i):n},i.path=function(t){return arguments.length?(e=H(t),i):e},i}function K(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 i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Z(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Z(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Q(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Q(e[r].children,t-1,n)]);return i}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 i=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,i-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,ie=/^\/?qMeasureInfo\/(\d+)/,re=/\/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 i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(r=!0,o=+ne.exec(h)[1],h=i.replace(ne,"")),ie.test(h)&&("K"===n.qMode?c=+ie.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ie.exec(h)[1],u=0):u=+ie.exec(h)[1],h=h.replace(ie,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:re.exec(h)&&(s=+re.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,i,r=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ue(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function he(e){let{propsArr:t,props:n,item:i,itemData:r,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 h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const de=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Z(i,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[r])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],i=se(e),r=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const i=t[e];let r="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=i[o[e]],s="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:r,qValues:[]},t),c=!0),r=s}if(c)for(let e=0;e<s.length;e++){const t=i[s[e]];a[r].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=X().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:i,cache:r,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:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,i,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=i.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=i.fields[e]}const{props:l,main:u}=r.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:i}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:i,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,i=c[h[e].depth].main,r=u[e],o=r.data,a=ue(i,o,{key:s});he({propsArr:t,props:n,item:r,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function ge(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const S=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...S]}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 ve=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,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",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(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}))}));const be=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"},qe=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,De=/^\(dec\)/i,_e=/^\(hex\)/i,Ce=/^\(bin\)/i,ke=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function Ie(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/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(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}function Re(e,t,n){let i;return Se.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=Te(e,8,t,n):De.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):Ce.test(t)?e=Te(e,2,t,n):ke.test(t)&&(i="",e<0&&(i="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?i+(e=Ie(e,t)):t+i+e.toExponential(0)),e}function Oe(e,t,n){const i=xe(e);return n?i:new RegExp(i||"",t)}function Ne(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,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;i&&(e.abbreviate=!0),d=Ne(t,n),s=f.match(d),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&&(r=s.split(n),o=r.pop(),s=r.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)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.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=h}class Fe{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Fe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Ee.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Ee.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Le(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Le(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Le(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,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 i,r,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&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fe(...t)}function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(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,i,r){const o=ze(r,e,t,n,i),s=je(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},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 Xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ke(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}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),i=60*Ge(n),r=60*Ge(i),o=1e3*Ge(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}function Ze(e,t){let n,i=Je(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/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:r,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:Xe("".concat(t.year).slice(-2),2),YYY:Xe("".concat(t.year).slice(-3),3),def:e=>Xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:i.qTimeFmt||"hh:mm:ss",[Be.DATE]:i.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:i.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 i;e instanceof Date?i=Ke(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Ze(e,t));const r=Qe(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return 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 it(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function rt(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),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Be.INTERVAL?it(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=tt(r,e,t),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),He(n,i,r,o,t)}function st(){let e,{meta:t,id:n,key:i,localeInfo:r,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)||"",h="dimension"===a?"first":"avg",d=ot(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,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:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={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:r,cube:o,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,s),hierarchy:e=>a.hierarchy(e,l,r,s),_cache:()=>r};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),r.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{r.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(r.wrappedFields),(i.virtualFields||[]).forEach((t=>{const i=l.field(t.from),o=st(n({meta:i.raw(),id:"".concat(e,"/").concat(t.key),sourceField:i,fieldExtractor:e=>a.extractor({field:e},l,r,s),key:t.key,type:i.type(),localeInfo:a.localeInfo,value:i.value},t.override||{}));r.virtualFields.push(o)})),r.allFields.push(...r.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(i=+ut.exec(e)[1]),ht.test(e)&&(r=+ht.exec(e)[1]),dt.test(e)){r=-1,i=0;const e=+dt.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=r;if(t){r=0;const s=Z(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+ft.exec(n)[1]}else i>-1?(i=-1,r=+ft.exec(n)[1]):r+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=vt(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(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){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!==r&&(r||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",rt)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(Zw);var Qw=n(Zw.exports);const eq={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let i=[];n.length&&n.forEach((e=>{i=i.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return i.concat(t)},filterValues:function(e,t){const n=this;let i,r;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(r=function(e,t){const n=t.key.indexOf("qHyperCube")+10,i=t.key.substr(0,n),r=t.key.substr(n+1);return e.dataset(i).field(r)}(e,t),i=r&&r.raw(),i.qLocked?(o.push(i),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const tq={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function nq(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,i=e.dataPaths||[""],r=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function i(){}return i.update=function(e,i,r){t.isActive()||t.begin(n),Qw.qBrushHelper(r).forEach((e=>{t.select(e)}))},i.toggleValues=function(i,r,o){const s=eq.brushInterceptors.filterValues(e,i),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),r.start(),r.emit("update",[],[])),a},i}(t,n,r),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=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 m(){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=Ib(!0,{},tq,e),r={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 r=function(){const e=[];let n=i.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&&r.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:r,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),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",d),document.addEventListener("keyup",d);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,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),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=i.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 iq{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var rq={create:e=>e.selectionsApi?nq(e):new iq};var oq={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 sq={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Eg.DIRECTION_ALL,threshold:1,enable(i,r){if(e.lassoing)return t.isSelectionEnabled();const o=oq.isOnComponentForLasso(r,n,this);return t.isSelectionEnabled()&&r&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(i){oq.isOnComponentForLasso(i,n,this)&&(t.switchTo("lasso",this.chart,i),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",i))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(i){e.lassoing&&(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(i){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var aq={callMeasureRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,event:"measurerange",enable(r,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(r){const o="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,r),t.doEmit(this.chart,"rangeMeasure","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(i){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",i),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function lq(e,t){let n;return n="x-axis"===e?"horizontal"===t?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL:"horizontal"===t?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,n}var cq={callAreaRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:lq(i,n.isHorizontal),event:"arearange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(r){const o="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,r),t.doEmit(this.chart,"rangeMinor","areaStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(i){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",i))},arearangeend(i){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",i),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var uq={callDimensionRangeGesture:function(e,t,n,i){const r=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"majorrange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(r){const o="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,r),t.doEmit(this.chart,"rangeDim","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(i){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",i),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var hq={callDragGesture:function(e,t,n,i,r){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"drag",enable(i,r){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!r&&!!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:i?`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&&r&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let i=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(i=-i),n.handlers.scrollHandler.getScrollApi().move(i),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var dq={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,i){return!(!i||!e())&&oq.isOnComponentForNavBtn(i,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,i=n?n.getAttribute("data-action"):"";if(i)return t.emit(i)}))}}}}};var fq={create:function(e,t,n,i,r){const o={};t=t||"vertical";const s=i.lassoBrushKey||"select",a=i.dimRangeBrushKey||null,l=i.measureRangeBrushKey||null,c=i.areaBrushKey||null,u=i.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let i=s;const r=t||f.chart;switch(f.gesture){case"majorrange":v(r,"rangeDim","rangeClear",n),i=a;break;case"measurerange":v(r,"rangeMeasure","rangeClear",n),i=l;break;case"arearange":v(r,"rangeMinor","areaClear",n),i=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&r.brush(i).clear(),f.chart=t,f.type=o}function v(e,t,n,i){if(e){const r=e.component(t);r&&r.emit(n,i)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:i,isHorizontal:p,active:f,rangeSelStatus:r};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(dq.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(sq.callLassoGesture(d,x,w)),a?l?(b.push(uq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(aq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(uq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(cq.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(aq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(cq.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(hq.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function pq(e,t,n,i,r){let o=!1;i=i||"tooltip",n=n||["self"];const s=e.brush(i),a={};function l(){if(o){e.component(r).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(i,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(r).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 mq={create:(...e)=>pq(...e)},gq={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 yq=-3;const vq=e=>({h:t,data:n,style:i})=>{const r=function(e,t){const n=e.chartInstance.dataset(e.dataPath),i=[],r=t.length-5,o=Math.min(5,t.length);for(let r=0;r<o;r++){const o=t[r],s={rows:[]};if(e.labelData){const t=[],r=e.labelData;let a=!1;for(let e=0;e<r.length;e++){const n=o.data[r[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[r[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const i=o.data;return e.rowResolver(n.field(i[t].source.field),i[t],i)})).filter((e=>!!e));const l=bq(e,o);l&&s.rows.unshift(l),i.push(s)}}r>0&&(i.numberInExcess=r);return i.rowCount=i[0]?i.length*i[0].rows.length:0,i}(e,n),o={h:t,style:i,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,r)};function bq(e,t){var n,i,r;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(i=n.getSettings)||void 0===i?void 0:i.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]===yq&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(r=t.attrs)||void 0===r?void 0:r.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const xq="dist-flow-tooltip",wq=`#${xq}`;function qq(){if(!document.querySelector(wq)){const e=document.createElement("div");e.id=xq,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 Sq({key:e="tooltip",rtl:t,fontFamily:n,filter:i,content:r}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){qq()},beforeUpdate(){qq()},destroyed(){!function(){const e=document.querySelector(wq);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(wq),content:r,filter:i,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:Mq}=sw;const Dq={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:gq.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:i,translator:r,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...i.cell,textAlign:a,fontWeight:"bold",direction:Mq(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 i={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},r=n("div",{style:i});t=o?[e.value,r]:[r,e.value]}const r=o?[":",e.label]:[e.label,":"],l={...i.cell,textAlign:a,direction:Mq(e.label)},c={...i.cell,textAlign:o?"left":"right",direction:Mq(e.value)};s.push(n("tr",null,n("td",{style:l},r),n("td",{style:c},t)))}))})),t.numberInExcess){const e=r.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...i.cell,textAlign:a,direction:Mq(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function _q(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let i={},r=!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(i).forEach((e=>{l(i[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(i).forEach((e=>{i[e].action.closeTooltip()}))}function u(){c();for(const e in i)i[e].brush.clear()}return o.setUp=function(t){const o=Ib(!0,{},Dq,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");i[o.contexts[0]]&&r&&l(i[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:mq.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);i[o.contexts[0]]=a,r&&s(a);const c=Sq({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:vq(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(){r&&a(),i=[]},o.closeTooltip=c,o.isOn=()=>r,o.on=function(){r||(r=!0,Object.keys(i).forEach((e=>{s(i[e])})),t&&t.on("mouseleave",u))},o.off=function(){r&&(r=!1,a(),t&&t.off("mouseleave",u),c())},o}var Cq={create:(e,t,n)=>_q(e,t,n)};const kq=".scrollHandler";function Eq(e,t,n,i,r){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=i,this._legendKey=r}function Aq(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function Tq(e){const t=function(e){let t=0,n=0,i=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),i=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(i=0,n=-1*t),void 0!==e.wheelDeltaY&&(i=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:i,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,i){if(i&&n.componentsFromPoint(t).some((e=>e.settings.key===i)))return n.component(i).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function Iq(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}Eq.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Eq.prototype.setDisabled=function(e){this._disabled=e},Eq.prototype.getDisabled=function(){return this._disabled},Eq.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Aq.call(this))},Eq.prototype.getItemSize=function(){return this._itemSize},Eq.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Aq.call(this);return this._scrollViewSizeInItem},Eq.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Iq.bind(this)));this._$chartElement.on(`mousewheel${kq} DOMMouseScroll${kq}`,Tq.bind(this)),this._$chartElement.on(`touchstart${kq}`,(e=>{e.preventDefault()})),this._on=!0},Eq.prototype.isOn=function(){return this._on},Eq.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(kq),this._on=!1},Eq.prototype.updateViewState=function(e){Aq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Eq.prototype.onResize=function(){this._sizeChanged=!0,Aq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Eq.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Eq.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Eq.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Eq.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Eq.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Eq.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const Rq=166/26,Oq=12,Nq=11,Pq=12/Nq;function Lq(e){return(Math.min(e,3)*Oq+Math.max(e-3,0)*Rq)/Nq}function Fq(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const r=t+n+i;return{latin:e.length-r,cjk:r}}function zq(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=Fq(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const i=Fq(e[t].qText);n.latin+=i.latin,n.cjk+=i.cjk}));const i=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/i,n.cjkRatio=n.cjk/i,n}function jq(e,t,n){return e*(e<=24?t:n)}var Hq={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:Lq,getCharacterRatios:Fq,getTotalCharacterRatios:zq,getAdjustedMaxGlyphCount:function(e,t,n){const i=zq(t,n),r=i.latinRatio*e,o=i.cjkRatio*e;return Math.ceil(Lq(r)+o*Pq)},estimateLatinLabelWidth:jq,estimateLabelWidth:function(e,t,n,i,r){return e*n+jq(t,i,r)}};const Bq={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}},Vq=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,$q=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Wq=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Uq=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Yq=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Xq=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Kq=Math.floor,Gq=Math.round,Jq=Jv.extend({init(){let e,t,n,i,r,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof Jq)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=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(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){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<=.5?2*i*t:(2-2*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-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),m=parseFloat(u[7]),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<=.5?2*i*t:(2-2*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-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){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*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-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p),m=1}else Bq[h.toLowerCase()]?(n=h.toLowerCase(),d=Bq[n].r,f=Bq[n].g,p=Bq[n].b,m="number"==typeof Bq[n].a?Bq[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=Kq(d),this._g=Kq(f),this._b=Kq(p),this._a=m,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=Jq.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Jq.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Jq.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Jq.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Jq.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Jq.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=Jq.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Jq.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),i=parseFloat(n[1]),r=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(${i},${r},${o},${s})`},isEqual(e){return e instanceof Jq||(e=new Jq(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Kq(this._r+(e._r-this._r)*t),Kq(this._g+(e._g-this._g)*t),Kq(this._b+(e._b-this._b)*t),Kq(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,i=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Jq(i)}});Jq.toRGB=function(e){if(e instanceof Jq)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Jq.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Jq.toRGBA=function(e,t){if(e instanceof Jq)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Jq.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Jq.toHex=function(e){let t,n,i;return e instanceof Jq?(t=e._r.toString(16),n=e._g.toString(16),i=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${[t,n,i].join("")}`):("string"==typeof e&&(e=Jq.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),i=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${t}${n}${i}`)},Jq.toHSL=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Jq(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(i=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(r=c-u,n=i>.5?r/(2-c-u):r/(c+u),c){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsl(${360*o},${100*n},${100*i})`},Jq.toHSLA=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Jq(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(r=u-h,n=i>.5?r/(2-u-h):r/(u+h),u){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsla(${360*o},${100*n},${100*i},${c})`},Jq.toHSVComponents=function(e){let t,n,i=0;"string"==typeof e&&(e=new Jq(e));const r=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(r,o,s),l=Math.min(r,o,s),c=a;if(a===l)t=0,i=0;else{switch(n=a-l,t=0===n?0:n/c,a){case r:i=(o-s)/n+(o<s?6:0);break;case o:i=(s-r)/n+2;break;case s:i=(r-o)/n+4}i/=6}return{h:360*i%360,s:100*t,v:100*c}},Jq.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Jq)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,i=0,r=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),i=parseInt(e[2],10),r=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),i=parseInt(e[2],16),r=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16))),(n<<16)+(i<<8)+r},Jq.blend=function(e,t,n){const i=(16711680&(e=Jq.toNumber(e)))>>16,r=(65280&e)>>8,o=255&e;return(i+(((16711680&(t=Jq.toNumber(t)))>>16)-i)*n<<16)+(r+(((65280&t)>>8)-r)*n<<8)+(o+((255&t)-o)*n)},Jq.getBlend=function(e,t,n){const i=e._r+(t._r-e._r)*n,r=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 Jq(i,r,o,s)},Jq.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Vq.test(e)||$q.test(e)||Wq.test(e)||Uq.test(e)||Yq.test(e)||Xq.test(e)||Bq[e.toLowerCase()])},Jq.getBestContrast=function(e,t,n){const i=e.getLuminance();return Math.abs(i-t.getLuminance())>Math.abs(i-n.getLuminance())?t:n},Jq.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,i=t.getLuminance()/100;return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},Jq.isDark=function(){const e={getLuminance:Jq.prototype.getLuminance,isInvalid:Jq.prototype.isInvalid};return Jq.prototype.init.apply(e,[].slice.call(arguments)),Jq.prototype.isDark.call(e)},Jq.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Zq={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 Jq(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Jq(e);return 0===t.getAlpha()?this.DARK_GREY:Jq.getBestContrast(t,new Jq(Zq.LIGHT_GREY),new Jq(Zq.DARK_GREY))},getBestContrast:(e,t,n)=>Jq.getBestContrast(new Jq(e),new Jq(t),new Jq(n)),getContrastingTransparent(e){const t=new Jq(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function Qq(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function eS(e,t){if(Ev(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Ev(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return tS(Ev(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function tS(e){return e.qCardinalities.qHypercubeCardinal}var nS={getHyperCube:function(e,t){return e&&(e=t?Ev(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:Qq,hasSecondMeasure:function(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:eS,getStackedCubeSizeOfMax2Dims:function(e,t){return Qq(e,t)?eS(e,t):function(e,t){return Ev(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return Qq(e,t)?eS(e,t):1},getDimensionSize:tS};const iS=function(){this._maxJitter=1};iS.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},iS.prototype.getJitterValue=function(e){const t=Math.abs(Iw(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var rS={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var oS={generateHyperCube:function(e,t,n,i){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Ib(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),hx.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let r=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){r=[sx.create(sx.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Ev(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=r,rx.hasMultipleDimensions(t)?Fb.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((r=>{Lx.applySorting(t,e,n,r,i);const o=r.dimensions[0],s=r.dimensions[1],a=r.measures[0],l=Ox.getFractileExpression(1,o,s,a),c=Ox.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const sS=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function aS(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,i=t.some(sS),r=n.some(sS),o=e.color.point.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}function lS({layout:e,localeInfo:t,model:n,picasso:i,environment:r}){const{app:o,theme:s,translator:a}=r,l=Ib(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n,i;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(i=e.qUndoExclude)||void 0===i||!i.legendData)}(e)&&(e=function(e){return(e=Ib({},e)).snapshotData=Ib({},e.snapshotData),e.snapshotData.content=Ib({},e.snapshotData.content),e.snapshotData.content.chartData=Ib({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,i,r,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?kv:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,S=p.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),D={theme:x,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:Ng(Ng({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?Mv(M):void 0})},_=qv({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto((function(e){return q?q({layout:e,defaultAuto:Cv}):Cv(e)}));var C=!1,k={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(S)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:Ng({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Mv}),n=Dv(D,t);return _.config(n),_.getAuxiliarySettings(S).then((function(){C=!0}))}};return k}({app:o,model:n,picasso:i,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:aS(e)}})})}const cS=nx.DATA_PATH,uS=nx.HYPERCUBE_PATH,hS=nx.HYPERCUBE_DEF_PATH;function dS(e){return Array.isArray(e)?e:e?[e]:[]}function fS(e){return Math.min(nS.getOuterDimensionSizeOfMax2Dims(e,cS),nx.MAX_STACKED_VALUES)}function pS(e,t){return{viewSize:t,max:fS(e)}}function mS(){const e=nx.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function gS(){if(this.layout&&nS.hasSecondDimension(this.layout,cS)){this._scrollHandler.onResize();!!this.layout.snapshotData||mS.call(this)}}function yS(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function vS(e,t){return Ev(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const bS=Tw.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:i,$element:r,backendApi:o,selectionsApi:s}){this._super(i,r,t,o,s),this.flags=n,this.picasso=i,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Gw,this._selectionHandler=rq.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Cq.create(this.chartInstance,r,nx.CHART_ID),this._scrollHandler=new Eq(this.chartInstance,r,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=nx.BUBBLE_SCALES_MAX,this._jitterTool=new iS,this.setDataPaths([`${cS}/${uS}`])},onScrollCallback(e,t,n){const i=this;this._updateColorMapData(e).then((()=>{i.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[cS][uS],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!nS.hasSecondDimension(this.layout,cS)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,i=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[i?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(nx.MAX_POINT_BASE_SIZE_PX,t*nx.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(nx.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=dS(t.trigger),i=dS(t.consume),r=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Hq.getAdjustedMaxGlyphCount(function(e){const t=e[cS][uS].qDimensionInfo,n=nS.hasSecondDimension(e,cS)?t[0].qApprMaxGlyphCount:0;return Math.min(nx.MAX_GLYPH_COUNT,n)}(this.layout||e),e[cS][uS].qStackedDataPages[0].qData[0].qSubNodes),s=r/4;return{brush:{trigger:n,consume:i},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,i=e.color.point.auto?n.getStyle(nx.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),r=dS(t.trigger),o=dS(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";nS.hasSecondDimension(e,cS)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:i,stroke:n.getStyle(nx.CHART_ID,"box","stroke"),strokeWidth:0,width:nx.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:nx.MAX_POINT_BASE_SIZE_PX,minWidthPx:nx.MIN_POINT_PIXELS+2*nx.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*nx.JITTER_PARAMETER);const i=s._pointMaxSizePx+n+2*nx.BOX_PADDING,r=i/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,i),this.settings.settings.box.width=r},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return nS.hasSecondDimension(e,cS)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let i=1;e.dataPoint&&!1===e.dataPoint.border&&(i=0);const r=dS(t.trigger),o=dS(t.consume);this._tooltipHandler.isOn()&&(r.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return Zq.getContrastingTransparent(t)},size:.3,strokeWidth:i,sizeLimits:{maxRelExtent:10,maxPx:nx.MAX_POINT_BASE_SIZE_PX,minPx:nx.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*nx.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,nx.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return nS.hasSecondDimension(e,cS)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${cS}/${uS}`]),l},_getPointSelectionLayerSettings(e){const t=Ib(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,i=!!e.snapshotData,r=e.presentation&&e.presentation.visibleComponents,o=r&&-1!==e.presentation.visibleComponents.indexOf("point"),s=r&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[cS][uS],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=Mw.create({chartID:nx.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&nS.hasSecondDimension(e,cS);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:vS(e,0)},!0),i=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:vS(e,1)},!0),r=this._selectionHandler.setUpBrush({dataPath:cS,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:Ib(!0,{},i.trigger,{data:[""]}),consume:[Ib(!0,{},i.consume,{data:[""]})]},f={trigger:t?i.trigger:null,consume:[n.consume,i.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,i.consume,s.consume,r.consume]},m={trigger:[Ib(!0,{},r.trigger,{data:[""]})],consume:[Ib(!0,{},r.consume,{data:[""]}),n.consume,i.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:nS.hasSecondDimension(e,cS)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${uS}/qDimensionInfo/${nS.hasSecondDimension(e,cS)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:nS.hasSecondDimension(e,cS)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const i={};return 1===e.length?(i.isOpenDim=!1,e[0]?i.isOpenMea=!1:i.isOpenMea=!0):e[0]&&!e[1]?(i.isOpenDim=!1,i.isOpenMea=!0):!e[0]&&e[1]?(i.isOpenDim=!0,i.isOpenMea=!1):e[0]&&e[1]?(i.isOpenDim=!1,i.isOpenMea=!1):(i.isOpenDim=!0,i.isOpenMea=!0),t&&(i.isOpenMea=!1),n&&(i.isOpenDim=!1),i}(y,vS(e,0),vS(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=fq.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:nS.hasSecondDimension(e,cS),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!i,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:pS(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:Zb(nx.CHART_ID,n,e,this.flags),axisLabelStyle:Qb(nx.CHART_ID,n,e,this.flags)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const i=this._getPointMarkerSettings(e,p,g);if(i.data.extract.props[c]={field:"qMeasureInfo/0"},i.settings[c]={scale:"measure"},nS.hasSecondDimension(e,cS)&&(i.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},i.settings[u]={scale:"dimension"}),this._jitter){i.settings[u]=i.settings[u]||{};const e=this._jitterTool;i.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,nx.JITTER_PARAMETER)}}h.addComponent("point-marker",i),h.addComponent("point-marker",this._getPointSelectionLayerSettings(i));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const i={title:ex(nx.CHART_ID,n,e,this.flags),label:tx(nx.CHART_ID,n,e,this.flags)};this.addLegend(h,t,m,i)}}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n,i){const r={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:i,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(r,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter((e=>!!e)),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map((e=>Ib(!0,e,{style:{active:null}}))),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(gS.call(this),this._super())},hasValidData(){const e=this.layout;return e[cS]&&e[cS][uS]&&e[cS][uS].qStackedDataPages.length&&e[cS][uS].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(gS.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,i=this._super;return!e&&nS.hasSecondDimension(t,cS)&&this._scrollHandler.isDataSizeChanged(Ev(t,`${cS}.${uS}.qStackedDataPages.0.qData.0.qSubNodes.length`),nS.getOuterDimensionSizeOfMax2Dims(t,cS))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>i.call(n))))):this._updateColorMapData(t).then((()=>i.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[cS][uS].qStackedDataPages=this.layout[cS][uS].qStackedDataPages,rS.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>1e4||nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>3e3,i=t&&n,r=pS(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&i},options:{paddingBottom:i&&r&&r.viewSize<r.max,supportNegative:!0,explicitLimitedData:i}}},async _updateColorMapData(e){this.colorService=lS({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${cS}/${uS}/${t}`)},_createColorLegendCube(e){const t=nS.hasSecondDimension(this.layout,cS)?1:0;return{qDimensionInfo:[this.layout[cS][uS].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:i}=this.environment,r=this,o=r.backendApi.model;return r._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[hS],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>oS.generateHyperCube(e,t,n,i)};return r._derivedProperties.updateDerivedProperties(a)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return rS.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:i}=t.environment.options;let r;return i?(t._scrollHandler.updateViewState(fS(e)),t._scrollHandler.setScrollState(i.scroll)):(t._scrollHandler.resetScroll(),yS.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(mS.call(t),t._cacheSizeInitialized=!0),r=nS.hasSecondDimension(e,cS)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[cS][uS],{height:e[cS][uS].qSize.qcy||1}),r.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&vS(e,0))}}),xS={enabled:!0,delay:50};function wS(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class qS{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Ib(!0,{},xS,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),i={data:e,dfd:wS(),wrapper:wS(),requestedAt:n},r=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>r,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?SS.apply(this,[i,0]):SS.apply(this,[i,Math.min(t,1e3)]),this.recentRequests.push(i),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),i.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function SS(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{MS.call(n)}),t):MS.call(n)}function MS(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&DS.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function DS(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&MS.call(t)})),this.onSend(e.data,n)}const _S=new Zv(0,0,0,0),CS=new Zv(0,0,0,0);class kS{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const i=this.pages[n].qArea;_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),CS.set(i.qLeft,i.qTop,i.qWidth,i.qHeight);const r=CS.intersection(_S,!0);if(t.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),i.qLeft<=e.qLeft&&i.qLeft+i.qWidth>=e.qLeft+e.qWidth&&i.qTop<=e.qTop&&i.qTop+i.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),CS.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=_S.intersection(CS,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=t.qData[0],o=r.qSubNodes,s={};for(const e in r)r.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(i,i+n.height):r[e]);return s.qUp+=i,s.qDown+=t.qArea.qHeight-n.height-i,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const ES={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},AS=Jv.extend("CacheCube",{init(e,t,n,i){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(i||{}),this.setPath(n),"K"===this.options.mode?this.cube=new kS:"P"===this.options.mode?this.cube=new lb:this.cube=new tb,this.throttle=new qS({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),i=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(i,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Ib(!0,{},ES,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const i=[];for(t=0;t<e.length;++t)n=e[t],i.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(i)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(i))):0===i[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(i,i)):this.throttle.queue(i)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,i=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:i<0?-1:i>0?1:0}},_getAreasToCache(e,t,n){let i,r,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),i=0;i<e.length;++i)r=0!==t?Math.floor(.5*Math.max(0,f-e[i].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[i].qWidth)):0,s=r*t-r,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[i].qHeight,f),this.cubeHeight)):e[i].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[i].qWidth,this.cacheWidth),this.cubeWidth)):e[i].qWidth,u=Math.max(0,Math.min(e[i].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[i].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),TS=nx.DATA_PATH,IS=nx.HYPERCUBE_DEF_PATH;class RS{constructor(e){this.model=e,this.path=`/${TS}/${IS}`,this.cacheCube=new AS(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:nx.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:nS.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){return 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),{qae:qb(t),ext:Xx(t),component(){const n=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),i=e.useDeviceType(),r=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:i,options:r,theme:o,translator:s})),[t,n,r.direction,r.freeResize,s.language(),o.name(),i])}(),o=i.options.renderer,s=e.useMemo((()=>Ig(o)),[o]),a=e.useSelections(),l=e.useStaleLayout(),c=e.useModel(),u=e.useConstraints(),h=function(){const t=e.useConstraints(),[n,i]=e.useState(!1),[r,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&i(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Rg,hidden:!n||!s,active:r,action(){o((e=>!e))}})),[s,r,n]),a.enabled=()=>n,a.active=()=>r,a}(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=r(n),o=function(e,t){return t.snapshotData?new ub(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new RS(e)}(c,l),u=a,d=new bS({environment:i,lasso:h,flags:t.flags,picasso:s,$element:e,backendApi:o,selectionsApi:u});return p(d),()=>{d.destroy()}}),[]);const[,m]=e.usePromise((async()=>{if(!f)return;f.updateEnvironment(i),f.updateConstraints(u);if(!!!l.snapshotData){const e=await c.getEffectiveProperties();if(await f.updateDerivedProperties(e,l))return void d.pending();d.restore()}await f.updateData(l),await f.paint()}),[l,f,i]);if(m)throw m;var g;!function(t){const n=e.useRect(),i=e.useOptions(),r=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(r),t.options=i,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),g=f,e.onTakeSnapshot((e=>{if(g)return g.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(g)return g.getViewState()}})),[g])}}}}));
28
+ !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",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(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}))}));const be=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"},qe=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,De=/^\(dec\)/i,_e=/^\(hex\)/i,Ce=/^\(bin\)/i,ke=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function Ie(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/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(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}function Re(e,t,n){let i;return Se.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=Te(e,8,t,n):De.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):Ce.test(t)?e=Te(e,2,t,n):ke.test(t)&&(i="",e<0&&(i="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?i+(e=Ie(e,t)):t+i+e.toExponential(0)),e}function Oe(e,t,n){const i=xe(e);return n?i:new RegExp(i||"",t)}function Ne(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,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;i&&(e.abbreviate=!0),d=Ne(t,n),s=f.match(d),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&&(r=s.split(n),o=r.pop(),s=r.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)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.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=h}class Fe{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Fe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Ee.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Ee.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Le(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Le(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Le(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,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 i,r,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&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fe(...t)}function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(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,i,r){const o=ze(r,e,t,n,i),s=je(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},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 Xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ke(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}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),i=60*Ge(n),r=60*Ge(i),o=1e3*Ge(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}function Ze(e,t){let n,i=Je(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/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:r,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:Xe("".concat(t.year).slice(-2),2),YYY:Xe("".concat(t.year).slice(-3),3),def:e=>Xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:i.qTimeFmt||"hh:mm:ss",[Be.DATE]:i.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:i.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 i;e instanceof Date?i=Ke(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Ze(e,t));const r=Qe(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return 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 it(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function rt(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),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Be.INTERVAL?it(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=tt(r,e,t),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),He(n,i,r,o,t)}function st(){let e,{meta:t,id:n,key:i,localeInfo:r,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)||"",h="dimension"===a?"first":"avg",d=ot(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,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:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={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:r,cube:o,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,s),hierarchy:e=>a.hierarchy(e,l,r,s),_cache:()=>r};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),r.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{r.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(r.wrappedFields),(i.virtualFields||[]).forEach((t=>{const i=l.field(t.from),o=st(n({meta:i.raw(),id:"".concat(e,"/").concat(t.key),sourceField:i,fieldExtractor:e=>a.extractor({field:e},l,r,s),key:t.key,type:i.type(),localeInfo:a.localeInfo,value:i.value},t.override||{}));r.virtualFields.push(o)})),r.allFields.push(...r.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(i=+ut.exec(e)[1]),ht.test(e)&&(r=+ht.exec(e)[1]),dt.test(e)){r=-1,i=0;const e=+dt.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=r;if(t){r=0;const s=Z(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+ft.exec(n)[1]}else i>-1?(i=-1,r=+ft.exec(n)[1]):r+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=vt(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(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){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!==r&&(r||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",rt)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(Zw);var Qw=n(Zw.exports);const eq={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let i=[];n.length&&n.forEach((e=>{i=i.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return i.concat(t)},filterValues:function(e,t){const n=this;let i,r;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(r=function(e,t){const n=t.key.indexOf("qHyperCube")+10,i=t.key.substr(0,n),r=t.key.substr(n+1);return e.dataset(i).field(r)}(e,t),i=r&&r.raw(),i.qLocked?(o.push(i),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const tq={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function nq(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,i=e.dataPaths||[""],r=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function i(){}return i.update=function(e,i,r){t.isActive()||t.begin(n),Qw.qBrushHelper(r).forEach((e=>{t.select(e)}))},i.toggleValues=function(i,r,o){const s=eq.brushInterceptors.filterValues(e,i),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),r.start(),r.emit("update",[],[])),a},i}(t,n,r),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=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 m(){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=Ib(!0,{},tq,e),r={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 r=function(){const e=[];let n=i.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&&r.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:r,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),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",d),document.addEventListener("keyup",d);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,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),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=i.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 iq{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var rq={create:e=>e.selectionsApi?nq(e):new iq};var oq={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 sq={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Eg.DIRECTION_ALL,threshold:1,enable(i,r){if(e.lassoing)return t.isSelectionEnabled();const o=oq.isOnComponentForLasso(r,n,this);return t.isSelectionEnabled()&&r&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(i){oq.isOnComponentForLasso(i,n,this)&&(t.switchTo("lasso",this.chart,i),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",i))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(i){e.lassoing&&(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(i){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var aq={callMeasureRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,event:"measurerange",enable(r,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(r){const o="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,r),t.doEmit(this.chart,"rangeMeasure","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(i){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",i),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function lq(e,t){let n;return n="x-axis"===e?"horizontal"===t?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL:"horizontal"===t?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,n}var cq={callAreaRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:lq(i,n.isHorizontal),event:"arearange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(r){const o="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,r),t.doEmit(this.chart,"rangeMinor","areaStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(i){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",i))},arearangeend(i){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",i),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var uq={callDimensionRangeGesture:function(e,t,n,i){const r=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"majorrange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=oq.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(r){const o="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i];oq.isOnComponentForRange(r,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,r),t.doEmit(this.chart,"rangeDim","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(i){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",i),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var hq={callDragGesture:function(e,t,n,i,r){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"drag",enable(i,r){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!r&&!!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:i?`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&&r&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let i=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(i=-i),n.handlers.scrollHandler.getScrollApi().move(i),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var dq={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,i){return!(!i||!e())&&oq.isOnComponentForNavBtn(i,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,i=n?n.getAttribute("data-action"):"";if(i)return t.emit(i)}))}}}}};var fq={create:function(e,t,n,i,r){const o={};t=t||"vertical";const s=i.lassoBrushKey||"select",a=i.dimRangeBrushKey||null,l=i.measureRangeBrushKey||null,c=i.areaBrushKey||null,u=i.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let i=s;const r=t||f.chart;switch(f.gesture){case"majorrange":v(r,"rangeDim","rangeClear",n),i=a;break;case"measurerange":v(r,"rangeMeasure","rangeClear",n),i=l;break;case"arearange":v(r,"rangeMinor","areaClear",n),i=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&r.brush(i).clear(),f.chart=t,f.type=o}function v(e,t,n,i){if(e){const r=e.component(t);r&&r.emit(n,i)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:i,isHorizontal:p,active:f,rangeSelStatus:r};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(dq.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(sq.callLassoGesture(d,x,w)),a?l?(b.push(uq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(aq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(uq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(cq.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(aq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(cq.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(hq.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function pq(e,t,n,i,r){let o=!1;i=i||"tooltip",n=n||["self"];const s=e.brush(i),a={};function l(){if(o){e.component(r).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(i,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(r).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 mq={create:(...e)=>pq(...e)},gq={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 yq=-3;const vq=e=>({h:t,data:n,style:i})=>{const r=function(e,t){const n=e.chartInstance.dataset(e.dataPath),i=[],r=t.length-5,o=Math.min(5,t.length);for(let r=0;r<o;r++){const o=t[r],s={rows:[]};if(e.labelData){const t=[],r=e.labelData;let a=!1;for(let e=0;e<r.length;e++){const n=o.data[r[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[r[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const i=o.data;return e.rowResolver(n.field(i[t].source.field),i[t],i)})).filter((e=>!!e));const l=bq(e,o);l&&s.rows.unshift(l),i.push(s)}}r>0&&(i.numberInExcess=r);return i.rowCount=i[0]?i.length*i[0].rows.length:0,i}(e,n),o={h:t,style:i,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,r)};function bq(e,t){var n,i,r;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(i=n.getSettings)||void 0===i?void 0:i.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]===yq&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(r=t.attrs)||void 0===r?void 0:r.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const xq="dist-flow-tooltip",wq=`#${xq}`;function qq(){if(!document.querySelector(wq)){const e=document.createElement("div");e.id=xq,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 Sq({key:e="tooltip",rtl:t,fontFamily:n,filter:i,content:r}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){qq()},beforeUpdate(){qq()},destroyed(){!function(){const e=document.querySelector(wq);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(wq),content:r,filter:i,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:Mq}=sw;const Dq={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:gq.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:i,translator:r,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...i.cell,textAlign:a,fontWeight:"bold",direction:Mq(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 i={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},r=n("div",{style:i});t=o?[e.value,r]:[r,e.value]}const r=o?[":",e.label]:[e.label,":"],l={...i.cell,textAlign:a,direction:Mq(e.label)},c={...i.cell,textAlign:o?"left":"right",direction:Mq(e.value)};s.push(n("tr",null,n("td",{style:l},r),n("td",{style:c},t)))}))})),t.numberInExcess){const e=r.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...i.cell,textAlign:a,direction:Mq(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function _q(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let i={},r=!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(i).forEach((e=>{l(i[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(i).forEach((e=>{i[e].action.closeTooltip()}))}function u(){c();for(const e in i)i[e].brush.clear()}return o.setUp=function(t){const o=Ib(!0,{},Dq,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");i[o.contexts[0]]&&r&&l(i[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:mq.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);i[o.contexts[0]]=a,r&&s(a);const c=Sq({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:vq(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(){r&&a(),i=[]},o.closeTooltip=c,o.isOn=()=>r,o.on=function(){r||(r=!0,Object.keys(i).forEach((e=>{s(i[e])})),t&&t.on("mouseleave",u))},o.off=function(){r&&(r=!1,a(),t&&t.off("mouseleave",u),c())},o}var Cq={create:(e,t,n)=>_q(e,t,n)};const kq=".scrollHandler";function Eq(e,t,n,i,r){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=i,this._legendKey=r}function Aq(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function Tq(e){const t=function(e){let t=0,n=0,i=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),i=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(i=0,n=-1*t),void 0!==e.wheelDeltaY&&(i=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:i,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,i){if(i&&n.componentsFromPoint(t).some((e=>e.settings.key===i)))return n.component(i).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function Iq(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}Eq.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Eq.prototype.setDisabled=function(e){this._disabled=e},Eq.prototype.getDisabled=function(){return this._disabled},Eq.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Aq.call(this))},Eq.prototype.getItemSize=function(){return this._itemSize},Eq.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Aq.call(this);return this._scrollViewSizeInItem},Eq.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Iq.bind(this)));this._$chartElement.on(`mousewheel${kq} DOMMouseScroll${kq}`,Tq.bind(this)),this._$chartElement.on(`touchstart${kq}`,(e=>{e.preventDefault()})),this._on=!0},Eq.prototype.isOn=function(){return this._on},Eq.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(kq),this._on=!1},Eq.prototype.updateViewState=function(e){Aq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Eq.prototype.onResize=function(){this._sizeChanged=!0,Aq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Eq.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Eq.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Eq.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Eq.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Eq.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Eq.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const Rq=166/26,Oq=12,Nq=11,Pq=12/Nq;function Lq(e){return(Math.min(e,3)*Oq+Math.max(e-3,0)*Rq)/Nq}function Fq(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const r=t+n+i;return{latin:e.length-r,cjk:r}}function zq(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=Fq(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const i=Fq(e[t].qText);n.latin+=i.latin,n.cjk+=i.cjk}));const i=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/i,n.cjkRatio=n.cjk/i,n}function jq(e,t,n){return e*(e<=24?t:n)}var Hq={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:Lq,getCharacterRatios:Fq,getTotalCharacterRatios:zq,getAdjustedMaxGlyphCount:function(e,t,n){const i=zq(t,n),r=i.latinRatio*e,o=i.cjkRatio*e;return Math.ceil(Lq(r)+o*Pq)},estimateLatinLabelWidth:jq,estimateLabelWidth:function(e,t,n,i,r){return e*n+jq(t,i,r)}};const Bq={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}},Vq=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,$q=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Wq=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Uq=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Yq=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Xq=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Kq=Math.floor,Gq=Math.round,Jq=Jv.extend({init(){let e,t,n,i,r,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof Jq)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=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(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){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<=.5?2*i*t:(2-2*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-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),m=parseFloat(u[7]),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<=.5?2*i*t:(2-2*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-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){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*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-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Gq(255*d),f=Gq(255*f),p=Gq(255*p),m=1}else Bq[h.toLowerCase()]?(n=h.toLowerCase(),d=Bq[n].r,f=Bq[n].g,p=Bq[n].b,m="number"==typeof Bq[n].a?Bq[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=Kq(d),this._g=Kq(f),this._b=Kq(p),this._a=m,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=Jq.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Jq.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Jq.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Jq.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Jq.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Jq.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=Jq.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Jq.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),i=parseFloat(n[1]),r=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(${i},${r},${o},${s})`},isEqual(e){return e instanceof Jq||(e=new Jq(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Kq(this._r+(e._r-this._r)*t),Kq(this._g+(e._g-this._g)*t),Kq(this._b+(e._b-this._b)*t),Kq(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,i=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Jq(i)}});Jq.toRGB=function(e){if(e instanceof Jq)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Jq.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Jq.toRGBA=function(e,t){if(e instanceof Jq)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Jq.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Jq.toHex=function(e){let t,n,i;return e instanceof Jq?(t=e._r.toString(16),n=e._g.toString(16),i=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${[t,n,i].join("")}`):("string"==typeof e&&(e=Jq.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),i=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${t}${n}${i}`)},Jq.toHSL=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Jq(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(i=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(r=c-u,n=i>.5?r/(2-c-u):r/(c+u),c){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsl(${360*o},${100*n},${100*i})`},Jq.toHSLA=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Jq(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(r=u-h,n=i>.5?r/(2-u-h):r/(u+h),u){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsla(${360*o},${100*n},${100*i},${c})`},Jq.toHSVComponents=function(e){let t,n,i=0;"string"==typeof e&&(e=new Jq(e));const r=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(r,o,s),l=Math.min(r,o,s),c=a;if(a===l)t=0,i=0;else{switch(n=a-l,t=0===n?0:n/c,a){case r:i=(o-s)/n+(o<s?6:0);break;case o:i=(s-r)/n+2;break;case s:i=(r-o)/n+4}i/=6}return{h:360*i%360,s:100*t,v:100*c}},Jq.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Jq)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,i=0,r=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),i=parseInt(e[2],10),r=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),i=parseInt(e[2],16),r=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16))),(n<<16)+(i<<8)+r},Jq.blend=function(e,t,n){const i=(16711680&(e=Jq.toNumber(e)))>>16,r=(65280&e)>>8,o=255&e;return(i+(((16711680&(t=Jq.toNumber(t)))>>16)-i)*n<<16)+(r+(((65280&t)>>8)-r)*n<<8)+(o+((255&t)-o)*n)},Jq.getBlend=function(e,t,n){const i=e._r+(t._r-e._r)*n,r=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 Jq(i,r,o,s)},Jq.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Vq.test(e)||$q.test(e)||Wq.test(e)||Uq.test(e)||Yq.test(e)||Xq.test(e)||Bq[e.toLowerCase()])},Jq.getBestContrast=function(e,t,n){const i=e.getLuminance();return Math.abs(i-t.getLuminance())>Math.abs(i-n.getLuminance())?t:n},Jq.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,i=t.getLuminance()/100;return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},Jq.isDark=function(){const e={getLuminance:Jq.prototype.getLuminance,isInvalid:Jq.prototype.isInvalid};return Jq.prototype.init.apply(e,[].slice.call(arguments)),Jq.prototype.isDark.call(e)},Jq.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Zq={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 Jq(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Jq(e);return 0===t.getAlpha()?this.DARK_GREY:Jq.getBestContrast(t,new Jq(Zq.LIGHT_GREY),new Jq(Zq.DARK_GREY))},getBestContrast:(e,t,n)=>Jq.getBestContrast(new Jq(e),new Jq(t),new Jq(n)),getContrastingTransparent(e){const t=new Jq(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function Qq(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function eS(e,t){if(Ev(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Ev(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return tS(Ev(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function tS(e){return e.qCardinalities.qHypercubeCardinal}var nS={getHyperCube:function(e,t){return e&&(e=t?Ev(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:Qq,hasSecondMeasure:function(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:eS,getStackedCubeSizeOfMax2Dims:function(e,t){return Qq(e,t)?eS(e,t):function(e,t){return Ev(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return Qq(e,t)?eS(e,t):1},getDimensionSize:tS};const iS=function(){this._maxJitter=1};iS.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},iS.prototype.getJitterValue=function(e){const t=Math.abs(Iw(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var rS={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var oS={generateHyperCube:function(e,t,n,i){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Ib(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),hx.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let r=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){r=[sx.create(sx.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Ev(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=r,rx.hasMultipleDimensions(t)?Fb.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((r=>{Lx.applySorting(t,e,n,r,i);const o=r.dimensions[0],s=r.dimensions[1],a=r.measures[0],l=Ox.getFractileExpression(1,o,s,a),c=Ox.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const sS=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function aS(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,i=t.some(sS),r=n.some(sS),o=e.color.point.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}function lS({layout:e,localeInfo:t,model:n,picasso:i,environment:r}){const{app:o,theme:s,translator:a}=r,l=Ib(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(t=t.chartData)&&void 0!==t&&t.legendDataPage||null===(n=e.qUndoExclude)||void 0===n||!n.legendData)}(e)&&(e=function(e){return(e=Ib({},e)).snapshotData=Ib({},e.snapshotData),e.snapshotData.content=Ib({},e.snapshotData.content),e.snapshotData.content.chartData=Ib({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,i,r,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?kv:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,S=p.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),D={theme:x,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:Ng(Ng({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?Mv(M):void 0})},_=qv({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto((function(e){return q?q({layout:e,defaultAuto:Cv}):Cv(e)}));var C=!1,k={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(S)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:Ng({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Mv}),n=Dv(D,t);return _.config(n),_.getAuxiliarySettings(S).then((function(){C=!0}))}};return k}({app:o,model:n,picasso:i,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:aS(e)}})})}const cS=nx.DATA_PATH,uS=nx.HYPERCUBE_PATH,hS=nx.HYPERCUBE_DEF_PATH;function dS(e){return Array.isArray(e)?e:e?[e]:[]}function fS(e){return Math.min(nS.getOuterDimensionSizeOfMax2Dims(e,cS),nx.MAX_STACKED_VALUES)}function pS(e,t){return{viewSize:t,max:fS(e)}}function mS(){const e=nx.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function gS(){if(this.layout&&nS.hasSecondDimension(this.layout,cS)){this._scrollHandler.onResize();!!this.layout.snapshotData||mS.call(this)}}function yS(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function vS(e,t){return Ev(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const bS=Tw.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:i,$element:r,backendApi:o,selectionsApi:s}){this._super(i,r,t,o,s),this.flags=n,this.picasso=i,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Gw,this._selectionHandler=rq.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Cq.create(this.chartInstance,r,nx.CHART_ID),this._scrollHandler=new Eq(this.chartInstance,r,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=nx.BUBBLE_SCALES_MAX,this._jitterTool=new iS,this.setDataPaths([`${cS}/${uS}`])},onScrollCallback(e,t,n){const i=this;this._updateColorMapData(e).then((()=>{i.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[cS][uS],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!nS.hasSecondDimension(this.layout,cS)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,i=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[i?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(nx.MAX_POINT_BASE_SIZE_PX,t*nx.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(nx.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=dS(t.trigger),i=dS(t.consume),r=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Hq.getAdjustedMaxGlyphCount(function(e){const t=e[cS][uS].qDimensionInfo,n=nS.hasSecondDimension(e,cS)?t[0].qApprMaxGlyphCount:0;return Math.min(nx.MAX_GLYPH_COUNT,n)}(this.layout||e),e[cS][uS].qStackedDataPages[0].qData[0].qSubNodes),s=r/4;return{brush:{trigger:n,consume:i},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,i=e.color.point.auto?n.getStyle(nx.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),r=dS(t.trigger),o=dS(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";nS.hasSecondDimension(e,cS)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:i,stroke:n.getStyle(nx.CHART_ID,"box","stroke"),strokeWidth:0,width:nx.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:nx.MAX_POINT_BASE_SIZE_PX,minWidthPx:nx.MIN_POINT_PIXELS+2*nx.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*nx.JITTER_PARAMETER);const i=s._pointMaxSizePx+n+2*nx.BOX_PADDING,r=i/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,i),this.settings.settings.box.width=r},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return nS.hasSecondDimension(e,cS)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let i=1;e.dataPoint&&!1===e.dataPoint.border&&(i=0);const r=dS(t.trigger),o=dS(t.consume);this._tooltipHandler.isOn()&&(r.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return Zq.getContrastingTransparent(t)},size:.3,strokeWidth:i,sizeLimits:{maxRelExtent:10,maxPx:nx.MAX_POINT_BASE_SIZE_PX,minPx:nx.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*nx.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,nx.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return nS.hasSecondDimension(e,cS)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${cS}/${uS}`]),l},_getPointSelectionLayerSettings(e){const t=Ib(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,i=!!e.snapshotData,r=e.presentation&&e.presentation.visibleComponents,o=r&&-1!==e.presentation.visibleComponents.indexOf("point"),s=r&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[cS][uS],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=Mw.create({chartID:nx.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&nS.hasSecondDimension(e,cS);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:vS(e,0)},!0),i=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:vS(e,1)},!0),r=this._selectionHandler.setUpBrush({dataPath:cS,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:Ib(!0,{},i.trigger,{data:[""]}),consume:[Ib(!0,{},i.consume,{data:[""]})]},f={trigger:t?i.trigger:null,consume:[n.consume,i.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,i.consume,s.consume,r.consume]},m={trigger:[Ib(!0,{},r.trigger,{data:[""]})],consume:[Ib(!0,{},r.consume,{data:[""]}),n.consume,i.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:nS.hasSecondDimension(e,cS)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${uS}/qDimensionInfo/${nS.hasSecondDimension(e,cS)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:nS.hasSecondDimension(e,cS)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const i={};return 1===e.length?(i.isOpenDim=!1,e[0]?i.isOpenMea=!1:i.isOpenMea=!0):e[0]&&!e[1]?(i.isOpenDim=!1,i.isOpenMea=!0):!e[0]&&e[1]?(i.isOpenDim=!0,i.isOpenMea=!1):e[0]&&e[1]?(i.isOpenDim=!1,i.isOpenMea=!1):(i.isOpenDim=!0,i.isOpenMea=!0),t&&(i.isOpenMea=!1),n&&(i.isOpenDim=!1),i}(y,vS(e,0),vS(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=fq.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:nS.hasSecondDimension(e,cS),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!i,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:pS(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:Zb(nx.CHART_ID,n,e,this.flags),axisLabelStyle:Qb(nx.CHART_ID,n,e,this.flags)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const i=this._getPointMarkerSettings(e,p,g);if(i.data.extract.props[c]={field:"qMeasureInfo/0"},i.settings[c]={scale:"measure"},nS.hasSecondDimension(e,cS)&&(i.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},i.settings[u]={scale:"dimension"}),this._jitter){i.settings[u]=i.settings[u]||{};const e=this._jitterTool;i.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,nx.JITTER_PARAMETER)}}h.addComponent("point-marker",i),h.addComponent("point-marker",this._getPointSelectionLayerSettings(i));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const i={title:ex(nx.CHART_ID,n,e,this.flags),label:tx(nx.CHART_ID,n,e,this.flags)};this.addLegend(h,t,m,i)}}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n,i){const r={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:i,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(r,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter((e=>!!e)),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map((e=>Ib(!0,e,{style:{active:null}}))),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(gS.call(this),this._super())},hasValidData(){const e=this.layout;return e[cS]&&e[cS][uS]&&e[cS][uS].qStackedDataPages.length&&e[cS][uS].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(gS.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,i=this._super;return!e&&nS.hasSecondDimension(t,cS)&&this._scrollHandler.isDataSizeChanged(Ev(t,`${cS}.${uS}.qStackedDataPages.0.qData.0.qSubNodes.length`),nS.getOuterDimensionSizeOfMax2Dims(t,cS))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>i.call(n))))):this._updateColorMapData(t).then((()=>i.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[cS][uS].qStackedDataPages=this.layout[cS][uS].qStackedDataPages,rS.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>1e4||nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>3e3,i=t&&n,r=pS(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&i},options:{paddingBottom:i&&r&&r.viewSize<r.max,supportNegative:!0,explicitLimitedData:i}}},async _updateColorMapData(e){this.colorService=lS({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${cS}/${uS}/${t}`)},_createColorLegendCube(e){const t=nS.hasSecondDimension(this.layout,cS)?1:0;return{qDimensionInfo:[this.layout[cS][uS].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:i}=this.environment,r=this,o=r.backendApi.model;return r._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[hS],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>oS.generateHyperCube(e,t,n,i)};return r._derivedProperties.updateDerivedProperties(a)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return rS.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:i}=t.environment.options;let r;return i?(t._scrollHandler.updateViewState(fS(e)),t._scrollHandler.setScrollState(i.scroll)):(t._scrollHandler.resetScroll(),yS.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(mS.call(t),t._cacheSizeInitialized=!0),r=nS.hasSecondDimension(e,cS)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[cS][uS],{height:e[cS][uS].qSize.qcy||1}),r.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&vS(e,0))}}),xS={enabled:!0,delay:50};function wS(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class qS{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Ib(!0,{},xS,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),i={data:e,dfd:wS(),wrapper:wS(),requestedAt:n},r=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>r,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?SS.apply(this,[i,0]):SS.apply(this,[i,Math.min(t,1e3)]),this.recentRequests.push(i),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),i.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function SS(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{MS.call(n)}),t):MS.call(n)}function MS(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&DS.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function DS(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&MS.call(t)})),this.onSend(e.data,n)}const _S=new Zv(0,0,0,0),CS=new Zv(0,0,0,0);class kS{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const i=this.pages[n].qArea;_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),CS.set(i.qLeft,i.qTop,i.qWidth,i.qHeight);const r=CS.intersection(_S,!0);if(t.push({coverage:r?r.clone():new Zv(0,0,0,0),idx:n}),i.qLeft<=e.qLeft&&i.qLeft+i.qWidth>=e.qLeft+e.qWidth&&i.qTop<=e.qTop&&i.qTop+i.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),CS.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=_S.intersection(CS,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=t.qData[0],o=r.qSubNodes,s={};for(const e in r)r.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(i,i+n.height):r[e]);return s.qUp+=i,s.qDown+=t.qArea.qHeight-n.height-i,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const ES={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},AS=Jv.extend("CacheCube",{init(e,t,n,i){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(i||{}),this.setPath(n),"K"===this.options.mode?this.cube=new kS:"P"===this.options.mode?this.cube=new lb:this.cube=new tb,this.throttle=new qS({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),i=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(i,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Ib(!0,{},ES,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const i=[];for(t=0;t<e.length;++t)n=e[t],i.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(i)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(i))):0===i[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(i,i)):this.throttle.queue(i)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,i=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:i<0?-1:i>0?1:0}},_getAreasToCache(e,t,n){let i,r,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),i=0;i<e.length;++i)r=0!==t?Math.floor(.5*Math.max(0,f-e[i].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[i].qWidth)):0,s=r*t-r,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[i].qHeight,f),this.cubeHeight)):e[i].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[i].qWidth,this.cacheWidth),this.cubeWidth)):e[i].qWidth,u=Math.max(0,Math.min(e[i].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[i].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),TS=nx.DATA_PATH,IS=nx.HYPERCUBE_DEF_PATH;class RS{constructor(e){this.model=e,this.path=`/${TS}/${IS}`,this.cacheCube=new AS(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:nx.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:nS.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){return 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),{qae:qb(t),ext:Xx(t),component(){const n=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),i=e.useDeviceType(),r=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:i,options:r,theme:o,translator:s})),[t,n,r.direction,r.freeResize,s.language(),o.name(),i])}(),o=i.options.renderer,s=e.useMemo((()=>Ig(o)),[o]),a=e.useSelections(),l=e.useStaleLayout(),c=e.useModel(),u=e.useConstraints(),h=function(){const t=e.useConstraints(),[n,i]=e.useState(!1),[r,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&i(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Rg,hidden:!n||!s,active:r,action(){o((e=>!e))}})),[s,r,n]),a.enabled=()=>n,a.active=()=>r,a}(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=r(n),o=function(e,t){return t.snapshotData?new ub(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new RS(e)}(c,l),u=a,d=new bS({environment:i,lasso:h,flags:t.flags,picasso:s,$element:e,backendApi:o,selectionsApi:u});return p(d),()=>{d.destroy()}}),[]);const[,m]=e.usePromise((async()=>{if(!f)return;f.updateEnvironment(i),f.updateConstraints(u);if(!!!l.snapshotData){const e=await c.getEffectiveProperties();if(await f.updateDerivedProperties(e,l))return void d.pending();d.restore()}await f.updateData(l),await f.paint()}),[l,f,i]);if(m)throw m;var g;!function(t){const n=e.useRect(),i=e.useOptions(),r=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(r),t.options=i,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),g=f,e.onTakeSnapshot((e=>{if(g)return g.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(g)return g.getViewState()}})),[g])}}}}));
29
29
  //# sourceMappingURL=sn-distplot.js.map