@nebula.js/sn-histogram 0.31.5 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-histogram v0.31.5
2
+ * @nebula.js/sn-histogram v0.32.0
3
3
  * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -35,9 +35,9 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,u,l,c,f,h=e.le
35
35
  * http://hammerjs.github.io/
36
36
  *
37
37
  * Copyright (c) 2016 Jorik Tangelder;
38
- * Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),u=Math.round,l=Math.abs,c=Date.now;function f(e,t,n){return setTimeout(v(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),m=p((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){d(S(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){d(S(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 _(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function q(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];q(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,R=E(t,"PointerEvent")!==i,O=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],F=["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){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,u=s?s.center:a.center,f=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(u,f),t.distance=$(u,f),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var h=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=l(h.x)>l(h.y)?h.x:h.y,t.scale=s?function(e,t){return $(t[0],t[1],F)/$(e[0],e[1],F)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,u=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(u>25||s.velocity===i)){var c=t.deltaX-s.deltaX,f=t.deltaY-s.deltaY,h=W(u,c,f);r=h.x,o=h.y,n=l(h.x)>l(h.y)?h.x:h.y,a=U(c,f),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var d=e.element;M(t.srcEvent.target,d)&&(d=t.srcEvent.target);t.target=d}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:c(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:u(n/t),y:u(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==I,s=q(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,z.apply(this,arguments)}function se(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier",!0)),[n,r]}y(ae,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=le,this.targetIds={},z.apply(this,arguments)}function fe(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=D(e.changedTouches),s=[],u=this.target;if(o=n.filter((function(e){return M(e.target,u)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[C(o.concat(s),"identifier",!0),s]:void 0}y(ce,z,{handler:function(e){var t=ue[e.type],n=fe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}});function he(){z.apply(this,arguments);var e=v(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function ge(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(he,z,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&ge.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var me=E(s.style,"touchAction"),ye=me!==i,ve="compute",be="auto",xe="manipulation",we="none",ke="pan-x",Me="pan-y",_e=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&_e[e]&&(this.manager.element.style[me]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(_(e,we))return we;var t=_(e,ke),n=_(e,Me);if(t&&n)return we;if(t||n)return t?ke:Me;if(_(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=_(r,we)&&!_e.none,o=_(r,Me)&&!_e["pan-y"],a=_(r,ke)&&!_e["pan-x"];if(i){var s=1===e.pointers.length,u=e.distance<2,l=e.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var qe=32;function De(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ee(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ae(e,t){var n=t.manager;return n?n.get(e):e}function Te(){De.apply(this,arguments)}function Ne(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Oe(){De.apply(this,arguments),this._timer=null,this._input=null}function Ie(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function je(e,t){return(t=t||{}).recognizers=x(t.recognizers,je.defaults.preset),new Fe(e,t)}De.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ae(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Ae(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ae(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Ae(e,this);var t=q(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=qe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=qe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Te,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:qe}}),y(Ne,Te,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&L&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Te.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=Ee(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Re,Te,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},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)}}),y(Oe,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return qe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),y(Ie,Te,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Pe,Te,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ne.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ee(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return qe},failTimeout:function(){return this._timer=f((function(){this.state=qe}),this.options.interval,this),qe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Re,{enable:!1},["rotate"]],[Pe,{direction:6}],[Ne,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},je.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||(R?ne:O?ce:N?he:J))(n,H),this.touchAction=new Se(this,this.options.touchAction),ze(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function ze(e,t){var n,r=e.element;r.style&&(d(e.options.cssProps,(function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof De)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(h(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(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=q(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return d(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return d(S(e),(function(e){t?n[e]&&n[e].splice(q(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(je,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:qe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Fe,Input:z,TouchAction:Se,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:he,SingleTouchInput:ae,Recognizer:De,AttrRecognizer:Te,Tap:Le,Pan:Ne,Swipe:Pe,Pinch:Re,Rotate:Ie,Press:Oe,on:w,off:k,each:d,merge:m,extend:g,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=je,e.exports?e.exports=je:t.Hammer=je}(window,document)}(xy);var wy=xy.exports;function ky(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var My={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o="center"===r?t:"* "+t,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style: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:case"top":case"bottom":n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),dir:i},e("span",{ref:this.alignToRef,style:a,title:o},o))}};function _y(){const e=vg();return e.renderer.prio(["canvas"]),e.use(my),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",by(e))};e.interaction("hammer",by(Hammer))}(wy)),e.use(ky),e.component("disclaimer",My),e}const Sy={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"}}]};const qy={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(qy);const Dy={version:"0.31.5",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:qy.AUTO,binCount:"",binSize:qy.BIN_SIZE,offset:qy.OFFSET,countDistinct:qy.COUNT_DISTINCT,binMode:qy.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Cy(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ay(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ty(){}var Ny=1/.7,Ry="\\s*([+-]?\\d+)\\s*",Oy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Iy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Py=/^#([0-9a-f]{3,8})$/,Ly=new RegExp("^rgb\\("+[Ry,Ry,Ry]+"\\)$"),jy=new RegExp("^rgb\\("+[Iy,Iy,Iy]+"\\)$"),Fy=new RegExp("^rgba\\("+[Ry,Ry,Ry,Oy]+"\\)$"),zy=new RegExp("^rgba\\("+[Iy,Iy,Iy,Oy]+"\\)$"),Hy=new RegExp("^hsl\\("+[Oy,Iy,Iy]+"\\)$"),By=new RegExp("^hsla\\("+[Oy,Iy,Iy,Oy]+"\\)$"),Vy={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 Wy(){return this.rgb().formatHex()}function Uy(){return this.rgb().formatRgb()}function $y(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Py.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Yy(t):3===n?new Jy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ky(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ky(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 Jy(t[1],t[2],t[3],1):(t=jy.exec(e))?new Jy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Fy.exec(e))?Ky(t[1],t[2],t[3],t[4]):(t=zy.exec(e))?Ky(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Hy.exec(e))?tv(t[1],t[2]/100,t[3]/100,1):(t=By.exec(e))?tv(t[1],t[2]/100,t[3]/100,t[4]):Vy.hasOwnProperty(e)?Yy(Vy[e]):"transparent"===e?new Jy(NaN,NaN,NaN,0):null}function Yy(e){return new Jy(e>>16&255,e>>8&255,255&e,1)}function Ky(e,t,n,r){return r<=0&&(e=t=n=NaN),new Jy(e,t,n,r)}function Xy(e){return e instanceof Ty||(e=$y(e)),e?new Jy((e=e.rgb()).r,e.g,e.b,e.opacity):new Jy}function Gy(e,t,n,r){return 1===arguments.length?Xy(e):new Jy(e,t,n,null==r?1:r)}function Jy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Zy(){return"#"+ev(this.r)+ev(this.g)+ev(this.b)}function Qy(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function ev(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function tv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new rv(e,t,n,r)}function nv(e){if(e instanceof rv)return new rv(e.h,e.s,e.l,e.opacity);if(e instanceof Ty||(e=$y(e)),!e)return new rv;if(e instanceof rv)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new rv(a,s,u,e.opacity)}function rv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function iv(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(Ty,$y,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Wy,formatHex:Wy,formatHsl:function(){return nv(this).formatHsl()},formatRgb:Uy,toString:Uy}),Ey(Jy,Gy,Ay(Ty,{brighter:function(e){return e=null==e?Ny:Math.pow(Ny,e),new Jy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Jy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Zy,formatHex:Zy,formatRgb:Qy,toString:Qy})),Ey(rv,(function(e,t,n,r){return 1===arguments.length?nv(e):new rv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return e=null==e?Ny:Math.pow(Ny,e),new rv(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new rv(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Jy(iv(e>=240?e-240:e+120,i,r),iv(e,i,r),iv(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var ov=Math.PI/180,av=180/Math.PI,sv=4/29,uv=6/29,lv=3*uv*uv;function cv(e){if(e instanceof fv)return new fv(e.l,e.a,e.b,e.opacity);if(e instanceof yv)return vv(e);e instanceof Jy||(e=Xy(e));var t,n,r=gv(e.r),i=gv(e.g),o=gv(e.b),a=hv((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=hv((.4360747*r+.3850649*i+.1430804*o)/.96422),n=hv((.0139322*r+.0971045*i+.7141733*o)/.82521)),new fv(116*a-16,500*(t-a),200*(a-n),e.opacity)}function fv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function hv(e){return e>.008856451679035631?Math.pow(e,1/3):e/lv+sv}function dv(e){return e>uv?e*e*e:lv*(e-sv)}function pv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function gv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mv(e){if(e instanceof yv)return new yv(e.h,e.c,e.l,e.opacity);if(e instanceof fv||(e=cv(e)),0===e.a&&0===e.b)return new yv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*av;return new yv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function yv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function vv(e){if(isNaN(e.h))return new fv(e.l,0,0,e.opacity);var t=e.h*ov;return new fv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function bv(e){return function(){return e}}function xv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):bv(isNaN(e)?t:e)}function wv(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function kv(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function Mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sv(e,t,n){return t&&_v(e.prototype,t),n&&_v(e,n),e}function qv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dv(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Cv(e,t){var n,r,i,o,a,s=new Nv(e),u=+e.value&&(s.value=e.value),l=[s];for(null==t&&(t=Ev);n=l.pop();)if(u&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)l.push(r=n.children[o]=new Nv(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Tv)}function Ev(e){return e.children}function Av(e){e.data=e.data.data}function Tv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Nv(e){this.data=e,this.depth=this.height=0,this.parent=null}Ey(fv,(function(e,t,n,r){return 1===arguments.length?cv(e):new fv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return new fv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new fv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 Jy(pv(3.1338561*(t=.96422*dv(t))-1.6168667*(e=1*dv(e))-.4906146*(n=.82521*dv(n))),pv(-.9787684*t+1.9161415*e+.033454*n),pv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ey(yv,(function(e,t,n,r){return 1===arguments.length?mv(e):new yv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return new yv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new yv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return vv(this).rgb()}})),function e(t){var n=function(e){return 1==(e=+e)?xv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):bv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Gy(e)).r,(t=Gy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=xv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Nv.prototype=Cv.prototype={constructor:Nv,count:function(){return this.eachAfter(Dv)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},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 Cv(this).eachBefore(Av)}};var Rv,Ov=(function(e){
38
+ * Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),u=Math.round,l=Math.abs,c=Date.now;function f(e,t,n){return setTimeout(v(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),m=p((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){d(S(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){d(S(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 _(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function q(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];q(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,R=E(t,"PointerEvent")!==i,O=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],F=["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){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,u=s?s.center:a.center,f=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(u,f),t.distance=$(u,f),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var h=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=l(h.x)>l(h.y)?h.x:h.y,t.scale=s?function(e,t){return $(t[0],t[1],F)/$(e[0],e[1],F)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,u=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(u>25||s.velocity===i)){var c=t.deltaX-s.deltaX,f=t.deltaY-s.deltaY,h=W(u,c,f);r=h.x,o=h.y,n=l(h.x)>l(h.y)?h.x:h.y,a=U(c,f),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var d=e.element;M(t.srcEvent.target,d)&&(d=t.srcEvent.target);t.target=d}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:c(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:u(n/t),y:u(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==I,s=q(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,z.apply(this,arguments)}function se(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier",!0)),[n,r]}y(ae,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=le,this.targetIds={},z.apply(this,arguments)}function fe(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=D(e.changedTouches),s=[],u=this.target;if(o=n.filter((function(e){return M(e.target,u)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[C(o.concat(s),"identifier",!0),s]:void 0}y(ce,z,{handler:function(e){var t=ue[e.type],n=fe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}});function he(){z.apply(this,arguments);var e=v(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function ge(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(he,z,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&ge.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var me=E(s.style,"touchAction"),ye=me!==i,ve="compute",be="auto",xe="manipulation",we="none",ke="pan-x",Me="pan-y",_e=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&_e[e]&&(this.manager.element.style[me]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(_(e,we))return we;var t=_(e,ke),n=_(e,Me);if(t&&n)return we;if(t||n)return t?ke:Me;if(_(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=_(r,we)&&!_e.none,o=_(r,Me)&&!_e["pan-y"],a=_(r,ke)&&!_e["pan-x"];if(i){var s=1===e.pointers.length,u=e.distance<2,l=e.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var qe=32;function De(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ee(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ae(e,t){var n=t.manager;return n?n.get(e):e}function Te(){De.apply(this,arguments)}function Ne(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Oe(){De.apply(this,arguments),this._timer=null,this._input=null}function Ie(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function je(e,t){return(t=t||{}).recognizers=x(t.recognizers,je.defaults.preset),new Fe(e,t)}De.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ae(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Ae(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ae(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Ae(e,this);var t=q(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=qe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=qe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Te,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:qe}}),y(Ne,Te,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&L&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Te.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=Ee(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Re,Te,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},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)}}),y(Oe,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return qe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),y(Ie,Te,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Pe,Te,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ne.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ee(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return qe},failTimeout:function(){return this._timer=f((function(){this.state=qe}),this.options.interval,this),qe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Re,{enable:!1},["rotate"]],[Pe,{direction:6}],[Ne,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},je.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||(R?ne:O?ce:N?he:J))(n,H),this.touchAction=new Se(this,this.options.touchAction),ze(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function ze(e,t){var n,r=e.element;r.style&&(d(e.options.cssProps,(function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof De)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(h(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(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=q(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return d(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return d(S(e),(function(e){t?n[e]&&n[e].splice(q(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(je,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:qe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Fe,Input:z,TouchAction:Se,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:he,SingleTouchInput:ae,Recognizer:De,AttrRecognizer:Te,Tap:Le,Pan:Ne,Swipe:Pe,Pinch:Re,Rotate:Ie,Press:Oe,on:w,off:k,each:d,merge:m,extend:g,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=je,e.exports?e.exports=je:t.Hammer=je}(window,document)}(xy);var wy=xy.exports;function ky(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var My={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o="center"===r?t:"* "+t,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style: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:case"top":case"bottom":n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),dir:i},e("span",{ref:this.alignToRef,style:a,title:o},o))}};function _y(){const e=vg();return e.renderer.prio(["canvas"]),e.use(my),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",by(e))};e.interaction("hammer",by(Hammer))}(wy)),e.use(ky),e.component("disclaimer",My),e}const Sy={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"}}]};const qy={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(qy);const Dy={version:"0.32.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:qy.AUTO,binCount:"",binSize:qy.BIN_SIZE,offset:qy.OFFSET,countDistinct:qy.COUNT_DISTINCT,binMode:qy.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Cy(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ay(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ty(){}var Ny=1/.7,Ry="\\s*([+-]?\\d+)\\s*",Oy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Iy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Py=/^#([0-9a-f]{3,8})$/,Ly=new RegExp("^rgb\\("+[Ry,Ry,Ry]+"\\)$"),jy=new RegExp("^rgb\\("+[Iy,Iy,Iy]+"\\)$"),Fy=new RegExp("^rgba\\("+[Ry,Ry,Ry,Oy]+"\\)$"),zy=new RegExp("^rgba\\("+[Iy,Iy,Iy,Oy]+"\\)$"),Hy=new RegExp("^hsl\\("+[Oy,Iy,Iy]+"\\)$"),By=new RegExp("^hsla\\("+[Oy,Iy,Iy,Oy]+"\\)$"),Vy={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 Wy(){return this.rgb().formatHex()}function Uy(){return this.rgb().formatRgb()}function $y(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Py.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Yy(t):3===n?new Jy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ky(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ky(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 Jy(t[1],t[2],t[3],1):(t=jy.exec(e))?new Jy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Fy.exec(e))?Ky(t[1],t[2],t[3],t[4]):(t=zy.exec(e))?Ky(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Hy.exec(e))?tv(t[1],t[2]/100,t[3]/100,1):(t=By.exec(e))?tv(t[1],t[2]/100,t[3]/100,t[4]):Vy.hasOwnProperty(e)?Yy(Vy[e]):"transparent"===e?new Jy(NaN,NaN,NaN,0):null}function Yy(e){return new Jy(e>>16&255,e>>8&255,255&e,1)}function Ky(e,t,n,r){return r<=0&&(e=t=n=NaN),new Jy(e,t,n,r)}function Xy(e){return e instanceof Ty||(e=$y(e)),e?new Jy((e=e.rgb()).r,e.g,e.b,e.opacity):new Jy}function Gy(e,t,n,r){return 1===arguments.length?Xy(e):new Jy(e,t,n,null==r?1:r)}function Jy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Zy(){return"#"+ev(this.r)+ev(this.g)+ev(this.b)}function Qy(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function ev(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function tv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new rv(e,t,n,r)}function nv(e){if(e instanceof rv)return new rv(e.h,e.s,e.l,e.opacity);if(e instanceof Ty||(e=$y(e)),!e)return new rv;if(e instanceof rv)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new rv(a,s,u,e.opacity)}function rv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function iv(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(Ty,$y,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Wy,formatHex:Wy,formatHsl:function(){return nv(this).formatHsl()},formatRgb:Uy,toString:Uy}),Ey(Jy,Gy,Ay(Ty,{brighter:function(e){return e=null==e?Ny:Math.pow(Ny,e),new Jy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Jy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Zy,formatHex:Zy,formatRgb:Qy,toString:Qy})),Ey(rv,(function(e,t,n,r){return 1===arguments.length?nv(e):new rv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return e=null==e?Ny:Math.pow(Ny,e),new rv(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new rv(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Jy(iv(e>=240?e-240:e+120,i,r),iv(e,i,r),iv(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var ov=Math.PI/180,av=180/Math.PI,sv=4/29,uv=6/29,lv=3*uv*uv;function cv(e){if(e instanceof fv)return new fv(e.l,e.a,e.b,e.opacity);if(e instanceof yv)return vv(e);e instanceof Jy||(e=Xy(e));var t,n,r=gv(e.r),i=gv(e.g),o=gv(e.b),a=hv((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=hv((.4360747*r+.3850649*i+.1430804*o)/.96422),n=hv((.0139322*r+.0971045*i+.7141733*o)/.82521)),new fv(116*a-16,500*(t-a),200*(a-n),e.opacity)}function fv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function hv(e){return e>.008856451679035631?Math.pow(e,1/3):e/lv+sv}function dv(e){return e>uv?e*e*e:lv*(e-sv)}function pv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function gv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mv(e){if(e instanceof yv)return new yv(e.h,e.c,e.l,e.opacity);if(e instanceof fv||(e=cv(e)),0===e.a&&0===e.b)return new yv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*av;return new yv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function yv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function vv(e){if(isNaN(e.h))return new fv(e.l,0,0,e.opacity);var t=e.h*ov;return new fv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function bv(e){return function(){return e}}function xv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):bv(isNaN(e)?t:e)}function wv(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function kv(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function Mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sv(e,t,n){return t&&_v(e.prototype,t),n&&_v(e,n),e}function qv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dv(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Cv(e,t){var n,r,i,o,a,s=new Nv(e),u=+e.value&&(s.value=e.value),l=[s];for(null==t&&(t=Ev);n=l.pop();)if(u&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)l.push(r=n.children[o]=new Nv(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Tv)}function Ev(e){return e.children}function Av(e){e.data=e.data.data}function Tv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Nv(e){this.data=e,this.depth=this.height=0,this.parent=null}Ey(fv,(function(e,t,n,r){return 1===arguments.length?cv(e):new fv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return new fv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new fv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 Jy(pv(3.1338561*(t=.96422*dv(t))-1.6168667*(e=1*dv(e))-.4906146*(n=.82521*dv(n))),pv(-.9787684*t+1.9161415*e+.033454*n),pv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ey(yv,(function(e,t,n,r){return 1===arguments.length?mv(e):new yv(e,t,n,null==r?1:r)}),Ay(Ty,{brighter:function(e){return new yv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new yv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return vv(this).rgb()}})),function e(t){var n=function(e){return 1==(e=+e)?xv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):bv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Gy(e)).r,(t=Gy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=xv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Nv.prototype=Cv.prototype={constructor:Nv,count:function(){return this.eachAfter(Dv)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},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 Cv(this).eachBefore(Av)}};var Rv,Ov=(function(e){
39
39
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
40
40
  e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,u,l,c,f,h=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(l=t.split("."))[1]||l[1]&&l[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;l[0].length<e[0].length-a;)l[0]="0"+l[0];else 0==+l[0]&&(l[0]="");if((t=t.split("."))[0]=l[0],u=c[1]&&c[c.length-1].length){for(g="",y=(f=t[0]).length%u,h=f.length,b=0;b<h;b++)g+=f.charAt(b),!((b-y+1)%u)&&b<h-u&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}(Rv={exports:{}}),Rv.exports);function Iv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Pv={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"},Lv=/%$/,jv=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Fv=/^\(oct\)/i,zv=/^\(dec\)/i,Hv=/^\(hex\)/i,Bv=/^\(bin\)/i,Vv=/^\(rom\)/i,Wv=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Uv=/#|0/g;function $v(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Yv(e,t,n){var r=Iv(e);return n?r:new RegExp(r||"",t)}function Kv(e,t,n){var r,i,o,a,s,u,l,c,f,h,d,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),h=t,(d=n)&&(d=Iv(d)),h&&(h=Iv(h)),f=new RegExp("(?:[#0]+".concat(h,")?[#0]+(?:").concat(d,"[#0]+)?")),a=(o=(o=p.match(f))?o[0]:"")?p.substr(0,p.indexOf(o)):p,s=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(o=o.replace(Yv(u,"g"),t)),l=n,n=".",l&&(o=o.replace(Yv(l,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var g,m=p.split(l);m[1]&&(g=m[1].match(Uv)),e.prefix=a||"",e.postfix=s||"",e.pattern=p,e.maxPrecision=g?g.length:2,e.percentage=Lv.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(Yv(t,null,!0),"|").concat(Yv(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=l,e.t=t,e.d=n,e.temp=c}!function(){function e(t,n,r,i,o){Mv(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Pv;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}Sv(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Wv.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Wv.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Wv.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||Kv(r.positive,t,n),r.negative&&!r.negative.isFunctional&&Kv(r.negative,t,n),r.zero&&!r.zero.isFunctional&&Kv(r.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,u,l,c=this._prepared,f="",h="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return jv.test(t)?e=$v(e,Number(/\d{2}/.exec(t)[0]),t,n):Fv.test(t)?e=$v(e,8,t,n):zv.test(t)?e=$v(e,10,t,n):Hv.test(t)?e=$v(e,16,t,n):Bv.test(t)?e=$v(e,2,t,n):Vv.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,g,m=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=m[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<m.length;)y=m[++s];s>0&&(p=m[s-1]),p&&n>0&&p>0?g=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?g=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(g=p)),g&&(f=this.abbreviations[g],e/=Math.pow(10,g))}if(r=Math.abs(e),t=c.temp,l=(u=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,l||"#"!==u.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,l?l.length:0)).split(".")[0]),b=u.split(o)[0];if(e=Ov(b+=o,v)||"0",l){var x=Math.max(0,Math.min(14,l.length)),w=l.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(u+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)u+="#";e=Ov(u,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+h+f+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var Xv=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Gv=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Jv=["January","February","March","April","May","June","July","August","September","October","November","December"],Zv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Qv(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function eb(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,r){Mv(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Xv,qDayNames:Gv,qLongMonthNames:Jv,qMonthNames:Zv}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(qv(i={},"T",o.qTimeFmt||"hh:mm:ss"),qv(i,"D",o.qDateFmt||"YYYY-MM-DD"),qv(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}Sv(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(r=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=r.getUTCDay()-1)<0&&(a=6),n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:a,date:r.getUTCDate(),h:o,m:r.getUTCMinutes(),s:r.getUTCSeconds(),f:r.getUTCMilliseconds(),t:r.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,r=function(e){var t=e,n=24*eb(t),r=60*eb(n),i=60*eb(r),o=1e3*eb(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,u=r.f,l=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(l=n?n.getDay()-1:0)<0&&(l=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:l,date:i,h:o,m:a,s:s,f:u,t:c}}(e,t));var u=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Qv("".concat(t.year).slice(-2),2),YYY:Qv("".concat(t.year).slice(-3),3),def:function(e){return Qv("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Qv("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Qv("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Qv("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Qv("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Qv("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Qv("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),l=[];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&l.push(c);var f=new RegExp(l.join("|"),"g");return t.replace(f,(function(e){var t,n,r;for(n in u)if(Object.prototype.hasOwnProperty.call(u,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in u[n])if(i===e||i.toLowerCase()===e){void 0===(r=u[n][i])&&(r=u[n][i.toLowerCase()]);break}return void 0===r&&(r=u[n].def),"function"==typeof r&&(r=r(e)),r}))}}])}();var tb=Object.prototype.hasOwnProperty,nb=Object.prototype.toString,rb=Object.defineProperty,ib=Object.getOwnPropertyDescriptor,ob=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===nb.call(e)},ab=function(e){if(!e||"[object Object]"!==nb.call(e))return!1;var t,n=tb.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&tb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||tb.call(e,t)},sb=function(e,t){rb&&"__proto__"===t.name?rb(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ub=function(e,t){if("__proto__"===t){if(!tb.call(e,t))return;if(ib)return ib(e,t).value}return e[t]},lb=function e(){var t,n,r,i,o,a,s=arguments[0],u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});u<l;++u)if(null!=(t=arguments[u]))for(n in t)r=ub(s,n),s!==(i=ub(t,n))&&(c&&i&&(ab(i)||(o=ob(i)))?(o?(o=!1,a=r&&ob(r)?r:[]):a=r&&ab(r)?r:{},sb(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&sb(s,{name:n,newValue:i}));return s};const cb=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,fb=function(){};fb.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&cb.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const hb={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 db(){return hb.id()}const pb="scrollbar";function gb(e,t,n){return"y"===e?mb(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function mb(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var yb={getAxisDock:gb,getOppositeAxisDock:function(e,t,n){return gb(e,"far"===t?"near":"far",n)},getYAxisDock:mb};const vb=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),bb=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),xb=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function wb(e){return vb.test(e)}function kb(e){return bb.test(e)||xb.test(e)}var Mb={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],wb(r))return"ltr";if(kb(r))return"rtl"}return"ltr"}};var _b={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return lb(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),lb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Mb.lrm}(${n})${Mb.lrm}`:`${Mb.lrm}(${n})${Mb.lrm}`:!1!==e.showLabel?t:""}};const Sb={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:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:-10},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}}};Sb.DEFAULT_CHART_ORIENTATION=Sb.HORIZONTAL;function qb(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Sb.DEFAULT_CHART_ORIENTATION,a=o===Sb.HORIZONTAL,s=a?"x":"y",u=a?"y":"x",l=Sb.SHOW_AXIS_LABELS_OPTIONS,c=Sb.SHOW_TITLE_OPTIONS,f=l.includes(r.show),h=!!n.measureTitleText&&c.includes(r.show),d=n.includeDimensionAxis&&l.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(f&&function(e,t,n,r){let i={scale:"measure",forceBounds:r&&!r.autoMinMax&&r.showBounds};i=lb(i,Sb.LAYOUTSETTINGS.measureAxis);const o=Cb(t,n);e.addComponent(n+"-axis",i,o)}(e,n,s,r),h&&function(e,t,n){let r={text:t.measureTitleText};r=lb(r,Sb.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Cb(e,t)}(t,n);e.addComponent(n+"-axis-title",r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=lb(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),d&&function(e,t,n){let r={scale:"dimension"};r=lb(r,Sb.LAYOUTSETTINGS.dimensionAxis);const i=Eb(t,n);lb(!0,r,t.dimensionAxisSettings||{}),e.addComponent(n+"-axis",r,i)}(e,n,u),p&&function(e,t,n){let r={text:t.dimensionTitleText};r=lb(r,Sb.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Eb(e,t)}(t,n);e.addComponent(n+"-axis-title",r,i)}(e,n,u),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Sb.HORIZONTAL?Sb.VERTICAL:Sb.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=lb(r,Sb.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){e.getSettings().scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const i={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},o=lb({},Sb.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",o,i),Db(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===pb))}return[{type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(pb).emit("tap",e)}}},{type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(pb).emit("panStart",e)},pan(e){this.chart.component(pb).emit("panMove",e)},panend(e){this.chart.component(pb).emit("panEnd",e)},pancancel(e){this.chart.component(pb).emit("panCancel",e)}}}]}(n.isNavigationEnabledFn))}(e,y,n,a),m&&function(e,t,n,r){const i=yb.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=lb(o,Sb.LAYOUTSETTINGS.refLines);let a={key:"ref-line-labels-"+db(),require:["renderer","chart"],dock:yb.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?" "+n:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=lb(a,Sb.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,u=lb(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),l=_b.lineSettings({scale:"measure",dir:n,value:s},u);o.lines[n].push(l);const c=_b.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},u);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Sb.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=lb(o,Sb.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,Eb(n,u).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=lb(o,Sb.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,Cb(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=lb(o,Sb.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,Eb(n,u).dock,n.isRtl)}n.brushActions&&Db(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Db(e,t){t.forEach((t=>{e.push(t)}))}function Cb(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Eb(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Ab(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return lb(!0,{},o,e||{})}function Tb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),u=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),f=t.theme.getStyle(n,"axis.title","fontFamily"),h=t.theme.getStyle(n,"axis.label.name","fontFamily"),d={key:"axis",type:"axis",dock:yb.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:f,fill:u},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:l,fontSize:c,fontFamily:h,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}};return lb(!0,{},d,e||{})}function Nb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.title","fontFamily"),l={key:"text",type:"text",dock:yb.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:u,fill:s}}};return lb(!0,{},l,e||{})}Ab.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=Ab(lb(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Ab.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 Ab(lb(!0,n,e||{}),t)},Tb.xAxis=function(e,t){return Tb(lb(!0,{key:"x-axis",scale:"x"},e||{}),t)},Tb.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:yb.getYAxisDock(n,r)};return Tb(lb(!0,i,e||{}),t)},Nb.xAxisTitle=function(e,t){return Nb(lb(!0,{key:"x-axis-title"},e||{}),t)},Nb.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:yb.getYAxisDock(n,r)||"left"};return Nb(lb(!0,i,e||{}),t)};var Rb={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push("@"+e),t&&n.push("@"+t),n.length&&(r=n.join(",")),r}};const Ob={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 Ib(){return Ob}function Pb(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}Ib.getLayoutModeKeys=function(){const e=[];let t;for(t in Ob)e.push(t);return e};const Lb={left:"left",right:"right",up:"top",down:"bottom"};function jb(e,t,n){switch(e){case"scale":return Ab(t,n);case"measure-scale":return Ab.measureScale(t,n);case"dimension-scale":return Ab.dimensionScale(t,n);case"axis":return Tb(t,n);case"box-marker":return function(e){return lb(!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 lb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return lb(!0,{},o,e||{})}(t,n);case"text":return Nb(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),lb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,u=t&&t.isRtl,l={type:"brush-range",key:"range",displayOrder:99,dock:Rb.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Rb.getBublesAlign(a,s,u)}}};return lb(!0,{},l,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,u=t&&t.dock,l=t&&t.isRtl,c=t&&t.chartInstance;let f=!0;const h={type:"brush-area-dir",key:"area",displayOrder:99,dock:Rb.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Rb.getBublesAlign(s,u,l),label:e=>f?(f=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(f=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{h.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),lb(!0,{},h,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),u=t.theme.getStyle(n,"legend.label","color"),l=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),f={key:"legend",type:"legend-cat",dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon","lui-icon--triangle-"+Lb[t.direction]].join(" ")})}}},style:{item:{label:{fontSize:l,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:u,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(l,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return lb(!0,{},f,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),u=t.theme.getStyle(n,"legend.label","color"),l=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function f(e){switch(e){case"left":return 0;case"right":return 1;case"middle":default:return.5}}const h={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:f(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:u,fontSize:l,fontFamily:c}}};return lb(!0,{},h,e)}(t,n);case"x-axis":return Tb.xAxis(t,n);case"y-axis":return Tb.yAxis(t,n);case"x-axis-title":return Nb.xAxisTitle(t,n);case"y-axis-title":return Nb.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return lb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return lb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return lb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return lb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o={key:"labels",type:"labels",displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:t.theme.getStyle(n,"label.value","fontFamily"),fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Pb}]}}}]}};return lb(!0,{},o,e||{})}(t,n);default:return}}function Fb(e){this.options=e||{},this.settings={dockLayout:{layoutModes:Ib()},components:[],scales:{}}}Fb.prototype.addComponent=function(e,t,n){const r=jb(e,t,lb(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Fb.prototype.addInteraction=function(e,t){const n=jb("interaction",e,lb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Fb.prototype.addScale=function(e,t,n){const r=jb(e,t,lb(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Fb.prototype.getSettings=function(){return this.settings},Fb.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Fb.prototype.addPreset=function(e,t){!function(e,t,n){switch(e){case"dimension-measure-chart":qb(t,n);break;default:throw Error("There is no chart preset with that type")}}(e,this,t)},Fb.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))},Fb.create=function(e){return new Fb(e)},Fb.createComponent=jb;const zb={CENTER:0,BOTTOM:1};var Hb={DISCLAIMERS:[{label:"NoDataExist",alignment:zb.CENTER,default:!0},{label:"RequireNumericDimension",alignment:zb.CENTER,default:!1},{label:"OnlyNanData",alignment:zb.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:zb.CENTER,default:!1},{label:"LimitedData",alignment:zb.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:zb.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:zb.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:zb.BOTTOM,default:!1}],ALIGNMENT:zb};const Bb={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Hb.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Vb(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Wb(e,t){return e&&t&&t[e]}function Ub(e){this.environment=e,this.clear()}Vb.prototype.isValidAndSupported=function(e,t){return Wb(e.label,this.dataAttributes)&&(e.default||Wb(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Vb.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},Vb.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=t.get("Object.Disclaimer."+i.label)+" ")})),n},Ub.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Ub._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Ub.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=lb(!0,{},this.vizAttributes.supportedDisclaimers),i=new Vb(Hb.DISCLAIMERS,this.dataAttributes,r);let o,a;if(i.isAnyValidDisclaimer(Hb.ALIGNMENT.CENTER))o=i.getMessage(Hb.ALIGNMENT.CENTER,n),a="center";else{if(!i.isAnyValidDisclaimer(Hb.ALIGNMENT.BOTTOM))return;o=i.getMessage(Hb.ALIGNMENT.BOTTOM,n),a="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:a},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Ub.prototype.set=function(e){if(this.clear(),!e)throw new Error(Ub.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Bb.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Ub.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const $b=fb.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Ub(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:[Fb.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};switch(t.qMode){case"K":r="qStackedDataPages";break;case"S":default:r="qDataPages"}return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Fb.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=lb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:wv(e,t.replace(/\//g,"."))})));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var Yb={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(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 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)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=l()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function f(e,t){return p(e)||m(e,t)||y(e,t)||x()}function h(e){return d(e)||g(e)||y(e)||b()}function d(e){if(Array.isArray(e))return v(e)}function p(e){if(Array.isArray(e))return e}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}function y(e,t){if(e){if("string"==typeof e)return v(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)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){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 x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var w=Object.prototype.hasOwnProperty,k=Object.prototype.toString,M=Object.defineProperty,_=Object.getOwnPropertyDescriptor,S=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===k.call(e)},q=function(e){if(!e||"[object Object]"!==k.call(e))return!1;var t,n=w.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&w.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||w.call(e,t)},D=function(e,t){M&&"__proto__"===t.name?M(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},C=function(e,t){if("__proto__"===t){if(!w.call(e,t))return;if(_)return _(e,t).value}return e[t]},E=function e(){var t,n,r,i,o,a,s=arguments[0],u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});u<l;++u)if(null!=(t=arguments[u]))for(n in t)r=C(s,n),s!==(i=C(t,n))&&(c&&i&&(q(i)||(o=S(i)))?(o?(o=!1,a=r&&S(r)?r:[]):a=r&&q(r)?r:{},D(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&D(s,{name:n,newValue:i}));return s};function A(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var u=0;u<r.wrappedFields.length;u++)if(s=r.wrappedFields[u].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[u].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=u;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function T(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function N(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,u=e.sourceKey,l=e.target,c=e.targetProp,f=r;if(i.field&&i.field!==n){var h=A(i.field,o,{cache:t});if(-1===h)return;f=E({qRow:a},h(s))}l[c]=T(i,f,{key:u})}function R(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){for(var u=t.raw(),l=t.key(),c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),f=i.normalizeConfig(o[s],t),d=f.props,p=f.main,g=Object.keys(d),m=!!o[s].trackBy,y=r(o[s].trackBy),v={},b=[],x=[],w=0;w<u.qDataPages.length;w++){var k=A(c,u.qDataPages[w],{cache:n});if(-1!==k)for(var M=0;M<u.qDataPages[w].qMatrix.length;M++){var _=u.qDataPages[w].qArea.qTop+M,S=E({qRow:_},k(u.qDataPages[w].qMatrix[M])),q=T(p,S,{key:l});if(!p.filter||p.filter(S)){for(var D=0;D<g.length;D++){var C=d[g[D]],R=C.fields||[C];C.fields&&(q[g[D]]=[]);for(var O=0;O<R.length;O++)N({cache:n,f:c,mainCell:S,p:R[O],prop:g[D],props:d,page:u.qDataPages[w],rowIdx:_,row:u.qDataPages[w].qMatrix[M],sourceKey:l,target:C.fields?q[g[D]]:q,targetProp:C.fields?O:g[D]});if(C.fields){var I=q[g[D]].map((function(e){return e.value})),P=q[g[D]].map((function(e){return e.label}));q[g[D]]={value:"function"==typeof C.value?C.value(I):void 0!==C.value?C.value:I,label:"function"==typeof C.label?C.label(P):void 0!==C.label?String(C.label):String(q[g[D]].value)}}}m&&i.track({cfg:o[s],itemData:S,obj:q,target:b,tracker:v,trackType:y}),x.push(q)}}}var L=m?i.collect(b,{main:p,propsArr:g,props:d}):x;a=[].concat(h(a),h(L))}return a}function O(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function I(){return this.eachAfter(O)}function P(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this}function L(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this}function j(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this}function F(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function z(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function H(e){for(var t=this,n=B(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function B(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function V(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function W(){var e=[];return this.each((function(t){e.push(t)})),e}function U(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function $(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function Y(e,t){var n,r,i,o,a,s=new Z(e),u=+e.value&&(s.value=e.value),l=[s];for(null==t&&(t=X);n=l.pop();)if(u&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)l.push(r=n.children[o]=new Z(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(J)}function K(){return Y(this).eachBefore(G)}function X(e){return e.children}function G(e){e.data=e.data.data}function J(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Z(e){this.data=e,this.depth=this.height=0,this.parent=null}function Q(e){if("function"!=typeof e)throw new Error;return e}Z.prototype=Y.prototype={constructor:Z,count:I,each:P,eachAfter:j,eachBefore:L,sum:F,sort:z,path:H,ancestors:V,descendants:W,leaves:U,links:$,copy:K};var ee="$",te={depth:-1},ne={};function re(e){return e.id}function ie(e){return e.parentId}function oe(){var e=re,t=ie;function n(n){var r,i,o,a,s,u,l,c=n.length,f=new Array(c),h={};for(i=0;i<c;++i)r=n[i],s=f[i]=new Z(r),null!=(u=e(r,i,n))&&(u+="")&&(h[l=ee+(s.id=u)]=l in h?ne:s);for(i=0;i<c;++i)if(s=f[i],null!=(u=t(n[i],i,n))&&(u+="")){if(!(a=h[ee+u]))throw new Error("missing: "+u);if(a===ne)throw new Error("ambiguous: "+u);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=te,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(J),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Q(t),n):e},n.parentId=function(e){return arguments.length?(t=Q(e),n):t},n}function ae(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var u=ae(n,i[s]);Array.isArray(u)?a.push.apply(a,h(u)):a.push(u)}return a}if(!r[o]&&Array.isArray(i)){var l=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)l[c]=ae(n,i[c]);return l}r[o]in i&&(i=i[r[o]])}return i}function se(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,h(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,h(se(e[o].children,t-1,n)));return r}function ue(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return se(e.children,i-1,n)}}return!1}function le(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var ce=/^qDimensionInfo(?:\/(\d+))?/,fe=/^\/?qMeasureInfo\/(\d+)/,he=/\/qAttrExprInfo\/(\d+)/,de=/\/qAttrDimInfo\/(\d+)/;function pe(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}function ge(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function me(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,u=-1,l=-1,c=r,f=n.qEffectiveInterColumnSortOrder,h=ge(n);return ce.test(c)&&(i=!0,o=+ce.exec(c)[1],c=r.replace(ce,"")),fe.test(c)&&("K"===n.qMode?u=+fe.exec(c)[1]:f&&-1!==f.indexOf(-1)?(u=+fe.exec(c)[1],l=0):l=+fe.exec(c)[1],c=c.replace(fe,"")),c&&(de.exec(c)?s=+de.exec(c)[1]:he.exec(c)&&(a=+he.exec(c)[1])),{fieldDepth:(i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1))+1,pseudoMeasureIndex:u,measureIdx:l,attrDimIdx:s,attrIdx:a}}function ye(e,t){var n,r,i=ue(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(e){var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ve(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function be(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var u=n[t[s]],l=u.fields||[u],c=void 0,f=void 0;u.fields&&(c=[],f=[]);for(var h=function(e){var n=l[e],h=void 0,d=void 0,p=void 0,g=void 0,m=void 0,y=void 0;if("primitive"===n.type?(p=n.value,y=String(n.value)):("function"==typeof n.value&&(h=function(e){return n.value(e,r)}),"function"==typeof n.label&&(d=function(e){return n.label(e,r)}),n.accessor?(g=n.accessor(r),Array.isArray(g)?(m=g.map(n.valueAccessor),n.attrAccessor&&(m=m.map(n.attrAccessor)),h&&(p=m.map(h),h=null),d&&(y=m.map(d),d=null),p=n.reduce?n.reduce(p):p,y=n.reduceLabel?n.reduceLabel(y,p):String(p)):y=p=n.attrAccessor?n.attrAccessor(n.valueAccessor(g)):n.valueAccessor(g)):(p=i,y=i)),u.fields){var v=h?h(p):p;c.push(v),f.push(d&&null!=y?d(y):null!=y?y:String(v))}else{var b=h?h(p):p;o[t[s]]={value:b,label:d?d(y):null!=y?y:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},d=0;d<l.length;d++)h(d);c&&(o[t[s]]={value:"function"==typeof u.value?u.value(c,r):c,label:"function"==typeof u.label?u.label(f,r):f})}}var xe=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ae(r,e);return o&&o[0]?(t.tree=Y(o[0],n.children||function(e){return e[i]}),t.tree):null};function we(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=pe(e),i=e.fields(),o=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),a=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),s={__root:{__id:"__root",qValues:[]}},u=0;u<t.length;u++){for(var l=t[u],c="__root",f=!1,h=0;h<o.length;h++){var d,p=l[o[h]],g="".concat(c,"__").concat(null!==(d=p.qElemNumber)&&void 0!==d?d:p.qElemNo);s[g]||(s[g]=n({__id:g,__parent:c,qValues:[]},p),f=!0),c=g}if(f)for(var m=0;m<a.length;m++){var y=l[a[m]];s[c].qValues.push(y)}}var v=Object.keys(s).map((function(e){return s[e]}));return oe().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(v)}var ke=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var u=n[t[s]],l=u.fields?u.fields:[u],c=0;c<l.length;c++){var f=l[c];if(f.field!==a){var h=ye(o,me(f.field,{cube:r,cache:i}));f.accessor=h.nodeFn,f.valueAccessor=h.valueFn,f.attrAccessor=h.attrFn}}};function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t.raw(),a=t.key(),s="S"===o.qMode?we(t):xe(o,r,e);if(!s)return null;for(var u=s.height,l=[],c=0;c<=u;c++){var f=null;if(c>0)if("S"===o.qMode){var h=ge(o)[c-1];f=r.fields[h]}else{var d=o.qEffectiveInterColumnSortOrder[c-1];c>o.qEffectiveInterColumnSortOrder.length&&(d=o.qDimensionInfo.length),f=r.fields[d]}var p=i.normalizeConfig(n(n({},e),{},{field:f?f.key():void 0}),t),g=p.props,m=p.main,y=Object.keys(g);l[c]={propsArr:y,props:g,main:m};var v=f?me(f,{cube:o,cache:r}):{fieldDepth:0};ke({propsArr:y,props:g,cube:o,cache:r,itemDepthObject:v,f:f})}for(var b=s.copy().descendants(),x=s.descendants(),w=0;w<x.length;w++){var k=l[x[w].depth].propsArr,M=l[x[w].depth].props,_=l[x[w].depth].main,S=b[w],q=S.data,D=ve(_,q,{key:a});be({propsArr:k,props:M,item:S,itemData:q,ret:D,sourceKey:a,isTree:!0}),x[w].data=D}return s}function _e(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){var u=t.raw(),l=t.key();if(!xe(u,n,e))continue;var c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),f=i.normalizeConfig(o[s],t),d=f.props,p=f.main,g=Object.keys(d),m=me(c,{cube:u,cache:n}),y=ye({fieldDepth:0},m),v=y.nodeFn,b=y.attrFn,x=y.valueFn;ke({propsArr:g,props:d,cube:u,cache:n,itemDepthObject:m,f:c});for(var w=!!o[s].trackBy,k=r(o[s].trackBy),M={},_=[],S=v(n.tree),q=[],D=0;D<S.length;D++){var C=S[D],E=b?b(x(C)):x(C);if(!p.filter||p.filter(E)){var A=ve(p,E,{key:l});be({propsArr:g,props:d,item:C,itemData:E,ret:A,sourceKey:l}),w&&i.track({cfg:o[s],itemData:E,obj:A,target:_,tracker:M,trackType:k}),q.push(A)}}var T=w?i.collect(_,{main:p,propsArr:g,props:d}):q;a=[].concat(h(a),h(T))}return a}function Se(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 qe=Se((function(e){
41
41
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
42
- !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,u,l,c,f,h=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(l=t.split("."))[1]||l[1]&&l[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;l[0].length<e[0].length-a;)l[0]="0"+l[0];else 0==+l[0]&&(l[0]="");if((t=t.split("."))[0]=l[0],u=c[1]&&c[c.length-1].length){for(g="",y=(f=t[0]).length%u,h=f.length,b=0;b<h;b++)g+=f.charAt(b),!((b-y+1)%u)&&b<h-u&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));function De(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Ce={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"},Ee=/%$/,Ae=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Te=/^\(oct\)/i,Ne=/^\(dec\)/i,Re=/^\(hex\)/i,Oe=/^\(bin\)/i,Ie=/^\(rom\)/i,Pe=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Le=/#|0/g;function je(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Fe(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function ze(e,t,n){var r;return Ae.test(t)?e=je(e,Number(/\d{2}/.exec(t)[0]),t,n):Te.test(t)?e=je(e,8,t,n):Ne.test(t)?e=je(e,10,t,n):Re.test(t)?e=je(e,16,t,n):Oe.test(t)?e=je(e,2,t,n):Ie.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Fe(e,t)):t+r+e.toExponential(0)),e}function He(e,t,n){var r=De(e);return n?r:new RegExp(r||"",t)}function Be(e,t){return t&&(t=De(t)),e&&(e=De(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Ve(e,t){if(!e||!e.qNumericalAbbreviation)return Ce;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function We(e,t,n,r){var i,o,a,s,u,l,c,f,h,d=e.pattern;r&&(e.abbreviate=!0),h=Be(t,n),s=(a=(a=d.match(h))?a[0]:"")?d.substr(0,d.indexOf(a)):d,u=a?d.substring(d.indexOf(a)+a.length):"",a||(a=d?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(a=a.replace(He(l,"g"),t)),c=n,n=".",c&&(a=a.replace(He(c,"g"),n)),f=(f=a.match(/#/g))?f.length:0;var p,g=d.split(c);g[1]&&(p=g[1].match(Le)),e.prefix=s||"",e.postfix=u||"",e.pattern=d,e.maxPrecision=p?p.length:2,e.percentage=Ee.test(d),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(He(t,null,!0),"|").concat(He(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=c,e.t=t,e.d=n,e.temp=f}var Ue=function(){function e(t,n,r,o,a){i(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=o||".",this.type=a||"numeric",this.patternSeparator=";",this.abbreviations=Ve(t,this.patternSeparator),this.prepare()}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Pe.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Pe.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Pe.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||We(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&We(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&We(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,u,l,c=this._prepared,f="",h="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=ze(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,g,m=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=m[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<m.length;)y=m[++s];s>0&&(p=m[s-1]),p&&n>0&&p>0?g=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?g=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(g=p)),g&&(f=this.abbreviations[g],e/=Math.pow(10,g))}if(r=Math.abs(e),t=c.temp,l=(u=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,l||"#"!==u.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,l?l.length:0)).split(".")[0]),b=u.split(o)[0];if(e=qe(b+=o,v)||"0",l){var x=Math.max(0,Math.min(14,l.length)),w=l.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(u+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)u+="#";e=qe(u,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+h+f+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function $e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(Ue,t)}function Ye(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,u=r.toKey,l=void 0===u?function(e){return e}:u,c=Object.create(null),f=Object.create(null),h=0,d=0;return(t=s?function(){return n=l.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=l(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return h>=o&&(delete c[f[d]],delete f[d],h--,d++),c[e]=t,f[h]=e,h++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),f=Object.create(null),h=0,d=0},t.size=function(){return h},t}function Ke(e,t,n,r,i){var o=$e(i,e,t,n,r),a=Ye(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Xe={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ge=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ze=["January","February","March","April","May","June","July","August","September","October","November","December"],Qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],et=86400;function tt(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function nt(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function rt(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function it(e){var t=e,n=24*rt(t),r=60*rt(n),i=60*rt(r),o=1e3*rt(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function ot(e,t){var n,r=it(e),i=r.d,o=r.h,a=r.m,s=r.s,u=r.f,l=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(et*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(l=n?n.getDay()-1:0)<0&&(l=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:l,date:i,h:o,m:a,s:s,f:u,t:c}}function at(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:tt("".concat(t.year).slice(-2),2),YYY:tt("".concat(t.year).slice(-3),3),def:function(e){return tt("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:tt("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:tt("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return tt("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return tt("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return tt("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return tt("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length)}}}}var st=function(){function e(t,n,r){i(this,e);var o,a=t||{};a.qCalendarStrings||(a.qCalendarStrings={qLongDayNames:Ge,qDayNames:Je,qLongMonthNames:Ze,qMonthNames:Qe}),this.localeInfo=a,this.locale_days=a.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=a.qCalendarStrings.qDayNames.slice(),this.locale_months=a.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=a.qCalendarStrings.qMonthNames.slice(),n||(n=(s(o={},Xe.TIME,a.qTimeFmt||"hh:mm:ss"),s(o,Xe.DATE,a.qDateFmt||"YYYY-MM-DD"),s(o,Xe.DATE_TIME,a.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),o)[r]),this.pattern=n}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=nt(e,r):(e<0&&(e=-e,t="-".concat(t)),n=ot(e,t));var i=at(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g");return t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function ut(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(st,t)}var lt=864e5;function ct(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(lt*(e-Math.floor(e)))))}function ft(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=ut(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Xe.INTERVAL?ct(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(o){return n=ut(o,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function ht(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ft(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Ke(n,r,i,o,t)}function dt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,u=t.type,l=t.sourceField,c=s||("dimension"===u?function(e){return e.qElemNo}:function(e){return e.qValue}),f=function(e){return e.qText||""},h="dimension"===u?"first":"avg",d=ht(n,o),p={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return u},origin:function(){return l},items:function(){return e||(e=a(p)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:f,reduce:h,reduceLabel:"dimension"===u?"first":function(e,t){return d(t)},formatter:function(){return d},tags:function(){return n.qTags}};return p}function pt(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:dt(E({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=pt("qAttrDimInfo",t,n,a,E({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=pt("qAttrExprInfo",t,n,a,E({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=pt("qMeasureInfo",t,n,a,E({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function gt(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.key,a=i.data,s=i.config,u=void 0===s?{}:s,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},c=a;if(!c)throw new Error('Missing "data" input');if(!c.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var f=gt.util,d={cache:l,cube:c,localeInfo:u.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:u.virtualFields},p={key:function(){return o},raw:function(){return c},field:function(e){return le(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,p,l,f)},hierarchy:function(e){return d.hierarchy(e,p,l,f)},_cache:function(){return l}};"K"===c.qMode||"T"===c.qMode||!c.qMode&&c.qNodesOnDim?(d.extractor=_e,d.hierarchy=Me,d.pages="K"===c.qMode?c.qStackedDataPages:c.qTreeDataPages):"S"===c.qMode?(d.extractor=R,d.pages=c.qDataPages,d.hierarchy=Me):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},p,l,f)};var g="S"===c.qMode?function(e){return e.qElemNumber}:void 0,m="S"===c.qMode?function(e){return e.qNum}:void 0;return(e=l.wrappedFields).push.apply(e,h(pt("qDimensionInfo",c,o,"",E({},d,{value:g,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,h(pt("qMeasureInfo",c,o,"",E({},d,{value:m,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance})),function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))}(l.wrappedFields),(u.virtualFields||[]).forEach((function(e){var t=p.field(e.from),r=dt(n({meta:t.raw(),id:"".concat(o,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},p,l,f)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(r)})),(r=l.allFields).push.apply(r,h(l.virtualFields)),p}var mt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],yt=/\/qDimensionInfo(?:\/(\d+))?/,vt=/\/qMeasureInfo\/(\d+)/,bt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,xt=/\/qAttrExprInfo\/(\d+)/,wt=/\/?qHyperCube/,kt=/\/?qTreeData/,Mt=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},_t=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function St(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};wt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Mt):kt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=_t);var s=!0;if(yt.test(e)&&(r=+yt.exec(e)[1]),vt.test(e)&&(i=+vt.exec(e)[1]),bt.test(e)){i=-1,r=0;var u=+bt.exec(n)[2];isNaN(u)||(r=u,n=n.replace(/\/\d+$/,"")),s=!1}if(xt.test(e)){var l=i;if(t){i=0;var c=ae(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,l).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+xt.exec(n)[1]}else r>-1?(r=-1,i=+xt.exec(n)[1]):i+=+xt.exec(n)[1]+1}return mt.forEach((function(e){var t=f(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function qt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},u=e.isActive(),l=!1;return e.brushes().forEach((function(e){var t=St(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return 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){var u=e.brush.ranges();u.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),u.forEach((function(e){return 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){var c=e.brush.ranges();c.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return 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(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var f=r.qHyperCube,h=f.qNoOfLeftDims,d=f.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===h||d>=h)&&h>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:d-h})})):p.forEach((function(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!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),l=!!s.selectHyperCubeCells.values.length);else{var g=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));l=!!g.length,a.push({params:[t.path,t.dimensionIdx,g,!1],method:"selectHyperCubeValues"})}}})),!l&&u?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function Dt(e){gt.util=e.data("matrix").util,e.data("q",gt),e.formatter("q-number",Ke),e.formatter("q-time",ft)}return Dt.qBrushHelper=qt,Dt.selections=qt,Dt}()}(Yb);var Kb=Yb.exports;const Xb={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))})),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const Gb={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Jb(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let u=!1;const l=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Kb.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=Xb.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let f=!1;function h(e){16===e.keyCode&&e.shiftKey!==f&&(f=e.shiftKey,o.toggle())}function d(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){a.forEach((e=>{e.listeners.update=function(t,n){e.sleep||l.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){a.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{a.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return u&&p(),t},c.setUpBrush=function(e){const n=lb(!0,{},Gb,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!u)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:l.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach((e=>{e!==s&&e.brush.end()}))},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){u&&p()},c.tearDown=function(){u&&g(),a.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)})),a=[]},c.pauseEngineCalls=function(e){a.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){a.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){a.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(u)return;u=!0,p(),document.addEventListener("keydown",h),document.addEventListener("keyup",h);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",d),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",d)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>u,c.off=function(){u&&(u=!1,g(),document.removeEventListener("keydown",h),document.removeEventListener("keyup",h),document.removeEventListener("keyup",d),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class Zb{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Qb={create:e=>e.selectionsApi?Jb(e):new Zb};function ex(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function u(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=u,s.update=function(){const s=a.brushes(),l=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(l)):u()},s.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},s}var tx={create:(...e)=>ex(...e)},nx={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 rx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const u=ix(e,o);u&&a.rows.unshift(u),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function ix(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach((e=>{const n=t.data[e];n&&s.push(n.value)}));const u=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:l}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==u?l.get("properties.dimensionLimits.others"):o.label}}const ox="dist-flow-tooltip",ax="#dist-flow-tooltip";function sx(){if(!document.querySelector(ax)){const e=document.createElement("div");e.id=ox,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 ux({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){sx()},beforeUpdate(){sx()},destroyed(){!function(){const e=document.querySelector(ax);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ax),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:lx}=Mb;const cx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:nx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:lx(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],u={...r.cell,textAlign:s,direction:lx(e.label)},l={...r.cell,textAlign:o?"left":"right",direction:lx(e.value)};a.push(n("tr",null,n("td",{style:u},i),n("td",{style:l},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:lx(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function fx(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(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 s(){Object.keys(r).forEach((e=>{u(r[e])}))}function u(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 l(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function c(){l();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=lb(!0,{},cx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&u(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:tx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const l=ux({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:rx(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(l),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:l}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=l,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{a(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),l())},o}var hx={create:(e,t,n)=>fx(e,t,n)};const dx={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=dx.generateHash(t)}};const px={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:mx(t),dimensionExpressions:gx(t),measureExpressions:e})))}};function gx(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function mx(e){return function(e){return wv(e,"qDimensionInfo",[])}(e).map((e=>e.qGroupPos))}const yx={},vx=lb.bind(null,!0);function bx(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const xx=Array.isArray,wx=function(e){return void 0===e};function kx(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Mx(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=wx(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function _x(e,t){if(bx(e)&&bx(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!_x(e[n],t[n]))return!1;return!0}if(xx(e)&&xx(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!_x(e[n],t[n]))return!1;return!0}return e===t}yx.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=vx({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;_x(o,a)||kx(t,i)||(wx(a)?r.push({op:"add",path:s,value:o}):bx(o)&&bx(a)?r=r.concat(yx.generate(a,o,s)):xx(o)&&xx(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function u(e,t,n){if(e[n]&&wx(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(_x(t,i))return r;if(null===t[0]||!wx(t[0])&&wx(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=u(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(yx.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=u(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{wx(t[i])&&!kx(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},yx.apply=function(e,t){t.forEach((t=>{const n=Mx(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(xx(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(xx(i)&&xx(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else bx(i)&&bx(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!kx(a,e)&&delete a[e]})),vx(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Mx(e,t.from);xx(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(xx(n)?n.splice(+r,1):delete n[r]);var a}))},yx.clone=function(e){return vx({},e)},yx.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},yx.updateObject=function(e,t){Object.keys(e).length?yx.apply(e,yx.generate(e,t)):vx(e,t)};class Sx{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=yx.generate(e,t);return lb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=yx.generate(n,r);yx.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var qx={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 Dx={saveDerivedProperties:function(e,t,n,r){if(qx.canModifyHardProperties(t))return e.setProperties(n);return new Sx(e).saveSoftProperties(r,n)}};var Cx={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Ex(){this._generationInProgress=!1}function Ax(e){Cx.validate(e);const t=e.properties,n=dx.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Ex.prototype.isDerivedUpToDate=Ax,Ex.prototype.updateDerivedProperties=function(e){if(Cx.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Ax(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=lb(!0,{},e.properties),o=lb(!0,{},i);return this._generationInProgress=!0,dx.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Dx.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Ex.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return px.getDefaultHashDataForHyperCube(e,t,n).then((e=>lb(!0,r,e)))};const Tx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Nx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Rx(o,!0),i);return a},createRegExp:Rx};function Rx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Ox={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Tx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Ix(t,i,e);n[t]=r}))}return Nx.replaceExpressionTokens(e,n)}};function Ix(e,t,n){if(""===t)return"";const r=Nx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Px={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let u;e.forEach((e=>{o=Hx(e.match(zx("Dim"))),o.forEach((e=>{s.push(Lx(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=Hx(e.match(zx("Mea"))),a.forEach((e=>{s.push(jx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),u=s.length?Promise.all(s).then((()=>Promise.resolve(i))):Promise.resolve(i);return u}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=lb({},n,i),o=lb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:["="+Ox.generateExpression(e,r)]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Ox.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>Lx(e,n,r,t))),i=e.qMeasures.map((e=>jx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Lx(e,t,n,r){if(e.qLibraryId)return Fx(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function jx(e,t){return e.qLibraryId?Fx(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Fx(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function zx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Hx(e){return e?e.map((e=>e.substr(6,1))):[]}function Bx(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function Vx(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Wx={getBinSize:function(e){return wv(e,"bins.binSize",qy.BIN_SIZE)},getDerivedBinSize:function(e){return wv(e,"qUndoExclude.bins.binSize",qy.BIN_SIZE)},getDerivedBinOffset:function(e){return wv(e,"qUndoExclude.bins.offset",qy.OFFSET)},getDerivedBinCount:function(e){const t=wv(e,"qUndoExclude.bins.binCount",qy.BIN_COUNT);return Bx(t)?t<1?1:Vx(t)?t:Math.ceil(t):qy.BIN_COUNT},getBinCount:function(e){return wv(e,"bins.binCount",void 0)},getBinOffset:function(e){return wv(e,"bins.offset",qy.OFFSET)},isAutoBin:function(e){return wv(e,"bins.auto",qy.AUTO)},isCountDistinct:function(e){return wv(e,"bins.countDistinct",qy.COUNT_DISTINCT)},getBinMode:function(e){return wv(e,"bins.binMode",qy.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},Ux=Math.log(10),$x=[1,1.5,2,3,4,5,6,10],Yx=[1,2,4,5,6,8,10],Kx=[2,4,5,10];function Xx(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/Ux),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function Gx(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Jx={calculateBinSize:function(e,t,n){return function(e,t,n){if(!Bx(e)||!Bx(t)||!Bx(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,a,s,u,l,c,f,h,d,p,g=-1,m=$x;if(n=Math.max(1,n),t===e)if(0===t){if(a=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(a=t+1e-9,m=Yx):a=Math.abs(t/n);else o=(t+=1e-9)-e,a=o/n;do{if(c=1,d=0,g>=0)for(f=1/Kx[g],h=1,m=[];h<=10;)m.push(Math.round(1e3*h)/1e3),h+=f;s=a;do{s=Xx(s*c,m),u=Math.floor(Math.log(s)/Ux),l=10**u,i=t===e?(Math.ceil(t/s)+Math.floor(n/2))*s:Math.ceil(t/s)*s,r=i-n*s;let o=0;for(p=l;(r>e||i<t)&&o<Kx.length;)r=Math.floor(e/p)*p,i=r+n*s,p=l/Kx[o++];u<1&&(l=10**(Math.abs(u)+1),i=Math.round(i*l)/l,r=Math.round(r*l)/l),c=1.1,d++}while((r>e||i<t)&&d<10);g++}while(Gx(e,t,0,a,r,i)>0&&g<Kx.length);return{binCount:n,offset:r,binSize:s}}(e,t,n=function(e){return e<1?1:Vx(e)?e:Math.ceil(e)}(n))}};const Zx={getMappingValues:function(e){const t=Wx.isAutoBin(e),n=Wx.getBinMode(e);let r,i,o,a;const s=Wx.isCountDistinct(e);return t||"maxCount"===n?(a=function(e){const t=wv(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=Bx(n)?n:1,r=Bx(r)?r:1;const i=Wx.getDerivedBinCount(e);return Jx.calculateBinSize(n,r,i)}(e),r=a.binSize,i=a.offset,o=a.binCount):(r=Wx.getBinSize(e),i=Wx.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:s}},getMappings:function(e){const t={};return t.BinSize={value:","+e.binSize},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":","+e.binOffset},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Qx={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Zx.getMappingValues(e),a=Zx.getMappings(o),s=Px.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),u=Px.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,a),l=await s,c=await u;let f;f=Wx.isAutoBin(e)?{qValueExpression:{qExpr:Ox.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:l.dimensions[0],wrap:!0}})}}:"maxCount"===Wx.getBinMode(e)&&Wx.isEmpty(t.bins.binCount)?Wx.getDerivedBinCount(e):t.bins.binCount,kv(c,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),kv(c,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),kv(c,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),kv(t,"qUndoExclude.box.qHyperCubeDef",c),kv(t,"qUndoExclude.bins.binSize",o.binSize),kv(t,"qUndoExclude.bins.offset",o.binOffset),kv(t,"qUndoExclude.bins.binCount",f)}};var ew={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 tw={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:wy.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=ew.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){ew.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var nw={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function rw(e,t){let n;return n="x-axis"===e?"horizontal"===t?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL:"horizontal"===t?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,n}var iw={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:rw(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var ow={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var aw={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?"lasso "+t.getBrushConfig():"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var sw={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&ew.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var uw={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,u=r.measureRangeBrushKey||null,l=r.areaBrushKey||null,c=r.legendBrushKey||null,f=!!e.selectionHandler&&e.selectionHandler.isOn(),h={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},d={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(d.gesture===e)return;let r=a;const i=t||d.chart;switch(d.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=u;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=l}d.gesture=e;const o="range"===e?"range":"item";d.type&&d.type!==o&&i.brush(r).clear(),d.chart=t,d.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return s?u?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:d,rangeSelStatus:i};function k(){y("none"),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}return f&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}}}],b.unshift(sw.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(tw.callLassoGesture(h,x,w)),s?u?(b.push(ow.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(nw.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(ow.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(iw.callAreaRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMinor",clear:"areaClear"})):(b.push(nw.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMeasure",clear:"rangeClear"}),b.push(iw.callAreaRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(aw.callDragGesture(h,x,w,f,n)),e.scrollHandler.getScrollApi().on("update",k)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",k)},o}};function lw(e){const t=wv(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const cw={createSettings:function(e){return{settings:{labels:{maxGlyphCount:lw(e)}}}}};const fw={createSettings:function(e){const t=Wx.isAutoBin(e),n=Wx.getBinMode(e),r=Wx.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Wx.getDerivedBinOffset(e);i=t,o=t+Wx.getDerivedBinCount(e)*r}else{const t=wv(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},hw={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}},dw=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,pw=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,gw=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,mw=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,yw=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,vw=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,bw=Math.floor,xw=Math.round,ww=fb.extend({init(){let e,t,n,r,i,o,a,s,u,l,c,f,h=0,d=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof ww)h=arguments[0]._r,d=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(f=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(f))h=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(f))h=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10),g=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(f))h=parseInt(c[1],16),d=parseInt(c[2],16),p=parseInt(c[3],16),g=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(f))h=parseInt(c[1]+c[1],16),d=parseInt(c[2]+c[2],16),p=parseInt(c[3]+c[3],16),g=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=r-.5*o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p),g=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),g=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=r-.5*o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=i-o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p),g=1}else hw[f.toLowerCase()]?(n=f.toLowerCase(),h=hw[n].r,d=hw[n].g,p=hw[n].b,g="number"==typeof hw[n].a?hw[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,h=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(h=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(h=arguments[0],d=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+h+d+p+g)&&(this._invalid=!0),this._r=bw(h),this._g=bw(d),this._b=bw(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=ww.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=ww.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=ww.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=ww.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=ww.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=ww.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=ww.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=ww.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof ww||(e=new ww(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[bw(this._r+(e._r-this._r)*t),bw(this._g+(e._g-this._g)*t),bw(this._b+(e._b-this._b)*t),bw(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new ww(r)}});ww.toRGB=function(e){if(e instanceof ww)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=ww.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},ww.toRGBA=function(e,t){if(e instanceof ww)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=ww.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},ww.toHex=function(e){let t,n,r;return e instanceof ww?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),"#"+[t,n,r].join("")):("string"==typeof e&&(e=ww.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),`#${t}${n}${r}`)},ww.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ww(e));const a=e._r/255,s=e._g/255,u=e._b/255,l=Math.max(a,s,u),c=Math.min(a,s,u);if(r=t?.21*a+.72*s+.07*u:(l+c)/2,l===c)n=0,o=0;else{switch(i=l-c,n=r>.5?i/(2-l-c):i/(l+c),l){case a:o=(s-u)/i+(s<u?6:0);break;case s:o=(u-a)/i+2;break;case u:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},ww.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ww(e));const a=e._r/255,s=e._g/255,u=e._b/255,l=e._a,c=Math.max(a,s,u),f=Math.min(a,s,u);if(r=t?.21*a+.72*s+.07*u:(c+f)/2,c===f)n=0,o=0;else{switch(i=c-f,n=r>.5?i/(2-c-f):i/(c+f),c){case a:o=(s-u)/i+(s<u?6:0);break;case s:o=(u-a)/i+2;break;case u:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${l})`},ww.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new ww(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),u=Math.min(i,o,a),l=s;if(s===u)t=0,r=0;else{switch(n=s-u,t=0===n?0:n/l,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*l}},ww.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof ww)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},ww.blend=function(e,t,n){const r=(16711680&(e=ww.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=ww.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},ww.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new ww(r,i,o,a)},ww.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(dw.test(e)||pw.test(e)||gw.test(e)||mw.test(e)||yw.test(e)||vw.test(e)||hw[e.toLowerCase()])},ww.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},ww.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},ww.isDark=function(){const e={getLuminance:ww.prototype.getLuminance,isInvalid:ww.prototype.isInvalid};return ww.prototype.init.apply(e,[].slice.call(arguments)),ww.prototype.isDark.call(e)},ww.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const kw={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 ww(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new ww(e);return 0===t.getAlpha()?this.DARK_GREY:ww.getBestContrast(t,new ww(kw.LIGHT_GREY),new ww(kw.DARK_GREY))},getBestContrast:(e,t,n)=>ww.getBestContrast(new ww(e),new ww(t),new ww(n)),getContrastingTransparent(e){const t=new ww(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const Mw={createSettings:function(e,t,n,r,i,o){const{theme:a}=e.environment,s=a.getColorPickerColor(t.color.bar.paletteColor),u=Wx.getDerivedBinSize(t),l=[],c=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(l.push(o.box.trigger),c.push.apply(c,o.box.consume)),l.push(n.trigger),{key:"box-marker",settings:{box:{fill:s,stroke:kw.getContrastingGrey(s).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:l,consume:c},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+u},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const _w={createSettings:function(e,t){const n=t.getColorPickerColor(e.color.bar.paletteColor);return{settings:{sources:[{strategy:{settings:{labels:[{placements:[{},{fill:kw.getInverse(n)}]}]}}}]}}}};function Sw(e){return wv(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const qw={createChartSettings:function(e,t){const n=e.isRtl(),r=wv(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,a=Fb.create({chartID:"object.histogram",theme:i,isRtl:n});let s={},u={},l={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),s=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),u=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:Sw(t)}),l=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const c={box:{}};e._tooltipHandler.isOn()&&(c.box=e._tooltipHandler.setUp({chartBuilder:a,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t)),h={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=uw.create(h,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),a.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:fw.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:cw.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines});const d=a.getSettings(),p=Mw.createSettings(e,t,s,u,l,c);if(a.addComponent("box-marker",p),t.dataPoint&&t.dataPoint.showLabels){const e=_w.createSettings(t,i);a.addComponent("labels",e)}return e.addSnapshotChartSettings(d,t),d.scales.rangeSelSettings={type:"linear",min:d.scales.dimension.min,max:d.scales.dimension.max,source:"qDimensionInfo/0"},d}};const Dw=$b.extend("Histogram",{namespace:".histogram",init:function({environment:e,lasso:t,picasso:n,$element:r,backendApi:i,selectionsApi:o,renderState:a}){this._super(n,r,e,i,o),this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Ex,this._selectionHandler=Qb.create({model:i.model,chartInstance:this.chartInstance,selectionsApi:o,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:t}),this._tooltipHandler=hx.create(this.chartInstance,r,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return qw.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=wv(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Zx.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const a={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Qx.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(a)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(a))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class Cw{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var Ew={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},u=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},l=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,f=arguments[0],h=1,d=arguments.length,p=!1;for("boolean"==typeof f&&(p=f,f=arguments[1]||{},h=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});h<d;++h)if(null!=(t=arguments[h]))for(n in t)r=c(f,n),f!==(i=c(t,n))&&(p&&i&&(u(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&u(r)?r:{},l(f,{name:n,newValue:e(p,a,i)})):void 0!==i&&l(f,{name:n,newValue:i}));return f}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},u=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},l=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,f=arguments[0],h=1,d=arguments.length,p=!1;for("boolean"==typeof f&&(p=f,f=arguments[1]||{},h=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});h<d;++h)if(null!=(t=arguments[h]))for(n in t)r=c(f,n),f!==(i=c(t,n))&&(p&&i&&(u(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&u(r)?r:{},l(f,{name:n,newValue:e(p,a,i)})):void 0!==i&&l(f,{name:n,newValue:i}));return f}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),u="".concat(" ",")").concat(" ");function l(e){return s+e+u}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var u=a.qFieldDefs[s];if(u.qName===i)return u}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function f(e){return!(!e.fullAccumulation&&!e.fullRange)}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,u=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var l=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(l,">}").concat(u,")")}if(r&&2===r.length){var f=c(r[0],i),h=c(r[1],i),d=p(0),g=p(1),m=y(f,d),v=y(h,g);return"".concat(a,"({1<").concat(m,",").concat(v,">}").concat(u,")")}return"".concat(a,"({1}").concat(u,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:f,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=l(d(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),u=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(u,")")}if(r&&2===r.length){var f=p(0),h=p(1);return"If(Count(".concat(f,") * Count(").concat(h,") > 0, ").concat(a," + ").concat(s).concat(u,")")}return a},getRowNoComp:h,getNumStepComp:function(e,t){if(!f(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix: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,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:l,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var M=i.a.bind(null,!0),_={},S=Array.isArray;function q(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function D(e){return void 0===e}function C(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=D(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(q(e)&&q(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||C(t,i)||(D(a)?r.push({op:"add",path:s,value:o}):q(o)&&q(a)?r=r.concat(_.generate(a,o,s)):S(o)&&S(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&D(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!D(t[0])&&D(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(_.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var u=0,l=t.length;u<l;u+=1)-1===(o=a(i,t[u].qInfo&&t[u].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(u),value:t[u]}),i.splice(u,0,t[u])):o!==u&&(r.push({op:"move",path:"".concat(n,"/").concat(u),from:"".concat(n,"/").concat(o)}),i.splice(u,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!C(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},_.apply=function(e,t){t.forEach((function(t){var n,r=E(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var s,u=t.value.slice();o.length=0,(s=o).push.apply(s,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")}()}(u))}else if(q(o)&&q(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),M(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var l=E(e,t.from);S(r)?r.splice(+i,0,l.splice(+a,1)[0]):(r[i]=l[a],delete l[a])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return M({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):M(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=w.getNumStepComp(n,u),h=w.getAboveComp(n,u,c,f),d=w.getRangeComp("RangeSum",h);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(l,1),g=w.getDimComp(l,0),m=w.getAggrComp(d,p,g);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:l,dimensionAndFieldList:s,valueComp:m}):m}return d},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(I(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(I(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}}}},j="movingAverage";function F(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,u=e.dimensionAndFieldList;if(!r)return n;var l=s;void 0===l&&(l=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),f=r.showExcludedValues&&r.nullSuppression,h=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:u,treatMissingAsNull:f}),d=w.getNumStepComp(r,l),p=w.getAboveComp(r,l,h,d);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,l);t="".concat(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:u,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=F(t,e);return o&&!o.disabled}}}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=w.getAboveComp(n,u,c),h="".concat(c," - ").concat(f);if(w.needDimension({modifier:n,properties:r,layout:i})){var d=w.getDimComp(l,1),p=w.getDimComp(l,0),g=w.getAggrComp(h,d,p);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:l,dimensionAndFieldList:s,funcComp:"Only",valueComp:g}):g}return h},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(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(U(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(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}}}},K={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:K.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:K.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),u=ie(t,n,r),l=""===s&&""===u?"":s||u,c=oe(i,o),f=ae(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(l," ").concat(c).concat(f," Aggr(").concat(l," ").concat(e,", ").concat(h,"))")}(c,f,n.field,n.value,h,u,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},ue={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},le={initBase:function(e,t){(t||le.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){le.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=le;function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var he={accumulation:L,movingAverage:B,difference:Y,normalization:se},de=(t.default={modifiers:he,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&de[e.id]&&de[e.id].masterItemSubscriber&&(de[e.id].masterItemSubscriber&&de[e.id].masterItemSubscriber.unsubscribe(),delete de[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return he[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return he[e]&&he[e].isApplicable({properties:n,layout:r})}))},measureBase:ue,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ce({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;de[t.id]=de[t.id]||{isFirstTime:!0};var u=de[t.id].isFirstTime;if(de[t.id].isFirstTime=!1,n&&"object"===fe(n))return ge({model:t,properties:n});var l=t?t.layout:void 0,c=a(l,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var f=a(l,"qHyperCube.qMeasureInfo"),h=de[t.id].lastReloadTime;if(de[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:f,layout:l})){var d=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return De({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:l,model:t,lastReloadTime:h});return d||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:l,masterItem:s,isFirstTime:u})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Me(n);var r=Oe(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return d&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(De({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(n++,"object"!==fe(he[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=he[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===fe(e.base)}))}(f)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,u=void 0!==s&&s,l=e.masterItem,c=e.libraryItemsProps,f=e.dimensionAndFieldList;void 0===n&&(n=u?i()(!0,{},r):r),Me(r);var h=Oe(r);return Ie({model:t,libraryIds:h,masterItem:l}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var u=o?void 0:Oe(n);return Ee({model:r,dimensionAndFieldList:s}).then((function(e){return Ae({libraryIds:u,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ce({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var u=t.qDef,l=u.modifiers,c=u.base;Array.isArray(l)&&l.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(s++,"object"!==fe(he[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");he[e.type].initModifier(e);var u=t.qLibraryId||c&&c.qLibraryId;u?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,u=he[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=u,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:u,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof he[n.type].updateModifier&&he[n.type].updateModifier(n,r.qHyperCubeDef);var a=ue.getExpression(t),s=he[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(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:r,dimensionAndFieldList:e}),_e(t)):me(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:f}).then((function(){return u?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&!he[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({modifiers:we(e),properties:n,layout:r})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(he[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||he[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ke(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Me(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&ke(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===fe(t)&&(t.disabled||!he[t.type]&&ke(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function qe(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function De(e){var t=e.measure,n=e.properties,r=e.layout;return!qe(t)&&Ce({modifiers:we(t),properties:n,layout:r})}function Ce(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==fe(e)||e.disabled||!he[e.type])&&(void 0===i[e.type]&&(i[e.type]=he[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&he[e.type]&&he[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Oe(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ce({modifiers:r,properties:e})){var o=qe(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(de[t.id].masterItemSubscriber=de[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function u(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function l(e){var t=e.qInfo.qId;if(r[t]){var i=u(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(l),enabled:!1,properties:u(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),de[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var f={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},h=n(1),d=n.n(h),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,u=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");u&&(s=i.excludedDimensions).push.apply(s,a(u))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,u(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,u(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&f.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){d.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var m=n(0),y=n.n(m);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 k(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(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 M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var u=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}for(t=0;t<s.excludedDimensions.length;++t){var l=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var u=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}for(t=0;t<s.excludedMeasures.length;++t){var l=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),u=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,u,0),maxMeasures:s,minMeasures:u}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(f.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,f.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=k(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=_(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function D(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var C={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),u=s.qHyperCubeDef;return u.qInterColumnSortOrder||(u.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:u}),p.addMeasures({exportFormat:i,qHyperCubeDef:u}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:u}),delete u.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=u,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,u=void 0===s?{}:s,l=e.hypercubePath,c=e.extension,f=e.supportedFilters,h=void 0===f||f,d=e.isHCModifierSupported,p=void 0===d||d,g={qChildren:[]},m=q.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:l}),y=o.getValue(r,l||"").qHyperCubeDef,v=o.getValue(m,l||"").qHyperCubeDef,b=q.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,k=b.maxMeasures,M=b.minMeasures,_=u.defaultDimension,S=void 0===_?q.getDefaultDimension():_,C=u.defaultMeasure,E=void 0===C?q.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,q.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M})&&q.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M,newHyperCubeDef:v}),q.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),q.addMeasures({exportFormat:t,maxMeasures:k,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),q.updateDimensionsOnAdded({newProperties:m,dataDefinition:a,hypercubePath:l}),q.updateMeasuresOnAdded({newProperties:m,dataDefinition:a,hypercubePath:l}),q.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),q.copyPropertyIfExist("qMaxStackedCells",y,v),q.copyPropertyIfExist("qNoOfLeftDims",y,v),q.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),q.copyPropertyOrSetDefault("qMode",y,v,"S"),q.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),q.copyPropertyOrSetDefault("qSortbyYValue",y,v),q.copyPropertyOrSetDefault("qIndentMode",y,v),q.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),q.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(c||{},"support.modifiers");return q.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),h&&D(g.qProperty,"storedFilters"),"S"===v.qMode&&p&&D(g.qProperty,"dynamicScript"),g}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function T(e,t){return e.length!==t}var N={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,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(A(a,t,r,i),T(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=f.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=N.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var u=r[r.length-1];if(u){var l=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(l){var d=N.create(N.IDMAP.COLOR_BY_ALTERNATIVE);switch(l.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:l,isDimension:n,qNumFormat:c,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=f.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:d,measures:a,item:l,isDimension:n,qNumFormat:c,isCustomFormatted:h})}n?(d.qSortBy={qSortByAscii:1},u.qAttributeDimensions.push(d)):u.qAttributeExpressions.push(d)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:d.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return d.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=R.getItemLabel(t);switch(F(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,a=f.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=N.IDMAP.COLOR_BY_ALTERNATIVE,s=f.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},K={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=C.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),u=N.IDMAP,l=u.COLOR_BY_ALTERNATIVE,c=u.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(a,[],"qAttributeDimensions",l),N.moveByIdFromGroup(a,[],"qAttributeExpressions",l),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,u=e.supportedFilters,l=e.isHCModifierSupported,c=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:u,isHCModifierSupported:l}),f=c.qProperty,h=o.getValue(f,"visualization"),d=o.getValue(f,"qHyperCubeDef.qDimensions",[]),p=o.getValue(f,"color.mode",""),g=o.getValue(f,"color.auto",""),m=Y.getCanColorBy(f,h),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:d});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:f})&&Y.addColorByExpression(f):Y.switchToAutoColor(f),y&&Y.updateColorBy(f,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(f)&&Y.changeProperty(f,"color.persistent",!0),Y.deleteTotalMode(d),c}},X=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?D(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):D(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var u=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);u.length?(o&&(t=u.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=u.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=K.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(g(s,"measureAxis.min","supportedAutoMinMax"),g(s,"measureAxis.max","supportedAutoMinMax")):(g(s,"measureAxis.min","unsupportedAutoMinMax"),g(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,u=e.supportedFilters,l=e.isHCModifierSupported,c=K.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:u,isHCModifierSupported:l}),f=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:f}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:f,measureType:a}),G.setInterColumnSortOrder(f.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var u=o.getValue(i,"qDef.cId");u||(u=o.generateId(),o.setValue(i,"qDef.cId",u));var l=Z(n,r,u);o.setValue(t,l,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var u=Z(n,r,s),l=o.getValue(t,u);void 0!==l&&(o.setValue(i,a,l),o.setValue(t,u,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}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:C,colorChart:K,axisChart:J,quarantineProperty:g,unquarantineProperty:D,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Ew);var Aw=n(Ew.exports);var Tw={onChangeCalcCond:function(e){var t,n;const r=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(n=t.box)||void 0===n?void 0:n.qHyperCubeDef;r&&i&&(i.qCalcCond=r.qCalcCond,i.qCalcCondition=r.qCalcCondition)}};const Nw="maxCount",Rw="size";function Ow(e){return!(e.bins&&e.bins.auto)}function Iw(e){return Ow(e)&&e.bins.binMode===Nw}function Pw(e){const{translator:t}=e,n=e.anything.sense.theme,r={type:"items",translation:"properties.presentation",items:{gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},i={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===wv(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===wv(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=wv(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=wv(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=t.get("properties.histogram.staticMeasureName");return t.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},bins:{translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!Ow(e)},mode:{ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:Nw,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:Rw,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:Nw,show:e=>Ow(e)},binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Wx.isEmpty(r)?Wx.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:Iw},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=wv(e,"bins.binCount"),n="object"==typeof t;return Iw(e)&&!Wx.isEmpty(t)&&!n&&!Vx(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=wv(e,"bins.binCount");return!!(Iw(e)&&!Wx.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>Ow(e)&&e.bins.binMode===Rw,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>Ow(e)&&e.bins.binMode===Rw,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Tw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{uses:"settings",items:{simpleLabels:i,presentation:r,colors:{translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=n.getDataColorSpecials(),t=n.getDataColorPickerPalettes()[0].colors,r=t.indexOf(e);return{index:-1===r?Math.min(6,t.length-1):r}}}}}}},measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}}}}}var Lw={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var jw={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};function Fw(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Pw(e),softDefinition:Lw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=Cy(e);r.mapProperties();const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Aw.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:a,hypercubePath:i})},exportProperties:(e,t,n)=>Aw.hypercube.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties:e=>Aw.hypercube.exportProperties({propertyTree:e,hypercubePath:"qUndoExclude.box"}),getExportRawDataOptions:jw.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=_y(),r=Cy(t);return{qae:{properties:Dy,data:{targets:[r]}},ext:Fw(t),component(){const t=e.useConstraints(),r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),a=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:a})),[t,n,i.direction,i.freeResize,a.language(),o.name(),r])}(),a=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),a=!!e.useLayout().qSelectionInfo.qInSelections,[s]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Sy,hidden:!n||!a,active:i,action(){o((e=>!e))}})),[a,i,n]),s.enabled=()=>n,s.active=()=>i,s}(),s=e.useModel(),u=e.useSelections(),l=e.useStaleLayout(),c=e.useRenderState(),[f,h]=e.useState();e.useEffect((()=>{const e=i(r),t=new Cw(s),l=new Dw({$element:e,backendApi:t,environment:o,lasso:a,picasso:n,selectionsApi:u,renderState:c});return h(l),()=>{l.destroy()}}),[]);const[,d]=e.usePromise((async()=>{f&&(f.updateEnvironment(o),f.updateConstraints(t),await f.updateData(l),await f.paint())}),[l,f,o]);if(d)throw d;var p;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),p=f,e.onTakeSnapshot((e=>{if(p)return p.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(p)return p.getViewState()}})),[p])}}}}));
42
+ !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,u,l,c,f,h=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(l=t.split("."))[1]||l[1]&&l[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;l[0].length<e[0].length-a;)l[0]="0"+l[0];else 0==+l[0]&&(l[0]="");if((t=t.split("."))[0]=l[0],u=c[1]&&c[c.length-1].length){for(g="",y=(f=t[0]).length%u,h=f.length,b=0;b<h;b++)g+=f.charAt(b),!((b-y+1)%u)&&b<h-u&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));function De(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Ce={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"},Ee=/%$/,Ae=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Te=/^\(oct\)/i,Ne=/^\(dec\)/i,Re=/^\(hex\)/i,Oe=/^\(bin\)/i,Ie=/^\(rom\)/i,Pe=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Le=/#|0/g;function je(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Fe(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function ze(e,t,n){var r;return Ae.test(t)?e=je(e,Number(/\d{2}/.exec(t)[0]),t,n):Te.test(t)?e=je(e,8,t,n):Ne.test(t)?e=je(e,10,t,n):Re.test(t)?e=je(e,16,t,n):Oe.test(t)?e=je(e,2,t,n):Ie.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Fe(e,t)):t+r+e.toExponential(0)),e}function He(e,t,n){var r=De(e);return n?r:new RegExp(r||"",t)}function Be(e,t){return t&&(t=De(t)),e&&(e=De(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Ve(e,t){if(!e||!e.qNumericalAbbreviation)return Ce;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function We(e,t,n,r){var i,o,a,s,u,l,c,f,h,d=e.pattern;r&&(e.abbreviate=!0),h=Be(t,n),s=(a=(a=d.match(h))?a[0]:"")?d.substr(0,d.indexOf(a)):d,u=a?d.substring(d.indexOf(a)+a.length):"",a||(a=d?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(a=a.replace(He(l,"g"),t)),c=n,n=".",c&&(a=a.replace(He(c,"g"),n)),f=(f=a.match(/#/g))?f.length:0;var p,g=d.split(c);g[1]&&(p=g[1].match(Le)),e.prefix=s||"",e.postfix=u||"",e.pattern=d,e.maxPrecision=p?p.length:2,e.percentage=Ee.test(d),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(He(t,null,!0),"|").concat(He(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=c,e.t=t,e.d=n,e.temp=f}var Ue=function(){function e(t,n,r,o,a){i(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=o||".",this.type=a||"numeric",this.patternSeparator=";",this.abbreviations=Ve(t,this.patternSeparator),this.prepare()}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Pe.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Pe.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Pe.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||We(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&We(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&We(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,u,l,c=this._prepared,f="",h="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=ze(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,g,m=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=m[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<m.length;)y=m[++s];s>0&&(p=m[s-1]),p&&n>0&&p>0?g=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?g=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(g=p)),g&&(f=this.abbreviations[g],e/=Math.pow(10,g))}if(r=Math.abs(e),t=c.temp,l=(u=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,l||"#"!==u.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,l?l.length:0)).split(".")[0]),b=u.split(o)[0];if(e=qe(b+=o,v)||"0",l){var x=Math.max(0,Math.min(14,l.length)),w=l.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(u+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)u+="#";e=qe(u,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+h+f+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function $e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(Ue,t)}function Ye(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,u=r.toKey,l=void 0===u?function(e){return e}:u,c=Object.create(null),f=Object.create(null),h=0,d=0;return(t=s?function(){return n=l.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=l(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return h>=o&&(delete c[f[d]],delete f[d],h--,d++),c[e]=t,f[h]=e,h++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),f=Object.create(null),h=0,d=0},t.size=function(){return h},t}function Ke(e,t,n,r,i){var o=$e(i,e,t,n,r),a=Ye(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Xe={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ge=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ze=["January","February","March","April","May","June","July","August","September","October","November","December"],Qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],et=86400;function tt(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function nt(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function rt(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function it(e){var t=e,n=24*rt(t),r=60*rt(n),i=60*rt(r),o=1e3*rt(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function ot(e,t){var n,r=it(e),i=r.d,o=r.h,a=r.m,s=r.s,u=r.f,l=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(et*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(l=n?n.getDay()-1:0)<0&&(l=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:l,date:i,h:o,m:a,s:s,f:u,t:c}}function at(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:tt("".concat(t.year).slice(-2),2),YYY:tt("".concat(t.year).slice(-3),3),def:function(e){return tt("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:tt("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:tt("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return tt("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return tt("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return tt("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return tt("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length)}}}}var st=function(){function e(t,n,r){i(this,e);var o,a=t||{};a.qCalendarStrings||(a.qCalendarStrings={qLongDayNames:Ge,qDayNames:Je,qLongMonthNames:Ze,qMonthNames:Qe}),this.localeInfo=a,this.locale_days=a.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=a.qCalendarStrings.qDayNames.slice(),this.locale_months=a.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=a.qCalendarStrings.qMonthNames.slice(),n||(n=(s(o={},Xe.TIME,a.qTimeFmt||"hh:mm:ss"),s(o,Xe.DATE,a.qDateFmt||"YYYY-MM-DD"),s(o,Xe.DATE_TIME,a.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),o)[r]),this.pattern=n}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=nt(e,r):(e<0&&(e=-e,t="-".concat(t)),n=ot(e,t));var i=at(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g");return t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function ut(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(st,t)}var lt=864e5;function ct(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(lt*(e-Math.floor(e)))))}function ft(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=ut(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Xe.INTERVAL?ct(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(o){return n=ut(o,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function ht(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ft(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Ke(n,r,i,o,t)}function dt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,u=t.type,l=t.sourceField,c=s||("dimension"===u?function(e){return e.qElemNo}:function(e){return e.qValue}),f=function(e){return e.qText||""},h="dimension"===u?"first":"avg",d=ht(n,o),p={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return u},origin:function(){return l},items:function(){return e||(e=a(p)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:f,reduce:h,reduceLabel:"dimension"===u?"first":function(e,t){return d(t)},formatter:function(){return d},tags:function(){return n.qTags}};return p}function pt(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:dt(E({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=pt("qAttrDimInfo",t,n,a,E({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=pt("qAttrExprInfo",t,n,a,E({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=pt("qMeasureInfo",t,n,a,E({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function gt(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.key,a=i.data,s=i.config,u=void 0===s?{}:s,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},c=a;if(!c)throw new Error('Missing "data" input');if(!c.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var f=gt.util,d={cache:l,cube:c,localeInfo:u.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:u.virtualFields},p={key:function(){return o},raw:function(){return c},field:function(e){return le(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,p,l,f)},hierarchy:function(e){return d.hierarchy(e,p,l,f)},_cache:function(){return l}};"K"===c.qMode||"T"===c.qMode||!c.qMode&&c.qNodesOnDim?(d.extractor=_e,d.hierarchy=Me,d.pages="K"===c.qMode?c.qStackedDataPages:c.qTreeDataPages):"S"===c.qMode?(d.extractor=R,d.pages=c.qDataPages,d.hierarchy=Me):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},p,l,f)};var g="S"===c.qMode?function(e){return e.qElemNumber}:void 0,m="S"===c.qMode?function(e){return e.qNum}:void 0;return(e=l.wrappedFields).push.apply(e,h(pt("qDimensionInfo",c,o,"",E({},d,{value:g,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,h(pt("qMeasureInfo",c,o,"",E({},d,{value:m,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance})),function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))}(l.wrappedFields),(u.virtualFields||[]).forEach((function(e){var t=p.field(e.from),r=dt(n({meta:t.raw(),id:"".concat(o,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},p,l,f)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(r)})),(r=l.allFields).push.apply(r,h(l.virtualFields)),p}var mt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],yt=/\/qDimensionInfo(?:\/(\d+))?/,vt=/\/qMeasureInfo\/(\d+)/,bt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,xt=/\/qAttrExprInfo\/(\d+)/,wt=/\/?qHyperCube/,kt=/\/?qTreeData/,Mt=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},_t=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function St(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};wt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Mt):kt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=_t);var s=!0;if(yt.test(e)&&(r=+yt.exec(e)[1]),vt.test(e)&&(i=+vt.exec(e)[1]),bt.test(e)){i=-1,r=0;var u=+bt.exec(n)[2];isNaN(u)||(r=u,n=n.replace(/\/\d+$/,"")),s=!1}if(xt.test(e)){var l=i;if(t){i=0;var c=ae(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,l).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+xt.exec(n)[1]}else r>-1?(r=-1,i=+xt.exec(n)[1]):i+=+xt.exec(n)[1]+1}return mt.forEach((function(e){var t=f(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function qt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},u=e.isActive(),l=!1;return e.brushes().forEach((function(e){var t=St(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return 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){var u=e.brush.ranges();u.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),u.forEach((function(e){return 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){var c=e.brush.ranges();c.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return 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(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var f=r.qHyperCube,h=f.qNoOfLeftDims,d=f.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===h||d>=h)&&h>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:d-h})})):p.forEach((function(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!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),l=!!s.selectHyperCubeCells.values.length);else{var g=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));l=!!g.length,a.push({params:[t.path,t.dimensionIdx,g,!1],method:"selectHyperCubeValues"})}}})),!l&&u?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function Dt(e){gt.util=e.data("matrix").util,e.data("q",gt),e.formatter("q-number",Ke),e.formatter("q-time",ft)}return Dt.qBrushHelper=qt,Dt.selections=qt,Dt}()}(Yb);var Kb=Yb.exports;const Xb={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))})),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const Gb={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Jb(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let u=!1;const l=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Kb.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=Xb.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let f=!1;function h(e){16===e.keyCode&&e.shiftKey!==f&&(f=e.shiftKey,o.toggle())}function d(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){a.forEach((e=>{e.listeners.update=function(t,n){e.sleep||l.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){a.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{a.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return u&&p(),t},c.setUpBrush=function(e){const n=lb(!0,{},Gb,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!u)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:l.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach((e=>{e!==s&&e.brush.end()}))},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){u&&p()},c.tearDown=function(){u&&g(),a.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)})),a=[]},c.pauseEngineCalls=function(e){a.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){a.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){a.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(u)return;u=!0,p(),document.addEventListener("keydown",h),document.addEventListener("keyup",h);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",d),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",d)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>u,c.off=function(){u&&(u=!1,g(),document.removeEventListener("keydown",h),document.removeEventListener("keyup",h),document.removeEventListener("keyup",d),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class Zb{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Qb={create:e=>e.selectionsApi?Jb(e):new Zb};function ex(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function u(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=u,s.update=function(){const s=a.brushes(),l=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(l)):u()},s.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},s}var tx={create:(...e)=>ex(...e)},nx={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 rx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const u=ix(e,o);u&&a.rows.unshift(u),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function ix(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach((e=>{const n=t.data[e];n&&s.push(n.value)}));const u=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:l}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==u?l.get("properties.dimensionLimits.others"):o.label}}const ox="dist-flow-tooltip",ax="#dist-flow-tooltip";function sx(){if(!document.querySelector(ax)){const e=document.createElement("div");e.id=ox,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 ux({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){sx()},beforeUpdate(){sx()},destroyed(){!function(){const e=document.querySelector(ax);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ax),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:lx}=Mb;const cx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:nx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:lx(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],u={...r.cell,textAlign:s,direction:lx(e.label)},l={...r.cell,textAlign:o?"left":"right",direction:lx(e.value)};a.push(n("tr",null,n("td",{style:u},i),n("td",{style:l},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:lx(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function fx(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(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 s(){Object.keys(r).forEach((e=>{u(r[e])}))}function u(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 l(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function c(){l();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=lb(!0,{},cx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&u(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:tx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const l=ux({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:rx(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(l),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:l}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=l,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{a(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),l())},o}var hx={create:(e,t,n)=>fx(e,t,n)};const dx={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=dx.generateHash(t)}};const px={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:mx(t),dimensionExpressions:gx(t),measureExpressions:e})))}};function gx(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function mx(e){return function(e){return wv(e,"qDimensionInfo",[])}(e).map((e=>e.qGroupPos))}const yx={},vx=lb.bind(null,!0);function bx(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const xx=Array.isArray,wx=function(e){return void 0===e};function kx(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Mx(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=wx(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function _x(e,t){if(bx(e)&&bx(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!_x(e[n],t[n]))return!1;return!0}if(xx(e)&&xx(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!_x(e[n],t[n]))return!1;return!0}return e===t}yx.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=vx({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;_x(o,a)||kx(t,i)||(wx(a)?r.push({op:"add",path:s,value:o}):bx(o)&&bx(a)?r=r.concat(yx.generate(a,o,s)):xx(o)&&xx(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function u(e,t,n){if(e[n]&&wx(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(_x(t,i))return r;if(null===t[0]||!wx(t[0])&&wx(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=u(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(yx.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=u(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{wx(t[i])&&!kx(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},yx.apply=function(e,t){t.forEach((t=>{const n=Mx(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(xx(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(xx(i)&&xx(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else bx(i)&&bx(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!kx(a,e)&&delete a[e]})),vx(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Mx(e,t.from);xx(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(xx(n)?n.splice(+r,1):delete n[r]);var a}))},yx.clone=function(e){return vx({},e)},yx.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},yx.updateObject=function(e,t){Object.keys(e).length?yx.apply(e,yx.generate(e,t)):vx(e,t)};class Sx{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=yx.generate(e,t);return lb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=yx.generate(n,r);yx.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var qx={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 Dx={saveDerivedProperties:function(e,t,n,r){if(qx.canModifyHardProperties(t))return e.setProperties(n);return new Sx(e).saveSoftProperties(r,n)}};var Cx={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Ex(){this._generationInProgress=!1}function Ax(e){Cx.validate(e);const t=e.properties,n=dx.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Ex.prototype.isDerivedUpToDate=Ax,Ex.prototype.updateDerivedProperties=function(e){if(Cx.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Ax(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=lb(!0,{},e.properties),o=lb(!0,{},i);return this._generationInProgress=!0,dx.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Dx.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Ex.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return px.getDefaultHashDataForHyperCube(e,t,n).then((e=>lb(!0,r,e)))};const Tx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Nx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Rx(o,!0),i);return a},createRegExp:Rx};function Rx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Ox={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Tx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Ix(t,i,e);n[t]=r}))}return Nx.replaceExpressionTokens(e,n)}};function Ix(e,t,n){if(""===t)return"";const r=Nx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Px={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let u;e.forEach((e=>{o=Hx(e.match(zx("Dim"))),o.forEach((e=>{s.push(Lx(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=Hx(e.match(zx("Mea"))),a.forEach((e=>{s.push(jx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),u=s.length?Promise.all(s).then((()=>Promise.resolve(i))):Promise.resolve(i);return u}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=lb({},n,i),o=lb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:["="+Ox.generateExpression(e,r)]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Ox.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>Lx(e,n,r,t))),i=e.qMeasures.map((e=>jx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Lx(e,t,n,r){if(e.qLibraryId)return Fx(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function jx(e,t){return e.qLibraryId?Fx(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Fx(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function zx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Hx(e){return e?e.map((e=>e.substr(6,1))):[]}function Bx(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function Vx(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Wx={getBinSize:function(e){return wv(e,"bins.binSize",qy.BIN_SIZE)},getDerivedBinSize:function(e){return wv(e,"qUndoExclude.bins.binSize",qy.BIN_SIZE)},getDerivedBinOffset:function(e){return wv(e,"qUndoExclude.bins.offset",qy.OFFSET)},getDerivedBinCount:function(e){const t=wv(e,"qUndoExclude.bins.binCount",qy.BIN_COUNT);return Bx(t)?t<1?1:Vx(t)?t:Math.ceil(t):qy.BIN_COUNT},getBinCount:function(e){return wv(e,"bins.binCount",void 0)},getBinOffset:function(e){return wv(e,"bins.offset",qy.OFFSET)},isAutoBin:function(e){return wv(e,"bins.auto",qy.AUTO)},isCountDistinct:function(e){return wv(e,"bins.countDistinct",qy.COUNT_DISTINCT)},getBinMode:function(e){return wv(e,"bins.binMode",qy.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},Ux=Math.log(10),$x=[1,1.5,2,3,4,5,6,10],Yx=[1,2,4,5,6,8,10],Kx=[2,4,5,10];function Xx(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/Ux),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function Gx(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Jx={calculateBinSize:function(e,t,n){return function(e,t,n){if(!Bx(e)||!Bx(t)||!Bx(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,a,s,u,l,c,f,h,d,p,g=-1,m=$x;if(n=Math.max(1,n),t===e)if(0===t){if(a=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(a=t+1e-9,m=Yx):a=Math.abs(t/n);else o=(t+=1e-9)-e,a=o/n;do{if(c=1,d=0,g>=0)for(f=1/Kx[g],h=1,m=[];h<=10;)m.push(Math.round(1e3*h)/1e3),h+=f;s=a;do{s=Xx(s*c,m),u=Math.floor(Math.log(s)/Ux),l=10**u,i=t===e?(Math.ceil(t/s)+Math.floor(n/2))*s:Math.ceil(t/s)*s,r=i-n*s;let o=0;for(p=l;(r>e||i<t)&&o<Kx.length;)r=Math.floor(e/p)*p,i=r+n*s,p=l/Kx[o++];u<1&&(l=10**(Math.abs(u)+1),i=Math.round(i*l)/l,r=Math.round(r*l)/l),c=1.1,d++}while((r>e||i<t)&&d<10);g++}while(Gx(e,t,0,a,r,i)>0&&g<Kx.length);return{binCount:n,offset:r,binSize:s}}(e,t,n=function(e){return e<1?1:Vx(e)?e:Math.ceil(e)}(n))}};const Zx={getMappingValues:function(e){const t=Wx.isAutoBin(e),n=Wx.getBinMode(e);let r,i,o,a;const s=Wx.isCountDistinct(e);return t||"maxCount"===n?(a=function(e){const t=wv(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=Bx(n)?n:1,r=Bx(r)?r:1;const i=Wx.getDerivedBinCount(e);return Jx.calculateBinSize(n,r,i)}(e),r=a.binSize,i=a.offset,o=a.binCount):(r=Wx.getBinSize(e),i=Wx.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:s}},getMappings:function(e){const t={};return t.BinSize={value:","+e.binSize},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":","+e.binOffset},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Qx={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Zx.getMappingValues(e),a=Zx.getMappings(o),s=Px.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),u=Px.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,a),l=await s,c=await u;let f;f=Wx.isAutoBin(e)?{qValueExpression:{qExpr:Ox.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:l.dimensions[0],wrap:!0}})}}:"maxCount"===Wx.getBinMode(e)&&Wx.isEmpty(t.bins.binCount)?Wx.getDerivedBinCount(e):t.bins.binCount,kv(c,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),kv(c,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),kv(c,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),kv(t,"qUndoExclude.box.qHyperCubeDef",c),kv(t,"qUndoExclude.bins.binSize",o.binSize),kv(t,"qUndoExclude.bins.offset",o.binOffset),kv(t,"qUndoExclude.bins.binCount",f)}};var ew={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 tw={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:wy.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=ew.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){ew.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var nw={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function rw(e,t){let n;return n="x-axis"===e?"horizontal"===t?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL:"horizontal"===t?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,n}var iw={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:rw(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var ow={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ew.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];ew.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var aw={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?"lasso "+t.getBrushConfig():"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var sw={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&ew.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var uw={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,u=r.measureRangeBrushKey||null,l=r.areaBrushKey||null,c=r.legendBrushKey||null,f=!!e.selectionHandler&&e.selectionHandler.isOn(),h={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},d={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(d.gesture===e)return;let r=a;const i=t||d.chart;switch(d.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=u;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=l}d.gesture=e;const o="range"===e?"range":"item";d.type&&d.type!==o&&i.brush(r).clear(),d.chart=t,d.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return s?u?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:d,rangeSelStatus:i};function k(){y("none"),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}return f&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}}}],b.unshift(sw.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(tw.callLassoGesture(h,x,w)),s?u?(b.push(ow.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(nw.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(ow.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(iw.callAreaRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMinor",clear:"areaClear"})):(b.push(nw.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMeasure",clear:"rangeClear"}),b.push(iw.callAreaRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(aw.callDragGesture(h,x,w,f,n)),e.scrollHandler.getScrollApi().on("update",k)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",k)},o}};function lw(e){const t=wv(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const cw={createSettings:function(e){return{settings:{labels:{maxGlyphCount:lw(e)}}}}};const fw={createSettings:function(e){const t=Wx.isAutoBin(e),n=Wx.getBinMode(e),r=Wx.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Wx.getDerivedBinOffset(e);i=t,o=t+Wx.getDerivedBinCount(e)*r}else{const t=wv(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},hw={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}},dw=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,pw=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,gw=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,mw=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,yw=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,vw=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,bw=Math.floor,xw=Math.round,ww=fb.extend({init(){let e,t,n,r,i,o,a,s,u,l,c,f,h=0,d=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof ww)h=arguments[0]._r,d=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(f=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(f))h=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(f))h=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10),g=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(f))h=parseInt(c[1],16),d=parseInt(c[2],16),p=parseInt(c[3],16),g=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(f))h=parseInt(c[1]+c[1],16),d=parseInt(c[2]+c[2],16),p=parseInt(c[3]+c[3],16),g=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=r-.5*o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p),g=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),g=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=r-.5*o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(f)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),u=[],a=Math.floor(a),a){case 0:u=[o,s,0];break;case 1:u=[s,o,0];break;case 2:u=[0,o,s];break;case 3:u=[0,s,o];break;case 4:u=[s,0,o];break;case 5:u=[o,0,s];break;default:u=[0,0,0]}l=i-o,h=u[0]+l,d=u[1]+l,p=u[2]+l,h=xw(255*h),d=xw(255*d),p=xw(255*p),g=1}else hw[f.toLowerCase()]?(n=f.toLowerCase(),h=hw[n].r,d=hw[n].g,p=hw[n].b,g="number"==typeof hw[n].a?hw[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,h=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(h=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(h=arguments[0],d=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+h+d+p+g)&&(this._invalid=!0),this._r=bw(h),this._g=bw(d),this._b=bw(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=ww.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=ww.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=ww.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=ww.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=ww.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=ww.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=ww.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=ww.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof ww||(e=new ww(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[bw(this._r+(e._r-this._r)*t),bw(this._g+(e._g-this._g)*t),bw(this._b+(e._b-this._b)*t),bw(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new ww(r)}});ww.toRGB=function(e){if(e instanceof ww)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=ww.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},ww.toRGBA=function(e,t){if(e instanceof ww)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=ww.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},ww.toHex=function(e){let t,n,r;return e instanceof ww?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),"#"+[t,n,r].join("")):("string"==typeof e&&(e=ww.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),`#${t}${n}${r}`)},ww.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ww(e));const a=e._r/255,s=e._g/255,u=e._b/255,l=Math.max(a,s,u),c=Math.min(a,s,u);if(r=t?.21*a+.72*s+.07*u:(l+c)/2,l===c)n=0,o=0;else{switch(i=l-c,n=r>.5?i/(2-l-c):i/(l+c),l){case a:o=(s-u)/i+(s<u?6:0);break;case s:o=(u-a)/i+2;break;case u:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},ww.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ww(e));const a=e._r/255,s=e._g/255,u=e._b/255,l=e._a,c=Math.max(a,s,u),f=Math.min(a,s,u);if(r=t?.21*a+.72*s+.07*u:(c+f)/2,c===f)n=0,o=0;else{switch(i=c-f,n=r>.5?i/(2-c-f):i/(c+f),c){case a:o=(s-u)/i+(s<u?6:0);break;case s:o=(u-a)/i+2;break;case u:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${l})`},ww.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new ww(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),u=Math.min(i,o,a),l=s;if(s===u)t=0,r=0;else{switch(n=s-u,t=0===n?0:n/l,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*l}},ww.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof ww)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},ww.blend=function(e,t,n){const r=(16711680&(e=ww.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=ww.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},ww.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new ww(r,i,o,a)},ww.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(dw.test(e)||pw.test(e)||gw.test(e)||mw.test(e)||yw.test(e)||vw.test(e)||hw[e.toLowerCase()])},ww.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},ww.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},ww.isDark=function(){const e={getLuminance:ww.prototype.getLuminance,isInvalid:ww.prototype.isInvalid};return ww.prototype.init.apply(e,[].slice.call(arguments)),ww.prototype.isDark.call(e)},ww.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const kw={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 ww(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new ww(e);return 0===t.getAlpha()?this.DARK_GREY:ww.getBestContrast(t,new ww(kw.LIGHT_GREY),new ww(kw.DARK_GREY))},getBestContrast:(e,t,n)=>ww.getBestContrast(new ww(e),new ww(t),new ww(n)),getContrastingTransparent(e){const t=new ww(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const Mw={createSettings:function(e,t,n,r,i,o){const{theme:a}=e.environment,s=a.getColorPickerColor(t.color.bar.paletteColor),u=Wx.getDerivedBinSize(t),l=[],c=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(l.push(o.box.trigger),c.push.apply(c,o.box.consume)),l.push(n.trigger),{key:"box-marker",settings:{box:{fill:s,stroke:kw.getContrastingGrey(s).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:l,consume:c},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+u},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const _w={createSettings:function(e,t){const n=t.getColorPickerColor(e.color.bar.paletteColor);return{settings:{sources:[{strategy:{settings:{labels:[{placements:[{},{fill:kw.getInverse(n)}]}]}}}]}}}};function Sw(e){return wv(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const qw={createChartSettings:function(e,t){const n=e.isRtl(),r=wv(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,a=Fb.create({chartID:"object.histogram",theme:i,isRtl:n});let s={},u={},l={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),s=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),u=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:Sw(t)}),l=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const c={box:{}};e._tooltipHandler.isOn()&&(c.box=e._tooltipHandler.setUp({chartBuilder:a,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t)),h={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=uw.create(h,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),a.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:fw.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:cw.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines});const d=a.getSettings(),p=Mw.createSettings(e,t,s,u,l,c);if(a.addComponent("box-marker",p),t.dataPoint&&t.dataPoint.showLabels){const e=_w.createSettings(t,i);a.addComponent("labels",e)}return e.addSnapshotChartSettings(d,t),d.scales.rangeSelSettings={type:"linear",min:d.scales.dimension.min,max:d.scales.dimension.max,source:"qDimensionInfo/0"},d}};const Dw=$b.extend("Histogram",{namespace:".histogram",init:function({environment:e,lasso:t,picasso:n,$element:r,backendApi:i,selectionsApi:o,renderState:a}){this._super(n,r,e,i,o),this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Ex,this._selectionHandler=Qb.create({model:i.model,chartInstance:this.chartInstance,selectionsApi:o,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:t}),this._tooltipHandler=hx.create(this.chartInstance,r,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return qw.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=wv(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Zx.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const a={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Qx.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(a)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(a))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class Cw{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var Ew={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},u=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},l=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,f=arguments[0],h=1,d=arguments.length,p=!1;for("boolean"==typeof f&&(p=f,f=arguments[1]||{},h=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});h<d;++h)if(null!=(t=arguments[h]))for(n in t)r=c(f,n),f!==(i=c(t,n))&&(p&&i&&(u(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&u(r)?r:{},l(f,{name:n,newValue:e(p,a,i)})):void 0!==i&&l(f,{name:n,newValue:i}));return f}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},u=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},l=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,f=arguments[0],h=1,d=arguments.length,p=!1;for("boolean"==typeof f&&(p=f,f=arguments[1]||{},h=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});h<d;++h)if(null!=(t=arguments[h]))for(n in t)r=c(f,n),f!==(i=c(t,n))&&(p&&i&&(u(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&u(r)?r:{},l(f,{name:n,newValue:e(p,a,i)})):void 0!==i&&l(f,{name:n,newValue:i}));return f}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),u="".concat(" ",")").concat(" ");function l(e){return s+e+u}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var u=a.qFieldDefs[s];if(u.qName===i)return u}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function f(e){return!(!e.fullAccumulation&&!e.fullRange)}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,u=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var l=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(l,">}").concat(u,")")}if(r&&2===r.length){var f=c(r[0],i),h=c(r[1],i),d=p(0),g=p(1),m=y(f,d),v=y(h,g);return"".concat(a,"({1<").concat(m,",").concat(v,">}").concat(u,")")}return"".concat(a,"({1}").concat(u,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:f,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=l(d(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),u=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(u,")")}if(r&&2===r.length){var f=p(0),h=p(1);return"If(Count(".concat(f,") * Count(").concat(h,") > 0, ").concat(a," + ").concat(s).concat(u,")")}return a},getRowNoComp:h,getNumStepComp:function(e,t){if(!f(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix: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,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:l,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var M=i.a.bind(null,!0),_={},S=Array.isArray;function q(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function D(e){return void 0===e}function C(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=D(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(q(e)&&q(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||C(t,i)||(D(a)?r.push({op:"add",path:s,value:o}):q(o)&&q(a)?r=r.concat(_.generate(a,o,s)):S(o)&&S(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&D(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!D(t[0])&&D(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(_.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var u=0,l=t.length;u<l;u+=1)-1===(o=a(i,t[u].qInfo&&t[u].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(u),value:t[u]}),i.splice(u,0,t[u])):o!==u&&(r.push({op:"move",path:"".concat(n,"/").concat(u),from:"".concat(n,"/").concat(o)}),i.splice(u,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!C(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},_.apply=function(e,t){t.forEach((function(t){var n,r=E(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var s,u=t.value.slice();o.length=0,(s=o).push.apply(s,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")}()}(u))}else if(q(o)&&q(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),M(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var l=E(e,t.from);S(r)?r.splice(+i,0,l.splice(+a,1)[0]):(r[i]=l[a],delete l[a])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return M({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):M(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=w.getNumStepComp(n,u),h=w.getAboveComp(n,u,c,f),d=w.getRangeComp("RangeSum",h);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(l,1),g=w.getDimComp(l,0),m=w.getAggrComp(d,p,g);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:l,dimensionAndFieldList:s,valueComp:m}):m}return d},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(I(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(I(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}}}},j="movingAverage";function F(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,u=e.dimensionAndFieldList;if(!r)return n;var l=s;void 0===l&&(l=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),f=r.showExcludedValues&&r.nullSuppression,h=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:u,treatMissingAsNull:f}),d=w.getNumStepComp(r,l),p=w.getAboveComp(r,l,h,d);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,l);t="".concat(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:u,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=F(t,e);return o&&!o.disabled}}}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=w.getAboveComp(n,u,c),h="".concat(c," - ").concat(f);if(w.needDimension({modifier:n,properties:r,layout:i})){var d=w.getDimComp(l,1),p=w.getDimComp(l,0),g=w.getAggrComp(h,d,p);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:l,dimensionAndFieldList:s,funcComp:"Only",valueComp:g}):g}return h},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(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(U(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(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}}}},K={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:K.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:K.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var u=o;void 0===u&&(u=w.getNumDimensions({properties:r,layout:i}));var l=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:l,dimensionAndFieldList:s}),f=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),u=ie(t,n,r),l=""===s&&""===u?"":s||u,c=oe(i,o),f=ae(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(l," ").concat(c).concat(f," Aggr(").concat(l," ").concat(e,", ").concat(h,"))")}(c,f,n.field,n.value,h,u,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},ue={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},le={initBase:function(e,t){(t||le.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){le.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=le;function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var he={accumulation:L,movingAverage:B,difference:Y,normalization:se},de=(t.default={modifiers:he,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&de[e.id]&&de[e.id].masterItemSubscriber&&(de[e.id].masterItemSubscriber&&de[e.id].masterItemSubscriber.unsubscribe(),delete de[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return he[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return he[e]&&he[e].isApplicable({properties:n,layout:r})}))},measureBase:ue,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ce({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;de[t.id]=de[t.id]||{isFirstTime:!0};var u=de[t.id].isFirstTime;if(de[t.id].isFirstTime=!1,n&&"object"===fe(n))return ge({model:t,properties:n});var l=t?t.layout:void 0,c=a(l,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var f=a(l,"qHyperCube.qMeasureInfo"),h=de[t.id].lastReloadTime;if(de[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:f,layout:l})){var d=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return De({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:l,model:t,lastReloadTime:h});return d||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:l,masterItem:s,isFirstTime:u})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Me(n);var r=Oe(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return d&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(De({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(n++,"object"!==fe(he[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=he[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===fe(e.base)}))}(f)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,u=void 0!==s&&s,l=e.masterItem,c=e.libraryItemsProps,f=e.dimensionAndFieldList;void 0===n&&(n=u?i()(!0,{},r):r),Me(r);var h=Oe(r);return Ie({model:t,libraryIds:h,masterItem:l}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var u=o?void 0:Oe(n);return Ee({model:r,dimensionAndFieldList:s}).then((function(e){return Ae({libraryIds:u,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ce({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var u=t.qDef,l=u.modifiers,c=u.base;Array.isArray(l)&&l.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(s++,"object"!==fe(he[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");he[e.type].initModifier(e);var u=t.qLibraryId||c&&c.qLibraryId;u?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,u=he[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=u,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:u,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof he[n.type].updateModifier&&he[n.type].updateModifier(n,r.qHyperCubeDef);var a=ue.getExpression(t),s=he[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(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:r,dimensionAndFieldList:e}),_e(t)):me(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:f}).then((function(){return u?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&!he[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({modifiers:we(e),properties:n,layout:r})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(he[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||he[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ke(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Me(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&ke(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===fe(t)&&(t.disabled||!he[t.type]&&ke(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function qe(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function De(e){var t=e.measure,n=e.properties,r=e.layout;return!qe(t)&&Ce({modifiers:we(t),properties:n,layout:r})}function Ce(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==fe(e)||e.disabled||!he[e.type])&&(void 0===i[e.type]&&(i[e.type]=he[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&he[e.type]&&he[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Oe(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ce({modifiers:r,properties:e})){var o=qe(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(de[t.id].masterItemSubscriber=de[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function u(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function l(e){var t=e.qInfo.qId;if(r[t]){var i=u(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(l),enabled:!1,properties:u(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),de[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var f={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},h=n(1),d=n.n(h),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,u=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");u&&(s=i.excludedDimensions).push.apply(s,a(u))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,u(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,u(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&f.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){d.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var m=n(0),y=n.n(m);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 k(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(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 M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var u=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}for(t=0;t<s.excludedDimensions.length;++t){var l=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var u=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}for(t=0;t<s.excludedMeasures.length;++t){var l=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),u=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,u,0),maxMeasures:s,minMeasures:u}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(f.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,f.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=k(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=_(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function D(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var C={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),u=s.qHyperCubeDef;return u.qInterColumnSortOrder||(u.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:u}),p.addMeasures({exportFormat:i,qHyperCubeDef:u}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:u}),delete u.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=u,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,u=void 0===s?{}:s,l=e.hypercubePath,c=e.extension,f=e.supportedFilters,h=void 0===f||f,d=e.isHCModifierSupported,p=void 0===d||d,g={qChildren:[]},m=q.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:l}),y=o.getValue(r,l||"").qHyperCubeDef,v=o.getValue(m,l||"").qHyperCubeDef,b=q.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,k=b.maxMeasures,M=b.minMeasures,_=u.defaultDimension,S=void 0===_?q.getDefaultDimension():_,C=u.defaultMeasure,E=void 0===C?q.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,q.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M})&&q.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M,newHyperCubeDef:v}),q.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),q.addMeasures({exportFormat:t,maxMeasures:k,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),q.updateDimensionsOnAdded({newProperties:m,dataDefinition:a,hypercubePath:l}),q.updateMeasuresOnAdded({newProperties:m,dataDefinition:a,hypercubePath:l}),q.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),q.copyPropertyIfExist("qMaxStackedCells",y,v),q.copyPropertyIfExist("qNoOfLeftDims",y,v),q.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),q.copyPropertyOrSetDefault("qMode",y,v,"S"),q.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),q.copyPropertyOrSetDefault("qSortbyYValue",y,v),q.copyPropertyOrSetDefault("qIndentMode",y,v),q.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),q.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(c||{},"support.modifiers");return q.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),h&&D(g.qProperty,"storedFilters"),"S"===v.qMode&&p&&D(g.qProperty,"dynamicScript"),g}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function T(e,t){return e.length!==t}var N={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,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(A(a,t,r,i),T(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=f.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=N.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var u=r[r.length-1];if(u){var l=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(l){var d=N.create(N.IDMAP.COLOR_BY_ALTERNATIVE);switch(l.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:l,isDimension:n,qNumFormat:c,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=f.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:d,measures:a,item:l,isDimension:n,qNumFormat:c,isCustomFormatted:h})}n?(d.qSortBy={qSortByAscii:1},u.qAttributeDimensions.push(d)):u.qAttributeExpressions.push(d)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:d.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return d.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=R.getItemLabel(t);switch(F(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,a=f.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=N.IDMAP.COLOR_BY_ALTERNATIVE,s=f.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},K={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=C.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),u=N.IDMAP,l=u.COLOR_BY_ALTERNATIVE,c=u.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(a,[],"qAttributeDimensions",l),N.moveByIdFromGroup(a,[],"qAttributeExpressions",l),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,u=e.supportedFilters,l=e.isHCModifierSupported,c=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:u,isHCModifierSupported:l}),f=c.qProperty,h=o.getValue(f,"visualization"),d=o.getValue(f,"qHyperCubeDef.qDimensions",[]),p=o.getValue(f,"color.mode",""),g=o.getValue(f,"color.auto",""),m=Y.getCanColorBy(f,h),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:d});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:f})&&Y.addColorByExpression(f):Y.switchToAutoColor(f),y&&Y.updateColorBy(f,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(f)&&Y.changeProperty(f,"color.persistent",!0),Y.deleteTotalMode(d),c}},X=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?D(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):D(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var u=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);u.length?(o&&(t=u.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=u.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=K.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(g(s,"measureAxis.min","supportedAutoMinMax"),g(s,"measureAxis.max","supportedAutoMinMax")):(g(s,"measureAxis.min","unsupportedAutoMinMax"),g(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,u=e.supportedFilters,l=e.isHCModifierSupported,c=K.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:u,isHCModifierSupported:l}),f=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:f}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:f,measureType:a}),G.setInterColumnSortOrder(f.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var u=o.getValue(i,"qDef.cId");u||(u=o.generateId(),o.setValue(i,"qDef.cId",u));var l=Z(n,r,u);o.setValue(t,l,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var u=Z(n,r,s),l=o.getValue(t,u);void 0!==l&&(o.setValue(i,a,l),o.setValue(t,u,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}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:C,colorChart:K,axisChart:J,quarantineProperty:g,unquarantineProperty:D,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Ew);var Aw=n(Ew.exports);var Tw={onChangeCalcCond:function(e){var t,n;const r=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(n=t.box)||void 0===n?void 0:n.qHyperCubeDef;r&&i&&(i.qCalcCond=r.qCalcCond,i.qCalcCondition=r.qCalcCondition)}};const Nw=e=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e}),Rw="maxCount",Ow="size";function Iw(e){return!(e.bins&&e.bins.auto)}function Pw(e){return Iw(e)&&e.bins.binMode===Rw}function Lw(e){var t,n;const{translator:r}=e,i=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),o=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("HISTOGRAM_BKG_OPTIONS"),a=e.anything.sense.theme,s={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},u={type:"items",translation:"properties.presentation",items:{styleEditor:i&&Nw(o),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},l={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===wv(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===wv(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=wv(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=wv(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},bins:{translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!Iw(e)},mode:{ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:Rw,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:Ow,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:Rw,show:e=>Iw(e)},binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Wx.isEmpty(r)?Wx.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:Pw},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=wv(e,"bins.binCount"),n="object"==typeof t;return Pw(e)&&!Wx.isEmpty(t)&&!n&&!Vx(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=wv(e,"bins.binCount");return!!(Pw(e)&&!Wx.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>Iw(e)&&e.bins.binMode===Ow,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>Iw(e)&&e.bins.binMode===Ow,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Tw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{uses:"settings",items:{simpleLabels:l,presentation:u,colors:s,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}}}}}var jw={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var Fw={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};function zw(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Lw(e),softDefinition:jw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=Cy(e);r.mapProperties();const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Aw.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:a,hypercubePath:i})},exportProperties:(e,t,n)=>Aw.hypercube.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties:e=>Aw.hypercube.exportProperties({propertyTree:e,hypercubePath:"qUndoExclude.box"}),getExportRawDataOptions:Fw.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=_y(),r=Cy(t);return{qae:{properties:Dy,data:{targets:[r]}},ext:zw(t),component(){const t=e.useConstraints(),r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),a=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:a})),[t,n,i.direction,i.freeResize,a.language(),o.name(),r])}(),a=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),a=!!e.useLayout().qSelectionInfo.qInSelections,[s]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Sy,hidden:!n||!a,active:i,action(){o((e=>!e))}})),[a,i,n]),s.enabled=()=>n,s.active=()=>i,s}(),s=e.useModel(),u=e.useSelections(),l=e.useStaleLayout(),c=e.useRenderState(),[f,h]=e.useState();e.useEffect((()=>{const e=i(r),t=new Cw(s),l=new Dw({$element:e,backendApi:t,environment:o,lasso:a,picasso:n,selectionsApi:u,renderState:c});return h(l),()=>{l.destroy()}}),[]);const[,d]=e.usePromise((async()=>{f&&(f.updateEnvironment(o),f.updateConstraints(t),await f.updateData(l),await f.paint())}),[l,f,o]);if(d)throw d;var p;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),p=f,e.onTakeSnapshot((e=>{if(p)return p.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(p)return p.getViewState()}})),[p])}}}}));
43
43
  //# sourceMappingURL=sn-histogram.js.map