@nebula.js/sn-waterfall 0.36.1 → 0.36.2
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.
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/sn-waterfall.js +3 -3
- package/dist/sn-waterfall.js.map +1 -1
- package/dist/sn-waterfall.systemjs.js +4 -4
- package/dist/sn-waterfall.systemjs.js.map +1 -1
- package/package.json +2 -2
package/dist/sn-waterfall.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-waterfall v0.36.
|
|
2
|
+
* @nebula.js/sn-waterfall v0.36.2
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -21,7 +21,7 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.le
|
|
|
21
21
|
* http://hammerjs.github.io/
|
|
22
22
|
*
|
|
23
23
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
24
|
-
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=g((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),y=g((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||i,t):e}function w(e,t){return e===i?t:e}function M(e,t,n){p(D(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(D(t),(function(t){e.removeEventListener(t,n,!1)}))}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function D(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 C(e){return Array.prototype.slice.call(e,0)}function E(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];q(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var T=1;function N(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==i,I=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",P="mouse",j=25,z=1,F=4,H=8,V=1,B=2,$=4,W=8,U=16,Y=B|$,X=W|U,G=Y|X,K=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=t&z&&r-o==0,a=t&(F|H)&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=te(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=ie(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==z&&o.eventType!==F||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=re(t.deltaX,t.deltaY);var d=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(a.pointers,r):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>j||a.velocity===i)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=ne(l,c,h);r=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=re(c,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;_(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function re(e,t){return e===t?V:u(e)>=u(t)?e<0?B:$:t<0?W:U}function ie(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function oe(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)}};var se={mousedown:z,mousemove:2,mouseup:F},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}v(ce,Z,{handler:function(e){var t=se[e.type];t&z&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=F),this.pressed&&(t&F&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var ue={pointerdown:z,pointermove:2,pointerup:F,pointercancel:H,pointerout:H},he={2:L,3:"pen",4:P,5:"kinect"},de="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=de,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(de="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),v(pe,Z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ue[r],o=he[e.pointerType]||e.pointerType,s=o==L,a=q(t,e.pointerId,"pointerId");i&z&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):i&(F|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ge={touchstart:z,touchmove:2,touchend:F,touchcancel:H};function me(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=C(e.touches),r=C(e.changedTouches);return t&(F|H)&&(n=E(n.concat(r),"identifier",!0)),[n,r]}v(me,Z,{handler:function(e){var t=ge[e.type];if(t===z&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(F|H)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}});var ve={touchstart:z,touchmove:2,touchend:F,touchcancel:H},be="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=C(e.touches),r=this.targetIds;if(t&(2|z)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=C(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return _(e.target,l)})),t===z)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(F|H)&&delete r[s[i].identifier],i++;return a.length?[E(o.concat(a),"identifier",!0),a]:void 0}v(xe,Z,{handler:function(e){var t=ve[e.type],n=we.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}});var Me=2500;function ke(){Z.apply(this,arguments);var e=b(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e,t){e&z?(this.primaryTouch=t.changedPointers[0].identifier,Se.call(this,t)):e&(F|H)&&Se.call(this,t)}function Se(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),Me)}}function De(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}v(ke,Z,{handler:function(e,t,n){var r=n.pointerType==L,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)_e.call(this,t,n);else if(i&&De.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var qe=A(a.style,"touchAction"),Ce=qe!==i,Ee="compute",Ae="auto",Te="manipulation",Ne="none",Re="pan-x",Oe="pan-y",Ie=function(){if(!Ce)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 Le(e,t){this.manager=e,this.set(t)}Le.prototype={set:function(e){e==Ee&&(e=this.compute()),Ce&&this.manager.element.style&&Ie[e]&&(this.manager.element.style[qe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,Ne))return Ne;var t=S(e,Re),n=S(e,Oe);if(t&&n)return Ne;if(t||n)return t?Re:Oe;if(S(e,Te))return Te;return Ae}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,Ne)&&!Ie[Ne],o=S(r,Oe)&&!Ie[Oe],s=S(r,Re)&&!Ie[Re];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&n&Y||s&&n&X?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Pe=1,je=32;function ze(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Pe,this.simultaneous={},this.requireFail=[]}function Fe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function He(e){return e==U?"down":e==W?"up":e==B?"left":e==$?"right":""}function Ve(e,t){var n=t.manager;return n?n.get(e):e}function Be(){ze.apply(this,arguments)}function $e(){Be.apply(this,arguments),this.pX=null,this.pY=null}function We(){Be.apply(this,arguments)}function Ue(){ze.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Be.apply(this,arguments)}function Xe(){Be.apply(this,arguments)}function Ge(){ze.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ke(e,t){return(t=t||{}).recognizers=w(t.recognizers,Ke.defaults.preset),new Je(e,t)}ze.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ve(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Ve(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ve(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Ve(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+Fe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Fe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=je},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(je|Pe)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=je);56&this.state&&(this.state=Pe),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Be,ze,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&H||!i)?16|t:r||i?n&F?8|t:2&t?4|t:2:je}}),v($e,Be,{defaults:{event:"pan",threshold:10,pointers:1,direction:G},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&X&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&Y?(i=0===o?V:o<0?B:$,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?V:s<0?W:U,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(We,Be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Ue,ze,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(F|H)&&!i)this.reset();else if(e.eventType&z)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&F)return 8;return je},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&F?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(Ye,Be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Xe,Be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|X,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|X)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&X&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&F},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Ge,ze,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&z&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=F)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return je},failTimeout:function(){return this._timer=d((function(){this.state=je}),this.options.interval,this),je},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ke.VERSION="2.0.7",Ke.defaults={domEvents:!1,touchAction:Ee,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Xe,{direction:Y}],[$e,{direction:Y},["swipe"]],[Ge],[Ge,{event:"doubletap",taps:2},["tap"]],[Ue]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Ke.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?pe:I?xe:R?ke:ce))(n,Q),this.touchAction=new Le(this,this.options.touchAction),Ze(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ze(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=A(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ze)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=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 p(D(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(D(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(Ke,{INPUT_START:z,INPUT_MOVE:2,INPUT_END:F,INPUT_CANCEL:H,STATE_POSSIBLE:Pe,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:je,DIRECTION_NONE:V,DIRECTION_LEFT:B,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:X,DIRECTION_ALL:G,Manager:Je,Input:Z,TouchAction:Le,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:ke,SingleTouchInput:me,Recognizer:ze,AttrRecognizer:Be,Tap:Ge,Pan:$e,Swipe:Xe,Pinch:We,Rotate:Ye,Press:Ue,on:M,off:k,each:p,merge:y,extend:m,assign:o,inherit:v,bindFn:b,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ke,"function"==typeof i&&i.amd?i((function(){return Ke})):e.exports?e.exports=Ke:t.Hammer=Ke}(window,document)}(Cm);var Em=n(Cm.exports);function Am(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Nm(e){const t=jp();return t.renderer.prio([e||"canvas"]),t.use(_m),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",qm(e))};e.interaction("hammer",qm(Hammer))}(Em)),t.use(Am),t.component("disclaimer",Tm),t}const Rm={version:"0.36.1",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qInitialDataFetch:[{qWidth:200,qHeight:10}],qSuppressMissing:!0},color:{auto:!0,positiveValue:{paletteColor:{index:6,color:null}},negativeValue:{paletteColor:{index:-1,color:"#cc6677"}},subtotal:{paletteColor:{index:-1,color:"#c3c3c3"}}},dataPoint:{showLabels:!0},dimensionAxis:{dock:"near",label:"auto",show:"labels"},gridlines:{auto:!0,spacing:2},legend:{dock:"auto",show:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"labels",spacing:1},qDef:{qNumFormat:{},numFormatFromTemplate:!0,isCustomFormatted:!1},refLine:{refLines:[]},showTitles:!0,subtitle:"",title:"",footnote:""};function Om(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:50,description:()=>t.get("Visualizations.Descriptions.Bars")}}}var Im=Object.prototype.hasOwnProperty,Lm=Object.prototype.toString,Pm=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,zm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Lm.call(e)},Fm=function(e){if(!e||"[object Object]"!==Lm.call(e))return!1;var t,n=Im.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Im.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Im.call(e,t)},Hm=function(e,t){Pm&&"__proto__"===t.name?Pm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Vm=function(e,t){if("__proto__"===t){if(!Im.call(e,t))return;if(jm)return jm(e,t).value}return e[t]},Bm=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Vm(a,n),a!==(i=Vm(t,n))&&(u&&i&&(Fm(i)||(o=zm(i)))?(o?(o=!1,s=r&&zm(r)?r:[]):s=r&&Fm(r)?r:{},Hm(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Hm(a,{name:n,newValue:i}));return a},$m=n(Bm),Wm={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},s=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function 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,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=y(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),g=p(1),m=y(h,f),v=y(d,g);return"".concat(s,"({1<").concat(m,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix: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],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=i.a.bind(null,!0),_={},S=Array.isArray;function D(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function q(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]=q(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(D(e)&&D(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?k({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);A(o,s)||C(t,i)||(q(s)?r.push({op:"add",path:a,value:o}):D(o)&&D(s)?r=r.concat(_.generate(s,o,a)):S(o)&&S(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&q(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(!q(t[0])&&q(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){q(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,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(D(o)&&D(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),k(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var c=E(e,t.from);S(r)?r.splice(+i,0,c.splice(+s,1)[0]):(r[i]=c[s],delete c[s])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return k({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):k(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var L={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},P={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),g=w.getDimComp(c,0),m=w.getAggrComp(f,p,g);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,L)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(I(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(I(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},j="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function F(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},V={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,d,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(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(F(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(F(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(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(F(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=z(t,e);return o&&!o.disabled}};return n}},B="difference";function $(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),g=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return d},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(W(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(W(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(W(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},G={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},K="normalization";function J(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===K)return n[r]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===K)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:G.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:G.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:G.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:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var 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:G.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=re(t),l=ie(t,n,r),c=""===a&&""===l?"":a||l,u=oe(i,o),h=se(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:G.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)===G.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(K))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var de={accumulation:P,movingAverage:V,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);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,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===he(n))return ge({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return qe({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);ke(n);var r=Oe(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(qe({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),ke(r);var d=Oe(r);return Ie({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ee({model:r,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,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,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===he(e)&&!e.disabled){if(a++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,r.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||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:u,dimensionAndFieldList:h}).then((function(){return l?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return 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(de[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ke(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&Me(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function De(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function qe(e){var t=e.measure,n=e.properties,r=e.layout;return!De(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"!==he(e)||e.disabled||!de[e.type])&&(void 0===i[e.type]&&(i[e.type]=de[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 s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[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=De(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=s(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var m=n(0),y=n.n(m);function 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 M(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var D={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=x(s.max,i.dimensions.length,w),l=x(s.min,i.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=M(i.qDimensions);i.qDimensions=[],s.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=_(i.qMeasures);i.qMeasures=[],s.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function q(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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:s}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=D.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(m,c||"").qHyperCubeDef,b=D.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,M=b.maxMeasures,k=b.minMeasures,_=l.defaultDimension,S=void 0===_?D.getDefaultDimension():_,C=l.defaultMeasure,E=void 0===C?D.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,D.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&D.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:v}),D.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),D.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:v,defaultMeasure:E}),D.updateDimensionsOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),D.updateMeasuresOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),D.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),D.copyPropertyIfExist("qMaxStackedCells",y,v),D.copyPropertyIfExist("qNoOfLeftDims",y,v),D.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),D.copyPropertyOrSetDefault("qMode",y,v,"S"),D.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),D.copyPropertyOrSetDefault("qSortbyYValue",y,v),D.copyPropertyOrSetDefault("qIndentMode",y,v),D.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),D.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(u||{},"support.modifiers");return D.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&q(g.qProperty,"storedFilters"),"S"===v.qMode&&p&&q(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=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var N={create:function(e,t){if(!e||!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 s=e[o][n],a=t.length;if(A(s,t,r,i),T(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},L={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 P(e,t,n){if(Array.isArray(e[t])){var r=h.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){P(e,"qAttributeDimensions",n),P(e,"qAttributeExpressions",n)})),t.forEach((function(e){P(e,"qAttributeDimensions",n),P(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function F(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;j(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=N.create(N.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;i||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=i,a.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}var V={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function B(e,t,n,r){var i=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&V.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return B(e,H("dimension",!!s,s||r)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,B(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;F({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,B(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=N.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return B(e,H("measure",!!a,a||r[0])),!!a}(e,t))return;F({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=(L[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,a):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={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],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=N.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(s,[],"qAttributeDimensions",c),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),N.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),g=o.getValue(h,"color.auto",""),m=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},G=["bar","marker","line"],K={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?q(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):q(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),G.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(g(a,"measureAxis.min","supportedAutoMinMax"),g(a,"measureAxis.max","supportedAutoMinMax")):(g(a,"measureAxis.min","unsupportedAutoMinMax"),g(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return K.handleAutoMinMax({initialProperties:n,properties:h}),K.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),K.setInterColumnSortOrder(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Z(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Z(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:C,colorChart:X,axisChart:J,quarantineProperty:g,unquarantineProperty:q,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Wm);var Um=n(Wm.exports);function Ym({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=Um.hypercube.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return"all"===o.dimensionAxis.show?o.dimensionAxis.show="labels":"title"===o.dimensionAxis.show&&(o.dimensionAxis.show="none"),"all"===o.measureAxis.show?o.measureAxis.show="labels":"title"===o.measureAxis.show&&(o.measureAxis.show="none"),o.qHyperCubeDef.qMeasures.length>0&&(o.qDef.numFormatFromTemplate=o.qHyperCubeDef.qMeasures[0].qDef.numFormatFromTemplate,o.qDef.qNumFormat=o.qHyperCubeDef.qMeasures[0].qDef.qNumFormat,o.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.numFormatFromTemplate=o.qDef.numFormatFromTemplate,e.qDef.qNumFormat=$m(!0,{},o.qDef.qNumFormat)}))),o.qHyperCubeDef.qSuppressZero=!1,i}function Xm({propertyTree:e,viewDataMode:t}){return Um.hypercube.exportProperties({propertyTree:e,viewDataMode:t})}var Gm=e=>{const t=Om(e);return{properties:Rm,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Ym({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Xm}};function Km(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Zm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jm(e){return function(e){if(Array.isArray(e))return Qm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Zm(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 Zm(e,t){if(e){if("string"==typeof e)return Qm(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)?Qm(e,t):void 0}}function Qm(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 ey,ty=Object.prototype.hasOwnProperty,ny=Object.prototype.toString,ry=Object.defineProperty,iy=Object.getOwnPropertyDescriptor,oy=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ny.call(e)},sy=function(e){if(!e||"[object Object]"!==ny.call(e))return!1;var t,n=ty.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ty.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ty.call(e,t)},ay=function(e,t){ry&&"__proto__"===t.name?ry(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ly=function(e,t){if("__proto__"===t){if(!ty.call(e,t))return;if(iy)return iy(e,t).value}return e[t]};function cy(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hy(){}ey=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=ly(a,n),a!==(i=ly(t,n))&&(u&&i&&(sy(i)||(o=oy(i)))?(o?(o=!1,s=r&&oy(r)?r:[]):s=r&&sy(r)?r:{},ay(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&ay(a,{name:n,newValue:i}));return a},ey&&ey.__esModule&&Object.prototype.hasOwnProperty.call(ey,"default")&&ey.default;var dy=1/.7,fy="\\s*([+-]?\\d+)\\s*",py="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",my=/^#([0-9a-f]{3,8})$/,yy=new RegExp(`^rgb\\(${fy},${fy},${fy}\\)$`),vy=new RegExp(`^rgb\\(${gy},${gy},${gy}\\)$`),by=new RegExp(`^rgba\\(${fy},${fy},${fy},${py}\\)$`),xy=new RegExp(`^rgba\\(${gy},${gy},${gy},${py}\\)$`),wy=new RegExp(`^hsl\\(${py},${gy},${gy}\\)$`),My=new RegExp(`^hsla\\(${py},${gy},${gy},${py}\\)$`),ky={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 _y(){return this.rgb().formatHex()}function Sy(){return this.rgb().formatRgb()}function Dy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=my.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qy(t):3===n?new Ty(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Cy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Cy(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=yy.exec(e))?new Ty(t[1],t[2],t[3],1):(t=vy.exec(e))?new Ty(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=by.exec(e))?Cy(t[1],t[2],t[3],t[4]):(t=xy.exec(e))?Cy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=wy.exec(e))?Py(t[1],t[2]/100,t[3]/100,1):(t=My.exec(e))?Py(t[1],t[2]/100,t[3]/100,t[4]):ky.hasOwnProperty(e)?qy(ky[e]):"transparent"===e?new Ty(NaN,NaN,NaN,0):null}function qy(e){return new Ty(e>>16&255,e>>8&255,255&e,1)}function Cy(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ty(e,t,n,r)}function Ey(e){return e instanceof hy||(e=Dy(e)),e?new Ty((e=e.rgb()).r,e.g,e.b,e.opacity):new Ty}function Ay(e,t,n,r){return 1===arguments.length?Ey(e):new Ty(e,t,n,null==r?1:r)}function Ty(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ny(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}`}function Ry(){const e=Oy(this.opacity);return`${1===e?"rgb(":"rgba("}${Iy(this.r)}, ${Iy(this.g)}, ${Iy(this.b)}${1===e?")":`, ${e})`}`}function Oy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Iy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ly(e){return((e=Iy(e))<16?"0":"")+e.toString(16)}function Py(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zy(e,t,n,r)}function jy(e){if(e instanceof zy)return new zy(e.h,e.s,e.l,e.opacity);if(e instanceof hy||(e=Dy(e)),!e)return new zy;if(e instanceof zy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new zy(s,a,l,e.opacity)}function zy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Fy(e){return(e=(e||0)%360)<0?e+360:e}function Hy(e){return Math.max(0,Math.min(1,e||0))}function Vy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}cy(hy,Dy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_y,formatHex:_y,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jy(this).formatHsl()},formatRgb:Sy,toString:Sy}),cy(Ty,Ay,uy(hy,{brighter(e){return e=null==e?dy:Math.pow(dy,e),new Ty(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ty(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ty(Iy(this.r),Iy(this.g),Iy(this.b),Oy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ny,formatHex:Ny,formatHex8:function(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}${Ly(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ry,toString:Ry})),cy(zy,(function(e,t,n,r){return 1===arguments.length?jy(e):new zy(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return e=null==e?dy:Math.pow(dy,e),new zy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new zy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ty(Vy(e>=240?e-240:e+120,i,r),Vy(e,i,r),Vy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new zy(Fy(this.h),Hy(this.s),Hy(this.l),Oy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Oy(this.opacity);return`${1===e?"hsl(":"hsla("}${Fy(this.h)}, ${100*Hy(this.s)}%, ${100*Hy(this.l)}%${1===e?")":`, ${e})`}`}}));const By=Math.PI/180,$y=180/Math.PI,Wy=4/29,Uy=6/29,Yy=3*Uy*Uy;function Xy(e){if(e instanceof Gy)return new Gy(e.l,e.a,e.b,e.opacity);if(e instanceof ev)return tv(e);e instanceof Ty||(e=Ey(e));var t,n,r=Qy(e.r),i=Qy(e.g),o=Qy(e.b),s=Ky((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Ky((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ky((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Gy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Gy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ky(e){return e>.008856451679035631?Math.pow(e,1/3):e/Yy+Wy}function Jy(e){return e>Uy?e*e*e:Yy*(e-Wy)}function Zy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Qy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ev(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function tv(e){if(isNaN(e.h))return new Gy(e.l,0,0,e.opacity);var t=e.h*By;return new Gy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}cy(Gy,(function(e,t,n,r){return 1===arguments.length?Xy(e):new Gy(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return new Gy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Gy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Ty(Zy(3.1338561*(t=.96422*Jy(t))-1.6168667*(e=1*Jy(e))-.4906146*(n=.82521*Jy(n))),Zy(-.9787684*t+1.9161415*e+.033454*n),Zy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),cy(ev,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ev)return new ev(e.h,e.c,e.l,e.opacity);if(e instanceof Gy||(e=Xy(e)),0===e.a&&0===e.b)return new ev(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$y;return new ev(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ev(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return new ev(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ev(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return tv(this).rgb()}}));var nv=e=>()=>e;function rv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):nv(isNaN(e)?t:e)}function iv(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}!function e(t){var n=function(e){return 1==(e=+e)?rv: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):nv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ay(e)).r,(t=Ay(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=rv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var ov,sv=["__proto__","constructor"];function av(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!sv.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function lv(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){e instanceof Map?(e=[void 0,e],void 0===t&&(t=hv)):void 0===t&&(t=uv);for(var n,r,i,o,s,a=new pv(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new pv(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(fv)}function uv(e){return e.children}function hv(e){return Array.isArray(e)?e[1]:null}function dv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function fv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function pv(e){this.data=e,this.depth=this.height=0,this.parent=null}pv.prototype=cv.prototype={constructor:pv,count:function(){return this.eachAfter(lv)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return cv(this).eachBefore(dv)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},ov=function(e){
|
|
24
|
+
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=g((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),y=g((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||i,t):e}function w(e,t){return e===i?t:e}function M(e,t,n){p(D(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(D(t),(function(t){e.removeEventListener(t,n,!1)}))}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function D(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 C(e){return Array.prototype.slice.call(e,0)}function E(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];q(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var T=1;function N(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==i,I=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",P="mouse",j=25,z=1,F=4,H=8,V=1,B=2,$=4,W=8,U=16,Y=B|$,X=W|U,G=Y|X,K=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=t&z&&r-o==0,a=t&(F|H)&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=te(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=ie(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==z&&o.eventType!==F||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=re(t.deltaX,t.deltaY);var d=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(a.pointers,r):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>j||a.velocity===i)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=ne(l,c,h);r=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=re(c,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;_(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function re(e,t){return e===t?V:u(e)>=u(t)?e<0?B:$:t<0?W:U}function ie(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function oe(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)}};var se={mousedown:z,mousemove:2,mouseup:F},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}v(ce,Z,{handler:function(e){var t=se[e.type];t&z&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=F),this.pressed&&(t&F&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var ue={pointerdown:z,pointermove:2,pointerup:F,pointercancel:H,pointerout:H},he={2:L,3:"pen",4:P,5:"kinect"},de="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=de,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(de="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),v(pe,Z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ue[r],o=he[e.pointerType]||e.pointerType,s=o==L,a=q(t,e.pointerId,"pointerId");i&z&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):i&(F|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ge={touchstart:z,touchmove:2,touchend:F,touchcancel:H};function me(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=C(e.touches),r=C(e.changedTouches);return t&(F|H)&&(n=E(n.concat(r),"identifier",!0)),[n,r]}v(me,Z,{handler:function(e){var t=ge[e.type];if(t===z&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(F|H)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}});var ve={touchstart:z,touchmove:2,touchend:F,touchcancel:H},be="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=C(e.touches),r=this.targetIds;if(t&(2|z)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=C(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return _(e.target,l)})),t===z)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(F|H)&&delete r[s[i].identifier],i++;return a.length?[E(o.concat(a),"identifier",!0),a]:void 0}v(xe,Z,{handler:function(e){var t=ve[e.type],n=we.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}});var Me=2500;function ke(){Z.apply(this,arguments);var e=b(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e,t){e&z?(this.primaryTouch=t.changedPointers[0].identifier,Se.call(this,t)):e&(F|H)&&Se.call(this,t)}function Se(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),Me)}}function De(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}v(ke,Z,{handler:function(e,t,n){var r=n.pointerType==L,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)_e.call(this,t,n);else if(i&&De.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var qe=A(a.style,"touchAction"),Ce=qe!==i,Ee="compute",Ae="auto",Te="manipulation",Ne="none",Re="pan-x",Oe="pan-y",Ie=function(){if(!Ce)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 Le(e,t){this.manager=e,this.set(t)}Le.prototype={set:function(e){e==Ee&&(e=this.compute()),Ce&&this.manager.element.style&&Ie[e]&&(this.manager.element.style[qe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,Ne))return Ne;var t=S(e,Re),n=S(e,Oe);if(t&&n)return Ne;if(t||n)return t?Re:Oe;if(S(e,Te))return Te;return Ae}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,Ne)&&!Ie[Ne],o=S(r,Oe)&&!Ie[Oe],s=S(r,Re)&&!Ie[Re];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&n&Y||s&&n&X?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Pe=1,je=32;function ze(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Pe,this.simultaneous={},this.requireFail=[]}function Fe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function He(e){return e==U?"down":e==W?"up":e==B?"left":e==$?"right":""}function Ve(e,t){var n=t.manager;return n?n.get(e):e}function Be(){ze.apply(this,arguments)}function $e(){Be.apply(this,arguments),this.pX=null,this.pY=null}function We(){Be.apply(this,arguments)}function Ue(){ze.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Be.apply(this,arguments)}function Xe(){Be.apply(this,arguments)}function Ge(){ze.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ke(e,t){return(t=t||{}).recognizers=w(t.recognizers,Ke.defaults.preset),new Je(e,t)}ze.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ve(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Ve(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ve(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Ve(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+Fe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Fe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=je},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(je|Pe)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=je);56&this.state&&(this.state=Pe),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Be,ze,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&H||!i)?16|t:r||i?n&F?8|t:2&t?4|t:2:je}}),v($e,Be,{defaults:{event:"pan",threshold:10,pointers:1,direction:G},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&X&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&Y?(i=0===o?V:o<0?B:$,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?V:s<0?W:U,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(We,Be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Ue,ze,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(F|H)&&!i)this.reset();else if(e.eventType&z)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&F)return 8;return je},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&F?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(Ye,Be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Xe,Be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|X,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|X)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&X&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&F},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Ge,ze,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&z&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=F)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return je},failTimeout:function(){return this._timer=d((function(){this.state=je}),this.options.interval,this),je},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ke.VERSION="2.0.7",Ke.defaults={domEvents:!1,touchAction:Ee,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Xe,{direction:Y}],[$e,{direction:Y},["swipe"]],[Ge],[Ge,{event:"doubletap",taps:2},["tap"]],[Ue]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Ke.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?pe:I?xe:R?ke:ce))(n,Q),this.touchAction=new Le(this,this.options.touchAction),Ze(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ze(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=A(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ze)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=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 p(D(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(D(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(Ke,{INPUT_START:z,INPUT_MOVE:2,INPUT_END:F,INPUT_CANCEL:H,STATE_POSSIBLE:Pe,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:je,DIRECTION_NONE:V,DIRECTION_LEFT:B,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:X,DIRECTION_ALL:G,Manager:Je,Input:Z,TouchAction:Le,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:ke,SingleTouchInput:me,Recognizer:ze,AttrRecognizer:Be,Tap:Ge,Pan:$e,Swipe:Xe,Pinch:We,Rotate:Ye,Press:Ue,on:M,off:k,each:p,merge:y,extend:m,assign:o,inherit:v,bindFn:b,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ke,"function"==typeof i&&i.amd?i((function(){return Ke})):e.exports?e.exports=Ke:t.Hammer=Ke}(window,document)}(Cm);var Em=n(Cm.exports);function Am(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Nm(e){const t=jp();return t.renderer.prio([e||"canvas"]),t.use(_m),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",qm(e))};e.interaction("hammer",qm(Hammer))}(Em)),t.use(Am),t.component("disclaimer",Tm),t}const Rm={version:"0.36.2",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qInitialDataFetch:[{qWidth:200,qHeight:10}],qSuppressMissing:!0},color:{auto:!0,positiveValue:{paletteColor:{index:6,color:null}},negativeValue:{paletteColor:{index:-1,color:"#cc6677"}},subtotal:{paletteColor:{index:-1,color:"#c3c3c3"}}},dataPoint:{showLabels:!0},dimensionAxis:{dock:"near",label:"auto",show:"labels"},gridlines:{auto:!0,spacing:2},legend:{dock:"auto",show:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"labels",spacing:1},qDef:{qNumFormat:{},numFormatFromTemplate:!0,isCustomFormatted:!1},refLine:{refLines:[]},showTitles:!0,subtitle:"",title:"",footnote:""};function Om(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:50,description:()=>t.get("Visualizations.Descriptions.Bars")}}}var Im=Object.prototype.hasOwnProperty,Lm=Object.prototype.toString,Pm=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,zm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Lm.call(e)},Fm=function(e){if(!e||"[object Object]"!==Lm.call(e))return!1;var t,n=Im.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Im.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Im.call(e,t)},Hm=function(e,t){Pm&&"__proto__"===t.name?Pm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Vm=function(e,t){if("__proto__"===t){if(!Im.call(e,t))return;if(jm)return jm(e,t).value}return e[t]},Bm=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Vm(a,n),a!==(i=Vm(t,n))&&(u&&i&&(Fm(i)||(o=zm(i)))?(o?(o=!1,s=r&&zm(r)?r:[]):s=r&&Fm(r)?r:{},Hm(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Hm(a,{name:n,newValue:i}));return a},$m=n(Bm),Wm={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},s=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function 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,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=y(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),g=p(1),m=y(h,f),v=y(d,g);return"".concat(s,"({1<").concat(m,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix: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],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=i.a.bind(null,!0),_={},S=Array.isArray;function D(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function q(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]=q(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(D(e)&&D(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?k({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);A(o,s)||C(t,i)||(q(s)?r.push({op:"add",path:a,value:o}):D(o)&&D(s)?r=r.concat(_.generate(s,o,a)):S(o)&&S(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&q(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(!q(t[0])&&q(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){q(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,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(D(o)&&D(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),k(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var c=E(e,t.from);S(r)?r.splice(+i,0,c.splice(+s,1)[0]):(r[i]=c[s],delete c[s])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return k({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):k(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var L={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},P={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),g=w.getDimComp(c,0),m=w.getAggrComp(f,p,g);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,L)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(I(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(I(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},j="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function F(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},V={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,d,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(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(F(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(F(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(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(F(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=z(t,e);return o&&!o.disabled}};return n}},B="difference";function $(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),g=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return d},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(W(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(W(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(W(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},G={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},K="normalization";function J(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===K)return n[r]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===K)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:G.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:G.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:G.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:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var 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:G.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=re(t),l=ie(t,n,r),c=""===a&&""===l?"":a||l,u=oe(i,o),h=se(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:G.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)===G.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(K))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var de={accumulation:P,movingAverage:V,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);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,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===he(n))return ge({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return qe({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);ke(n);var r=Oe(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(qe({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),ke(r);var d=Oe(r);return Ie({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ee({model:r,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,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,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===he(e)&&!e.disabled){if(a++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,r.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||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:u,dimensionAndFieldList:h}).then((function(){return l?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return 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(de[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ke(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&Me(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function De(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function qe(e){var t=e.measure,n=e.properties,r=e.layout;return!De(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"!==he(e)||e.disabled||!de[e.type])&&(void 0===i[e.type]&&(i[e.type]=de[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 s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[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=De(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=s(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var m=n(0),y=n.n(m);function 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 M(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var D={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=x(s.max,i.dimensions.length,w),l=x(s.min,i.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=M(i.qDimensions);i.qDimensions=[],s.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=_(i.qMeasures);i.qMeasures=[],s.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function q(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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:s}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=D.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(m,c||"").qHyperCubeDef,b=D.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,M=b.maxMeasures,k=b.minMeasures,_=l.defaultDimension,S=void 0===_?D.getDefaultDimension():_,C=l.defaultMeasure,E=void 0===C?D.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,D.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&D.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:v}),D.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),D.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:v,defaultMeasure:E}),D.updateDimensionsOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),D.updateMeasuresOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),D.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),D.copyPropertyIfExist("qMaxStackedCells",y,v),D.copyPropertyIfExist("qNoOfLeftDims",y,v),D.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),D.copyPropertyOrSetDefault("qMode",y,v,"S"),D.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),D.copyPropertyOrSetDefault("qSortbyYValue",y,v),D.copyPropertyOrSetDefault("qIndentMode",y,v),D.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),D.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(u||{},"support.modifiers");return D.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&q(g.qProperty,"storedFilters"),"S"===v.qMode&&p&&q(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=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var N={create:function(e,t){if(!e||!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 s=e[o][n],a=t.length;if(A(s,t,r,i),T(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},L={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 P(e,t,n){if(Array.isArray(e[t])){var r=h.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){P(e,"qAttributeDimensions",n),P(e,"qAttributeExpressions",n)})),t.forEach((function(e){P(e,"qAttributeDimensions",n),P(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function F(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;j(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=N.create(N.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;i||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=i,a.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}var V={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function B(e,t,n,r){var i=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&V.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return B(e,H("dimension",!!s,s||r)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,B(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;F({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,B(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=N.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return B(e,H("measure",!!a,a||r[0])),!!a}(e,t))return;F({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=(L[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,a):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={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],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=N.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(s,[],"qAttributeDimensions",c),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),N.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),g=o.getValue(h,"color.auto",""),m=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},G=["bar","marker","line"],K={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?q(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):q(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),G.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(g(a,"measureAxis.min","supportedAutoMinMax"),g(a,"measureAxis.max","supportedAutoMinMax")):(g(a,"measureAxis.min","unsupportedAutoMinMax"),g(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return K.handleAutoMinMax({initialProperties:n,properties:h}),K.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),K.setInterColumnSortOrder(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Z(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Z(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:C,colorChart:X,axisChart:J,quarantineProperty:g,unquarantineProperty:q,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Wm);var Um=n(Wm.exports);function Ym({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=Um.hypercube.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return"all"===o.dimensionAxis.show?o.dimensionAxis.show="labels":"title"===o.dimensionAxis.show&&(o.dimensionAxis.show="none"),"all"===o.measureAxis.show?o.measureAxis.show="labels":"title"===o.measureAxis.show&&(o.measureAxis.show="none"),o.qHyperCubeDef.qMeasures.length>0&&(o.qDef.numFormatFromTemplate=o.qHyperCubeDef.qMeasures[0].qDef.numFormatFromTemplate,o.qDef.qNumFormat=o.qHyperCubeDef.qMeasures[0].qDef.qNumFormat,o.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.numFormatFromTemplate=o.qDef.numFormatFromTemplate,e.qDef.qNumFormat=$m(!0,{},o.qDef.qNumFormat)}))),o.qHyperCubeDef.qSuppressZero=!1,i}function Xm({propertyTree:e,viewDataMode:t}){return Um.hypercube.exportProperties({propertyTree:e,viewDataMode:t})}var Gm=e=>{const t=Om(e);return{properties:Rm,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Ym({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Xm}};function Km(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Zm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jm(e){return function(e){if(Array.isArray(e))return Qm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Zm(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 Zm(e,t){if(e){if("string"==typeof e)return Qm(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)?Qm(e,t):void 0}}function Qm(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 ey,ty=Object.prototype.hasOwnProperty,ny=Object.prototype.toString,ry=Object.defineProperty,iy=Object.getOwnPropertyDescriptor,oy=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ny.call(e)},sy=function(e){if(!e||"[object Object]"!==ny.call(e))return!1;var t,n=ty.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ty.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ty.call(e,t)},ay=function(e,t){ry&&"__proto__"===t.name?ry(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ly=function(e,t){if("__proto__"===t){if(!ty.call(e,t))return;if(iy)return iy(e,t).value}return e[t]};function cy(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hy(){}ey=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=ly(a,n),a!==(i=ly(t,n))&&(u&&i&&(sy(i)||(o=oy(i)))?(o?(o=!1,s=r&&oy(r)?r:[]):s=r&&sy(r)?r:{},ay(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&ay(a,{name:n,newValue:i}));return a},ey&&ey.__esModule&&Object.prototype.hasOwnProperty.call(ey,"default")&&ey.default;var dy=1/.7,fy="\\s*([+-]?\\d+)\\s*",py="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",my=/^#([0-9a-f]{3,8})$/,yy=new RegExp(`^rgb\\(${fy},${fy},${fy}\\)$`),vy=new RegExp(`^rgb\\(${gy},${gy},${gy}\\)$`),by=new RegExp(`^rgba\\(${fy},${fy},${fy},${py}\\)$`),xy=new RegExp(`^rgba\\(${gy},${gy},${gy},${py}\\)$`),wy=new RegExp(`^hsl\\(${py},${gy},${gy}\\)$`),My=new RegExp(`^hsla\\(${py},${gy},${gy},${py}\\)$`),ky={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 _y(){return this.rgb().formatHex()}function Sy(){return this.rgb().formatRgb()}function Dy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=my.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qy(t):3===n?new Ty(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Cy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Cy(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=yy.exec(e))?new Ty(t[1],t[2],t[3],1):(t=vy.exec(e))?new Ty(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=by.exec(e))?Cy(t[1],t[2],t[3],t[4]):(t=xy.exec(e))?Cy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=wy.exec(e))?Py(t[1],t[2]/100,t[3]/100,1):(t=My.exec(e))?Py(t[1],t[2]/100,t[3]/100,t[4]):ky.hasOwnProperty(e)?qy(ky[e]):"transparent"===e?new Ty(NaN,NaN,NaN,0):null}function qy(e){return new Ty(e>>16&255,e>>8&255,255&e,1)}function Cy(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ty(e,t,n,r)}function Ey(e){return e instanceof hy||(e=Dy(e)),e?new Ty((e=e.rgb()).r,e.g,e.b,e.opacity):new Ty}function Ay(e,t,n,r){return 1===arguments.length?Ey(e):new Ty(e,t,n,null==r?1:r)}function Ty(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ny(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}`}function Ry(){const e=Oy(this.opacity);return`${1===e?"rgb(":"rgba("}${Iy(this.r)}, ${Iy(this.g)}, ${Iy(this.b)}${1===e?")":`, ${e})`}`}function Oy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Iy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ly(e){return((e=Iy(e))<16?"0":"")+e.toString(16)}function Py(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zy(e,t,n,r)}function jy(e){if(e instanceof zy)return new zy(e.h,e.s,e.l,e.opacity);if(e instanceof hy||(e=Dy(e)),!e)return new zy;if(e instanceof zy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new zy(s,a,l,e.opacity)}function zy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Fy(e){return(e=(e||0)%360)<0?e+360:e}function Hy(e){return Math.max(0,Math.min(1,e||0))}function Vy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}cy(hy,Dy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_y,formatHex:_y,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jy(this).formatHsl()},formatRgb:Sy,toString:Sy}),cy(Ty,Ay,uy(hy,{brighter(e){return e=null==e?dy:Math.pow(dy,e),new Ty(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ty(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ty(Iy(this.r),Iy(this.g),Iy(this.b),Oy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ny,formatHex:Ny,formatHex8:function(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}${Ly(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ry,toString:Ry})),cy(zy,(function(e,t,n,r){return 1===arguments.length?jy(e):new zy(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return e=null==e?dy:Math.pow(dy,e),new zy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new zy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ty(Vy(e>=240?e-240:e+120,i,r),Vy(e,i,r),Vy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new zy(Fy(this.h),Hy(this.s),Hy(this.l),Oy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Oy(this.opacity);return`${1===e?"hsl(":"hsla("}${Fy(this.h)}, ${100*Hy(this.s)}%, ${100*Hy(this.l)}%${1===e?")":`, ${e})`}`}}));const By=Math.PI/180,$y=180/Math.PI,Wy=4/29,Uy=6/29,Yy=3*Uy*Uy;function Xy(e){if(e instanceof Gy)return new Gy(e.l,e.a,e.b,e.opacity);if(e instanceof ev)return tv(e);e instanceof Ty||(e=Ey(e));var t,n,r=Qy(e.r),i=Qy(e.g),o=Qy(e.b),s=Ky((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Ky((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ky((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Gy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Gy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ky(e){return e>.008856451679035631?Math.pow(e,1/3):e/Yy+Wy}function Jy(e){return e>Uy?e*e*e:Yy*(e-Wy)}function Zy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Qy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ev(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function tv(e){if(isNaN(e.h))return new Gy(e.l,0,0,e.opacity);var t=e.h*By;return new Gy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}cy(Gy,(function(e,t,n,r){return 1===arguments.length?Xy(e):new Gy(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return new Gy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Gy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Ty(Zy(3.1338561*(t=.96422*Jy(t))-1.6168667*(e=1*Jy(e))-.4906146*(n=.82521*Jy(n))),Zy(-.9787684*t+1.9161415*e+.033454*n),Zy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),cy(ev,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ev)return new ev(e.h,e.c,e.l,e.opacity);if(e instanceof Gy||(e=Xy(e)),0===e.a&&0===e.b)return new ev(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$y;return new ev(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ev(e,t,n,null==r?1:r)}),uy(hy,{brighter(e){return new ev(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ev(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return tv(this).rgb()}}));var nv=e=>()=>e;function rv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):nv(isNaN(e)?t:e)}function iv(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}!function e(t){var n=function(e){return 1==(e=+e)?rv: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):nv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ay(e)).r,(t=Ay(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=rv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var ov,sv=["__proto__","constructor"];function av(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!sv.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function lv(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){e instanceof Map?(e=[void 0,e],void 0===t&&(t=hv)):void 0===t&&(t=uv);for(var n,r,i,o,s,a=new pv(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new pv(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(fv)}function uv(e){return e.children}function hv(e){return Array.isArray(e)?e[1]:null}function dv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function fv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function pv(e){this.data=e,this.depth=this.height=0,this.parent=null}pv.prototype=cv.prototype={constructor:pv,count:function(){return this.eachAfter(lv)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return cv(this).eachBefore(dv)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},ov=function(e){
|
|
25
25
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
26
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)g+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},ov({exports:{}});var gv="'Source Sans Pro', 'Arial', 'sans-serif'",mv="#333333",yv="#595959",vv="#737373",bv="#cccccc",xv="#e6e6e6";function wv(e){var t={};return[].concat(Jm(e),Jm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",yv],["object","axis.label.name","fontFamily",gv],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",bv],["object","axis.line.minor","color",xv],["object","axis.title","color"],["object","axis.title","fontFamily",gv],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",xv],["object","grid.line.major","color",bv],["object","grid.line.minor","color",xv],["object","label.value","color",yv],["object","label.value","fontFamily",gv],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",yv],[!1,"label.value","lightColor",xv],["object","outOfRange","color","#999"],["object","legend.title","color",mv],["object","legend.title","fontFamily",gv],["object","legend.title","fontSize","15px"],["object","legend.label","color",yv],["object","legend.label","fontFamily",gv],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",mv],["object","referenceLine.label.name","fontFamily",gv],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",xv],["object","referenceLine.outOfBounds","fontFamily",gv],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",vv,function(e){return"transparent"===e?vv:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Mv=function(e){return e};function kv(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Km(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Km(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||Mv)(h(d));av(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Km(e,2),n=t[0],r=t[1];av(s,n,r)})),s}var _v=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Sv=["Abril Fatface, serif","Bangers, fantasy","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Nixie One, sans-serif","Noto Sans, sans-serif","PT Serif, serif","Permanent Marker, fantasy","Rammetto One, fantasy","Roboto, sans-serif","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Open Sans, sans-serif","Montserrat, sans-serif","Raleway, sans-serif","Bebas Neue, sans serif","Lobster, fantasy","Pacifico, cursive","Inter, sans-serif","Indie Flower, fantasy","Yanone Kaffeesatz, sans-serif"],Dv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function qv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Jm(new Set([r].concat(Jm(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Jm(o.map((function(e){return Dv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Jm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Sv:_v}(i).map((function(e){return Dv(e)}))))}({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Cv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Ev=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Av(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Jm(new Set([n].concat(Jm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Jm(r.map((function(e){return Ev(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Jm(Cv.map((function(e){return Ev(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Tv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:qv({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Av({theme:t,translator:n,id:r,path:i})}}function Nv(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Tv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}const Rv=(e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r},Ov=(e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Iv=(e,t)=>(t.components||[]).find((t=>t.key===e)),Lv=(e,t,n,r)=>{var i,o,s,a,l,c,u,h;const d=r.isEnabled("CLIENT_IM_3364")?null===(i=Iv("axis",n))||void 0===i?void 0:i.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},Pv=(e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3364")?null===(i=Iv("value",n))||void 0===i?void 0:i.label:{},u=(null==c||null===(o=c.value)||void 0===o?void 0:o.fontFamily)||t.label.value.fontFamily;let h=(null==c||null===(s=c.value)||void 0===s?void 0:s.fontSize)||t.label.value.fontSize;h=parseFloat(h);return{fontFamily:u,fontSize:h,fill:null==c||null===(a=c.value)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color}},jv=(e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3051")?null===(i=Iv("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==c||null===(o=c.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==c||null===(s=c.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==c||null===(a=c.label)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.label","color")}},zv="object.waterfallChart";function Fv(e,t,n,r,i){const o=e.color||e.qDef.color;if(!o||o.auto||!o[n]){return{index:i,color:t.getStyle(zv,`shape.${n}`,"fill")||r}}return o[n].paletteColor}const Hv={valueTypes:{NORMAL:"NORMAL",INVERSE:"INVERSE",SUBTOTAL:"SUBTOTAL"},chartID:zv,getColorForPositiveValue:function(e,t){return t.getColorPickerColor(Fv(e,t,"positiveValue",null,6))},getColorForNegativeValue:function(e,t){return t.getColorPickerColor(Fv(e,t,"negativeValue","#cc6677",-1))},getColorForSubtotal:function(e,t){return t.getColorPickerColor(Fv(e,t,"subtotal","#c3c3c3",-1))}};Object.freeze(Hv.valueTypes),Object.freeze(Hv);const Vv=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},n.valueLabelSection={translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Bv=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.WaterfallChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Vv(n,t)});function $v(e){return!e.color.auto}function Wv(e){const{flags:t,translator:n}=e,r=e.flags.isEnabled("SENSECLIENT_IM_2020_STYLINGPANEL_WATERFALLCHART"),i=e.flags.isEnabled("SENSECLIENT_IM_2020_WATERFALLCHART_BG"),o={uses:"data",addTranslation:"Properties.AddData",items:{measures:{disabledRef:"",items:{numberFormatting:{show:!1},valueType:{type:"string",component:"dropdown",ref:"qDef.valueType",translation:"properties.waterfall.measureOperation",options:[{value:Hv.valueTypes.NORMAL,translation:"properties.waterfall.measureOperation.add"},{value:Hv.valueTypes.INVERSE,translation:"properties.waterfall.measureOperation.subtract"},{value:Hv.valueTypes.SUBTOTAL,translation:"properties.waterfall.measureOperation.subtotal"}],defaultValue:Hv.valueTypes.NORMAL},subTotal:{ref:"qDef.subtotal.enable",type:"boolean",defaultValue:!1,translation:"properties.waterfall.measureOperation.subtotal",show:e=>e.qDef.valueType!==Hv.valueTypes.SUBTOTAL},subTotalLabel:{translation:"properties.waterfall.subtotalLabel",component:"string",expression:"optional",ref:"qDef.subtotal.label",defaultValue:()=>n.get("properties.waterfall.measureOperation.subtotal"),show:e=>e.qDef.valueType!==Hv.valueTypes.SUBTOTAL&&e.qDef.subtotal&&e.qDef.subtotal.enable}}}}},s=e.anything.sense.theme,a=Ov(s,n,Hv.chartID,Nv,t),l=Rv(a,s,Hv.chartID),c={type:"items",translation:"properties.presentation",grouped:!0,items:{styleEditor:r&&Bv(i,l,t),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:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},u={ref:"color.auto",type:"boolean",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},h={ref:"color.positiveValue.paletteColor",translation:"properties.waterfall.color.positiveValueColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:6,color:null},show:$v},d={ref:"color.negativeValue.paletteColor",translation:"properties.waterfall.color.negativeValueColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:-1,color:"#cc6677"},show:$v},f={ref:"color.subtotal.paletteColor",translation:"properties.waterfall.color.subtotalColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:-1,color:"#c3c3c3"},show:$v},p={classification:{section:"color",tags:["simple"],exclusive:!0},type:"items",items:{simpleItems:{items:{autoColor:{...u,label:e=>{var t;return n.get(null!==(t=e.color)&&void 0!==t&&t.auto?"Common.Auto":"Common.Custom")}},positiveValueColor:h,negativeValueColor:d,subtotalColor:f}}}},g={translation:"properties.colorsAndLegend",type:"items",grouped:!0,items:{colors:{type:"items",items:{autoColor:{...u,translation:"properties.colors"},positiveValueColor:h,negativeValueColor:d,subtotalColor:f}},simpleColors:p,legend:{type:"items",items:{show:{ref:"legend.show",type:"boolean",translation:"properties.legend.show",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},dock:{type:"string",component:"dropdown",ref:"legend.dock",translation:"properties.legend.position",options:[{value:"auto",translation:"Common.Auto"},{value:"right",translation:"properties.dock.right"},{value:"bottom",translation:"Common.Bottom"},{value:"left",translation:"properties.dock.left"},{value:"top",translation:"Common.Top"}],defaultValue:"auto",show:e=>iv(e,"legend.show",!0)}}}}},m={translation:"properties.numberFormatting",type:"items",globalChange(e){e.qHyperCubeDef.qMeasures.forEach((t=>{t.qDef.numFormatFromTemplate=e.qDef.numFormatFromTemplate,t.qDef.qNumFormat=$m(!0,{},e.qDef.qNumFormat)}))},items:{numberFormatting:{uses:"measures.items.numberFormatting",items:{numberFormattingType:void 0}}}};return{type:"items",component:"accordion",items:{data:o,numberFormatting:m,addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{uses:"settings",items:{simpleLabels:{items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}}}}}},presentation:c,colors:g,measureAxis:{uses:"axis.picasso.measureAxis",label:n.get("properties.yAxis"),items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:n.get("properties.yAxis"),classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{translation:"properties.labels",defaultValue:"labels",options:[{value:"labels",translation:"properties.labels"},{value:"none",translation:"Common.None"},null,null]}}}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{show:{translation:"properties.labels",defaultValue:"labels",options:[{value:"labels",translation:"properties.labels"},{value:"none",translation:"Common.None"},null,null]},label:{options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0}}}}}}}}}}function Uv(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Wv(e),support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties(t,n,r){r.mapProperties();const i={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Ym({dataDefinition:Om(e),defaultPropertyValues:i,exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Xm({propertyTree:e,viewDataMode:n})}}const Yv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Xv=function(){};Xv.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]&&Yv.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 Gv={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 Kv(){return Gv.id()}const Jv="scrollbar";function Zv(e,t,n){return"y"===e?Qv(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Qv(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var eb={getAxisDock:Zv,getOppositeAxisDock:function(e,t,n){return Zv(e,"far"===t?"near":"far",n)},getYAxisDock:Qv};const tb=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),nb=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),rb=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ib(e){return tb.test(e)}function ob(e){return nb.test(e)||rb.test(e)}var sb={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],ib(r))return"ltr";if(ob(r))return"rtl"}return"ltr"}};var ab={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 $m(!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"),$m(!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} ${sb.lrm}(${n})${sb.lrm}`:`${sb.lrm}(${n})${sb.lrm}`:!1!==e.showLabel?t:""}};const lb={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};lb.DEFAULT_CHART_ORIENTATION=lb.HORIZONTAL;const cb=100;function ub(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||lb.DEFAULT_CHART_ORIENTATION,s=o===lb.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=lb.SHOW_AXIS_LABELS_OPTIONS,u=lb.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=$m(i,lb.LAYOUTSETTINGS.measureAxis);const o=db(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=$m(r,lb.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return db(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=$m(!0,i||{},{component:{ticks:{distance:r.spacing*cb}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=$m(r,lb.LAYOUTSETTINGS.dimensionAxis);const i=fb(t,n);$m(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=$m(r,lb.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return fb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===lb.HORIZONTAL?lb.VERTICAL:lb.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=$m(r,lb.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=$m({},lb.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),hb(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===Jv))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Jv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Jv).emit("panStart",e)},pan(e){this.chart.component(Jv).emit("panMove",e)},panend(e){this.chart.component(Jv).emit("panEnd",e)},pancancel(e){this.chart.component(Jv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=eb.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=$m(o,lb.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Kv()}`,require:["renderer","chart"],dock:eb.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=$m(s,lb.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=$m(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=ab.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=ab.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",lb.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=$m(o,lb.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,fb(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=$m(o,lb.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,db(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=$m(o,lb.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,fb(n,l).dock,n.isRtl)}n.brushActions&&hb(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function hb(e,t){t.forEach((t=>{e.push(t)}))}function db(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function fb(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function pb(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 $m(!0,{},o,e||{})}function gb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:eb.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=$m(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function mb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:eb.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return $m(!0,{},c,e||{})}pb.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=pb($m(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},pb.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 pb($m(!0,n,e||{}),t)},gb.xAxis=function(e,t){return gb($m(!0,{key:"x-axis",scale:"x"},e||{}),t)},gb.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:eb.getYAxisDock(n,r)};return gb($m(!0,i,e||{}),t)},mb.xAxisTitle=function(e,t){return mb($m(!0,{key:"x-axis-title"},e||{}),t)},mb.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:eb.getYAxisDock(n,r)||"left"};return mb($m(!0,i,e||{}),t)};var yb={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 vb={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 bb(){return vb}function xb(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}bb.getLayoutModeKeys=function(){const e=[];let t;for(t in vb)e.push(t);return e};const wb={left:"left",right:"right",up:"top",down:"bottom"};function Mb(e,t,n){switch(e){case"scale":return pb(t,n);case"measure-scale":return pb.measureScale(t,n);case"dimension-scale":return pb.dimensionScale(t,n);case"axis":return gb(t,n);case"box-marker":return function(e){return $m(!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 $m(!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 $m(!0,{},o,e||{})}(t,n);case"text":return mb(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})})),$m(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:yb.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:yb.getBublesAlign(s,a,l)}}};return $m(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:yb.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:yb.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),$m(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h={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-${wb[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return $m(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return $m(!0,{},d,e)}(t,n);case"x-axis":return gb.xAxis(t,n);case"y-axis":return gb.yAxis(t,n);case"x-axis-title":return mb.xAxisTitle(t,n);case"y-axis-title":return mb.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 $m(!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 $m(!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 $m(!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 $m(!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:xb}]}}}]}};return $m(!0,{},o,e||{})}(t,n);default:return}}function kb(e){this.options=e||{},this.settings={dockLayout:{layoutModes:bb()},components:[],scales:{}}}kb.prototype.addComponent=function(e,t,n){const r=Mb(e,t,$m(!0,{},this.options,n||{}));return this.settings.components.push(r),r},kb.prototype.addInteraction=function(e,t){const n=Mb("interaction",e,$m(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},kb.prototype.addScale=function(e,t,n){const r=Mb(e,t,$m(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},kb.prototype.getSettings=function(){return this.settings},kb.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},kb.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");ub(t,n)}(e,this,t)},kb.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))},kb.create=function(e){return new kb(e)},kb.createComponent=Mb;const _b={CENTER:0,BOTTOM:1};var Sb={DISCLAIMERS:[{label:"NoDataExist",alignment:_b.CENTER,default:!0},{label:"RequireNumericDimension",alignment:_b.CENTER,default:!1},{label:"OnlyNanData",alignment:_b.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:_b.CENTER,default:!1},{label:"LimitedData",alignment:_b.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:_b.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:_b.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:_b.BOTTOM,default:!1}],ALIGNMENT:_b};const Db={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Sb.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 qb(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Cb(e,t){return e&&t&&t[e]}function Eb(e){this.environment=e,this.clear()}qb.prototype.isValidAndSupported=function(e,t){return Cb(e.label,this.dataAttributes)&&(e.default||Cb(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},qb.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},qb.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},Eb.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Eb._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Eb.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=$m(!0,{},this.vizAttributes.supportedDisclaimers),i=new qb(Sb.DISCLAIMERS,this.dataAttributes,r);let o,s;if(i.isAnyValidDisclaimer(Sb.ALIGNMENT.CENTER))o=i.getMessage(Sb.ALIGNMENT.CENTER,n),s="center";else{if(!i.isAnyValidDisclaimer(Sb.ALIGNMENT.BOTTOM))return;o=i.getMessage(Sb.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Eb.prototype.set=function(e){if(this.clear(),!e)throw new Error(Eb.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Db.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Eb.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Ab=Xv.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 Eb(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:[kb.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),kb.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=$m(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:iv(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})}),Tb={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}},Nb=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Rb=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Ob=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Ib=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Lb=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Pb=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,jb=Math.floor,zb=Math.round,Fb=Xv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof Fb)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=zb(255*d),f=zb(255*f),p=zb(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=zb(255*d),f=zb(255*f),p=zb(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=zb(255*d),f=zb(255*f),p=zb(255*p),g=1}else Tb[h.toLowerCase()]?(n=h.toLowerCase(),d=Tb[n].r,f=Tb[n].g,p=Tb[n].b,g="number"==typeof Tb[n].a?Tb[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+g)&&(this._invalid=!0),this._r=jb(d),this._g=jb(f),this._b=jb(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=Fb.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Fb.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Fb.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Fb.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Fb.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Fb.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=Fb.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Fb.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof Fb||(e=new Fb(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[jb(this._r+(e._r-this._r)*t),jb(this._g+(e._g-this._g)*t),jb(this._b+(e._b-this._b)*t),jb(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 Fb(r)}});Fb.toRGB=function(e){if(e instanceof Fb)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Fb.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Fb.toRGBA=function(e,t){if(e instanceof Fb)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Fb.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Fb.toHex=function(e){let t,n,r;return e instanceof Fb?(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=Fb.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}`)},Fb.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Fb(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},Fb.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Fb(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},Fb.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Fb(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},Fb.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Fb)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},Fb.blend=function(e,t,n){const r=(16711680&(e=Fb.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Fb.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Fb.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new Fb(r,i,o,s)},Fb.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Nb.test(e)||Rb.test(e)||Ob.test(e)||Ib.test(e)||Lb.test(e)||Pb.test(e)||Tb[e.toLowerCase()])},Fb.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Fb.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)},Fb.isDark=function(){const e={getLuminance:Fb.prototype.getLuminance,isInvalid:Fb.prototype.isInvalid};return Fb.prototype.init.apply(e,[].slice.call(arguments)),Fb.prototype.isDark.call(e)},Fb.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Hb=".scrollHandler";function Vb(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function Bb(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function $b(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some((e=>e.settings.key===r)))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function Wb(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}Vb.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Vb.prototype.setDisabled=function(e){this._disabled=e},Vb.prototype.getDisabled=function(){return this._disabled},Vb.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Bb.call(this))},Vb.prototype.getItemSize=function(){return this._itemSize},Vb.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Bb.call(this);return this._scrollViewSizeInItem},Vb.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Wb.bind(this)));this._$chartElement.on(`mousewheel${Hb} DOMMouseScroll${Hb}`,$b.bind(this)),this._$chartElement.on(`touchstart${Hb}`,(e=>{e.preventDefault()})),this._on=!0},Vb.prototype.isOn=function(){return this._on},Vb.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(Hb),this._on=!1},Vb.prototype.updateViewState=function(e){Bb.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Vb.prototype.onResize=function(){this._sizeChanged=!0,Bb.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Vb.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Vb.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Vb.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Vb.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Vb.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Vb.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};var Ub={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 Yb={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Em.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Ub.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Ub.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 Xb={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_HORIZONTAL:Em.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ub.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ub.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 Gb(e,t){let n;return n="x-axis"===e?"horizontal"===t?Em.DIRECTION_VERTICAL:Em.DIRECTION_HORIZONTAL:"horizontal"===t?Em.DIRECTION_HORIZONTAL:Em.DIRECTION_VERTICAL,n}var Kb={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Gb(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ub.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ub.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 Jb={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_VERTICAL:Em.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ub.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ub.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 Zb={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_VERTICAL:Em.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 Qb={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Ub.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 ex={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function 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 a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(Qb.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(Yb.callLassoGesture(d,x,w)),a?l?(b.push(Jb.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(Xb.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(Jb.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(Kb.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(Xb.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(Kb.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(Zb.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};function tx(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var nx={create:(...e)=>tx(...e)},rx={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 ix=-3;const ox=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=sx(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function sx(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)e[n]===ix&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const ax="dist-flow-tooltip",lx=`#${ax}`;function cx(){if(!document.querySelector(lx)){const e=document.createElement("div");e.id=ax,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(){cx()},beforeUpdate(){cx()},destroyed(){!function(){const e=document.querySelector(lx);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(lx),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:hx}=sb;const dx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:rx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:hx(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:hx(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:hx(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:hx(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function fx(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=$m(!0,{},dx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:nx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=ux({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:ox(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var px={create:(e,t,n)=>fx(e,t,n)};const gx=166/26,mx=12,yx=11,vx=12/yx;function bx(e){return(Math.min(e,3)*mx+Math.max(e-3,0)*gx)/yx}function xx(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function wx(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=xx(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=xx(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk}));const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function Mx(e,t,n){return e*(e<=24?t:n)}var kx={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:bx,getCharacterRatios:xx,getTotalCharacterRatios:wx,getAdjustedMaxGlyphCount:function(e,t,n){const r=wx(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(bx(i)+o*vx)},estimateLatinLabelWidth:Mx,estimateLabelWidth:function(e,t,n,r,i){return e*n+Mx(t,r,i)}};var _x={generateHyperCube:function(e,t){const n=e.qHyperCube.qMeasureInfo,r=e.qHyperCube.qDataPages[0].qMatrix,i=n.length;if(!i)return;const o=Hv.getColorForPositiveValue(e,t),s=Hv.getColorForNegativeValue(e,t),a=Hv.getColorForSubtotal(e,t),l=e=>`${e}`,c=[];let u,h,d=0,f=0,p=-Number.MAX_VALUE,g=Number.MAX_VALUE,m=-Number.MAX_VALUE,y=Number.MAX_VALUE,v=0;for(let e=0;e<i;e++)h=Number.isNaN(+r[0][e].qNum)?0:r[0][e].qNum,n[e].valueType!==Hv.valueTypes.SUBTOTAL?(d=f,f+=h*(n[e].valueType===Hv.valueTypes.INVERSE?-1:1),u=d<f?o:s,c.push([{qText:n[e].qFallbackTitle,qElemNumber:v++},{qText:u},{qNum:d},{qNum:f},{qNum:f-d,qText:r[0][e].qText}]),n[e].subtotal&&n[e].subtotal.enable&&c.push([{qText:n[e].subtotal.label||"",qElemNumber:v++},{qText:a},{qNum:0},{qNum:f},{qNum:f,qText:l(f)}])):(d=0,f=h,c.push([{qText:n[e].qFallbackTitle,qElemNumber:v++},{qText:a},{qNum:d},{qNum:f},{qNum:f-d,qText:r[0][e].qText}])),p=Math.max(p,d),g=Math.min(g,d),m=Math.max(m,f),y=Math.min(y,f);const b=function(e){return e.qHyperCube.qMeasureInfo[0].qNumFormat}(e),x=e.qHyperCube.qMeasureInfo[0].qIsAutoFormat,w=e.qDef.isCustomFormatted,M={qHyperCube:{qMode:"S",qDataPages:[{qArea:{qTop:0,qLeft:0,qWidth:5,qHeight:c.length},qMatrix:c}],qDimensionInfo:[{qStateCounts:{}},{qStateCounts:{}}],qMeasureInfo:[{qMin:g,qMax:p,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w},{qMin:y,qMax:m,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w},{qMin:y,qMax:m,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w}]}};e.generatedMatrix=c,e.generated=M},generateSlicedHyperCube:function(e,t,n){e.generated.qHyperCube.qDataPages=[{qArea:{qTop:t,qLeft:0,qWidth:5,qHeight:n},qMatrix:e.generatedMatrix.slice(t,t+n)}]},getGeneratedDimensionPath:function(e){return`qDimensionInfo/${e}`},getGeneratedMeasurePath:function(e){return`qMeasureInfo/${e}`}};function Sx(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dx(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qx(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=Sx,n=(t,n)=>Sx(e(t),n),r=(t,n)=>e(t)-n):(t=e===Sx||e===Dx?e:Cx,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Cx(){return 0}const Ex=qx(Sx).right;qx((function(e){return null===e?NaN:+e})).center;var Ax=Ex;const Tx=Math.sqrt(50),Nx=Math.sqrt(10),Rx=Math.sqrt(2);function Ox(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Tx?10:o>=Nx?5:o>=Rx?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Ox(e,t,2*n):[a,l,c]}function Ix(e,t,n){return Ox(e=+e,t=+t,n=+n)[2]}function Lx(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Px(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jx(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zx(){}var Fx=.7,Hx=1/Fx,Vx="\\s*([+-]?\\d+)\\s*",Bx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$x="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wx=/^#([0-9a-f]{3,8})$/,Ux=new RegExp(`^rgb\\(${Vx},${Vx},${Vx}\\)$`),Yx=new RegExp(`^rgb\\(${$x},${$x},${$x}\\)$`),Xx=new RegExp(`^rgba\\(${Vx},${Vx},${Vx},${Bx}\\)$`),Gx=new RegExp(`^rgba\\(${$x},${$x},${$x},${Bx}\\)$`),Kx=new RegExp(`^hsl\\(${Bx},${$x},${$x}\\)$`),Jx=new RegExp(`^hsla\\(${Bx},${$x},${$x},${Bx}\\)$`),Zx={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 Qx(){return this.rgb().formatHex()}function ew(){return this.rgb().formatRgb()}function tw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?nw(t):3===n?new ow(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rw(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rw(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=Ux.exec(e))?new ow(t[1],t[2],t[3],1):(t=Yx.exec(e))?new ow(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Xx.exec(e))?rw(t[1],t[2],t[3],t[4]):(t=Gx.exec(e))?rw(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Kx.exec(e))?hw(t[1],t[2]/100,t[3]/100,1):(t=Jx.exec(e))?hw(t[1],t[2]/100,t[3]/100,t[4]):Zx.hasOwnProperty(e)?nw(Zx[e]):"transparent"===e?new ow(NaN,NaN,NaN,0):null}function nw(e){return new ow(e>>16&255,e>>8&255,255&e,1)}function rw(e,t,n,r){return r<=0&&(e=t=n=NaN),new ow(e,t,n,r)}function iw(e,t,n,r){return 1===arguments.length?function(e){return e instanceof zx||(e=tw(e)),e?new ow((e=e.rgb()).r,e.g,e.b,e.opacity):new ow}(e):new ow(e,t,n,null==r?1:r)}function ow(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function sw(){return`#${uw(this.r)}${uw(this.g)}${uw(this.b)}`}function aw(){const e=lw(this.opacity);return`${1===e?"rgb(":"rgba("}${cw(this.r)}, ${cw(this.g)}, ${cw(this.b)}${1===e?")":`, ${e})`}`}function lw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function uw(e){return((e=cw(e))<16?"0":"")+e.toString(16)}function hw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fw(e,t,n,r)}function dw(e){if(e instanceof fw)return new fw(e.h,e.s,e.l,e.opacity);if(e instanceof zx||(e=tw(e)),!e)return new fw;if(e instanceof fw)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new fw(s,a,l,e.opacity)}function fw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function pw(e){return(e=(e||0)%360)<0?e+360:e}function gw(e){return Math.max(0,Math.min(1,e||0))}function mw(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Px(zx,tw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qx,formatHex:Qx,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return dw(this).formatHsl()},formatRgb:ew,toString:ew}),Px(ow,iw,jx(zx,{brighter(e){return e=null==e?Hx:Math.pow(Hx,e),new ow(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Fx:Math.pow(Fx,e),new ow(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ow(cw(this.r),cw(this.g),cw(this.b),lw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sw,formatHex:sw,formatHex8:function(){return`#${uw(this.r)}${uw(this.g)}${uw(this.b)}${uw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:aw,toString:aw})),Px(fw,(function(e,t,n,r){return 1===arguments.length?dw(e):new fw(e,t,n,null==r?1:r)}),jx(zx,{brighter(e){return e=null==e?Hx:Math.pow(Hx,e),new fw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Fx:Math.pow(Fx,e),new fw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ow(mw(e>=240?e-240:e+120,i,r),mw(e,i,r),mw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fw(pw(this.h),gw(this.s),gw(this.l),lw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=lw(this.opacity);return`${1===e?"hsl(":"hsla("}${pw(this.h)}, ${100*gw(this.s)}%, ${100*gw(this.l)}%${1===e?")":`, ${e})`}`}}));var yw=e=>()=>e;function vw(e){return 1==(e=+e)?bw: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):yw(isNaN(t)?n:t)}}function bw(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):yw(isNaN(e)?t:e)}var xw=function e(t){var n=vw(t);function r(e,t){var r=n((e=iw(e)).r,(t=iw(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=bw(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function ww(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Mw(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=Ew(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function kw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _w(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Sw(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Ew(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Dw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qw=new RegExp(Dw.source,"g");function Cw(e,t){var n,r,i,o=Dw.lastIndex=qw.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Dw.exec(e))&&(r=qw.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:_w(n,r)})),o=qw.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}function Ew(e,t){var n,r=typeof t;return null==t||"boolean"===r?yw(t):("number"===r?_w:"string"===r?(n=tw(t))?(t=n,xw):Cw:t instanceof tw?xw:t instanceof Date?kw:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?ww:Array.isArray(t)?Mw:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Sw:_w)(e,t)}function Aw(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Tw(e){return+e}var Nw=[0,1];function Rw(e){return e}function Ow(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Iw(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Ow(i,r),o=n(s,o)):(r=Ow(r,i),o=n(o,s)),function(e){return o(r(e))}}function Lw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Ow(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=Ax(e,t,1,r)-1;return o[n](i[n](t))}}function Pw(){var e,t,n,r,i,o,s=Nw,a=Nw,l=Ew,c=Rw;function u(){var e=Math.min(s.length,a.length);return c!==Rw&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),r=e>2?Lw:Iw,i=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=r(a,s.map(e),_w)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Tw),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Aw,u()},h.clamp=function(e){return arguments.length?(c=!!e||Rw,u()):c!==Rw},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function jw(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zw(e){return(e=jw(Math.abs(e)))?e[1]:NaN}var Fw,Hw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vw(e){if(!(t=Hw.exec(e)))throw new Error("invalid format: "+e);var t;return new Bw({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Bw(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function $w(e,t){var n=jw(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Vw.prototype=Bw.prototype,Bw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ww={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$w(100*e,t),r:$w,s:function(e,t){var n=jw(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Fw=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+jw(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Uw(e){return e}var Yw,Xw,Gw,Kw=Array.prototype.map,Jw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Zw(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Uw:(t=Kw.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Uw:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Kw.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Vw(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Ww[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=Ww[v],M=/[defgprs%]/.test(v);function k(e){var i,o,l,d=b,k=x;if("c"===v)k=w(e)+k,e="";else{var _=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),_&&0==+e&&"+"!==h&&(_=!1),d=(_?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===v?Jw[8+Fw/3]:"")+k+(_&&"("===h?")":""),M)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){k=(46===l?s+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!f&&(e=r(e,1/0));var S=d.length+e.length+k.length,D=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=r(D+e,D.length?p-k.length:1/0),D=""),n){case"<":e=d+e+k+D;break;case"=":e=d+D+e+k;break;case"^":e=D.slice(0,S=D.length>>1)+d+e+k+D.slice(S);break;default:e=D+d+e+k}return a(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=Vw(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(zw(t)/3))),i=Math.pow(10,-r),o=Jw[8+r/3];return function(e){return n(i*e)+o}}}}function Qw(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?Ix(t,e,n):Ix(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=Vw(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zw(t)/3)))-zw(Math.abs(e)))}(o,s))||(r.precision=i),Gw(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zw(t)-zw(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-zw(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Xw(r)}function eM(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,s]=r?Ox(t,e,n):Ox(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Qw(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=Ix(l,c,n))===r)return o[s]=l,o[a]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function tM(){var e=Pw()(Rw,Rw);return e.copy=function(){return t=e,tM().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Lx.apply(e,arguments),eM(e)}!function(e){Yw=Zw(e),Xw=Yw.format,Gw=Yw.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const nM={getMinorTicks({majorTicks:e,minorTickCount:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n},adjustTicks({ticks:e,majorTicks:t,minorTicks:n,autoMinMax:r,minMax:i,min:o,max:s}){const a=n[0]-t[0],l=t[0]-o;l>a&&e.unshift({value:t[0]-a,isMinor:!0});const c=s-t[t.length-1];return c>a&&e.push({value:t[t.length-1]+a,isMinor:!0}),r||(("min"===i||"minMax"===i)&&l>0&&e.unshift({value:o,isMinor:!1}),("max"===i||"minMax"===i)&&c>0&&e.push({value:s,isMinor:!1})),e},getTicks({layout:e,height:t}){const{autoMinMax:n,minMax:r,spacing:i}=e.measureAxis;let o=Math.min(...e.generated.qHyperCube.qMeasureInfo.map((e=>e.qMin))),s=Math.max(...e.generated.qHyperCube.qMeasureInfo.map((e=>e.qMax)));if(!n)switch(r){case"min":o=e.measureAxis.min;break;case"max":s=e.measureAxis.max;break;case"minMax":({min:o,max:s}=e.measureAxis)}const a=100*i,l=Math.max(1,Math.round(t/a)),c=tM().domain([o,s]).ticks(l),u=nM.getMinorTicks({majorTicks:c,minorTickCount:1}),h=[...c.map((e=>({value:e,isMinor:!1}))),...u.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value));return nM.adjustTicks({ticks:h,majorTicks:c,minorTicks:u,autoMinMax:n,minMax:r,min:o,max:s})}},rM=Hv.chartID,iM=20,oM=.7;function sM(e){this._scrollHandler.setDisabled(!!e)}function aM(e){let t=-Number.MAX_VALUE;return e.qHyperCube.qMeasureInfo.forEach((e=>{t=Math.max(t,e.qFallbackTitle.length),e.valueType!==Hv.valueTypes.SUBTOTAL&&e.subtotal&&e.subtotal.enable&&(t=Math.max(t,e.subtotal.label?e.subtotal.label.length:0))})),Math.min(iM,Math.max(0,t))}function lM(e){return{settings:{labels:{mode:e.dimensionAxis.label,maxGlyphCount:Math.ceil(kx.stringWidthOverMWidth(aM(e))),maxLengthPx:this.picassoElement.getBoundingClientRect().height/4}}}}function cM(e){const t=e.data.measure,n=e.dataset(t.source.key).field(t.source.field);return rx.formatMeasureValue(n,t)}function uM(e,t){return{viewSize:t,max:e.generatedMatrix.length}}const hM=Ab.extend("WaterfallChart",{namespace:".waterfallchart",chartID:rM,init:function({picasso:e,environment:t,$element:n,flags:r}){this._super(e,n,t,null,null),this._tooltipHandler=px.create(this.chartInstance,n,rM),this._scrollHandler=new Vb(this.chartInstance,n,this.getSlicedData.bind(this),this.updateChart.bind(this)),this._scrollHandler.setOptions({direction:"horizontal"}),this.setDataPaths(["generated/qHyperCube"]),this.flags=r},updateConstraints:function(e){const t=!e.active,n=!e.passive;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"]()},off:function(){this._scrollHandler.off(),this._tooltipHandler.off()},createChartSettings:function(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=kb.create({chartID:rM,theme:n,isRtl:t}),o=this.picassoElement.clientWidth,s=this.picassoElement.clientHeight,a={};a.box=this._tooltipHandler.setUp({chartBuilder:i,environment:this.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",headerResolver(){},rowResolver(e,t,n){const r=n.boxColor.value;return{value:rx.formatMeasureValue(e,t),label:n.tooltip.value.qText,color:r}},labelData:["tooltip"],measureRows:["measure"]});const l={scrollHandler:this._scrollHandler,selectionHandler:null};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=ex.create(l,"vertical",t,{componentKey:"box-marker"}),i.addPreset("dimension-measure-chart",{isRtl:t,orientation:"vertical",theme:n,gridlines:e.gridlines,includeDimensionAxis:!0,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:lM.call(this,e),dimensionSource:_x.getGeneratedDimensionPath(0),dimensionScaleSettings:{component:{maxPxStep:()=>s/4}},includeMeasureAxis:!0,measureAxisProperties:e.measureAxis,measureSource:[_x.getGeneratedMeasurePath(0),_x.getGeneratedMeasurePath(1)],measureScaleSettings:{component:{expand:0,include:[0],ticks:{values:()=>nM.getTicks({layout:e,height:s})}}},hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:uM(e,this._scrollHandler.getScrollViewSizeInItem()),refLines:e.refLine&&e.refLine.refLines,brushActions:this._dependentActions.gestures,axisLabelStyle:Lv(rM,n,e,this.flags)}),i.addComponent("box-marker",function(e,t){const n=e?[e.box.trigger]:[],r=e?e.box.consume:[];return{data:{extract:{key:"qHyperCube",field:_x.getGeneratedDimensionPath(0),props:{start:{field:_x.getGeneratedMeasurePath(0)},end:{field:_x.getGeneratedMeasurePath(1)},measure:{field:_x.getGeneratedMeasurePath(2),reduce:"first",value:e=>e},boxColor:{field:_x.getGeneratedDimensionPath(1),value:e=>e.qText},isCustomFormatted:!!t.qDef.isCustomFormatted,tooltip:{value:e=>e}}}},settings:{major:{scale:"dimension"},minor:{scale:"measure"},orientation:"",box:{width:oM,maxWidthPx:4e3,fill:e=>e.datum.boxColor.value,strokeWidth:0}},brush:{trigger:n,consume:r}}}(a,e)),i.addComponent("point-marker",function(e,t){const n=t.getStyle(rM,"shape.bridge","stroke");return{data:{extract:{key:"qHyperCube",field:_x.getGeneratedDimensionPath(0),props:{x:{},y:{field:_x.getGeneratedMeasurePath(1)}}}},settings:{x:{scale:"dimension",ref:"x",fn:t=>e?t.scale(t.datum.value):t.scale(t.datum.value)+t.scale.bandwidth()},y:{scale:"measure"},sizeLimits:{maxPx:2e4,maxRelExtent:1e4,minRelDiscrete:0,maxRelDiscrete:1},shape:"line",stroke:n,size:1-oM,strokeDasharray:"4 4",fill:"none",strokeWidth:(e,t)=>t===e.data.items.length-1?0:2}}}(t,n)),e.legend&&!e.legend.show||i.addComponent("categorical-legend",function(e,t,n){const{theme:r,translator:i}=e,o=Hv.getColorForPositiveValue(t,r),s=Hv.getColorForNegativeValue(t,r),a=Hv.getColorForSubtotal(t,r),l=i.get("waterfall.legend.positiveValue.label"),c=i.get("waterfall.legend.negativeValue.label"),u=i.get("waterfall.legend.subtotal.label"),h=jv(rM,r,t,n);return{displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,scale:{type:"categorical-color",data:[l,c,u],range:[o,s,a]},style:{item:{label:{fontSize:h.fontSize,fontFamily:h.fontFamily,fill:h.color}},title:{show:!1}}}}(this.environment,e,this.flags),{dock:e.legend?e.legend.dock:"auto",isRtl:t,chartWidth:o,chartHeight:s});const c=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,h={theme:t,matrix:wv(s),styles:void 0};return h.styles=kv({theme:t,id:i,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=kv({theme:e,id:i,transform:l,extend:u,matrix:h.matrix})}}}({theme:n,config:{id:"waterfallChart"}});e.dataPoint.showLabels&&i.addComponent("labels",function(e,t,n){const r=e.getStyles(),i=Pv(rM,r,t,n),o=(null==i?void 0:i.fill)||r.label.value.color,s=r.label.value.darkColor,a=r.label.value.lightColor;return{settings:{sources:[{strategy:{settings:{...i,direction:e=>e.data&&e.data.end.value>e.data.start.value?"up":"down",labels:[{placements:[{fill:o},{fill:n.isEnabled("CLIENT_IM_3364")&&null!=i&&i.fill?o:e=>Fb.isDark(e.node.attrs.fill)?a:s},{position:"opposite",fill:o,justify:0}],label:cM}]}}}]}}}(c,e,this.flags));const u=i.getSettings();return this.addSnapshotChartSettings(u,e),u},updateData:function(e){const{theme:t,options:n}=this.environment,r=this;return this._super(e).then((()=>{if(r._destroyed)return Promise.reject();let i,o;if(!!e.snapshotData){const e=r.layout.generated.qHyperCube.qDataPages[0].qArea;i=e.qTop,o=e.qHeight,_x.generateHyperCube(r.layout,t)}else{_x.generateHyperCube(r.layout,t),sM.call(r,!0);const{viewState:e}=n;e?(r._scrollHandler.updateViewState(r.layout.generatedMatrix.length),r._scrollHandler.setScrollState(e.scroll),i=e.scroll):(r._scrollHandler.resetScroll(),i=0),o=r._scrollHandler.getScrollViewSizeInItem()}_x.generateSlicedHyperCube(r.layout,i,o)}))},resize:function(){this._scrollHandler.onResize(),this._super()},paint:function(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||sM.call(this,!1),this._tooltipHandler.closeTooltip();const t=this.layout.generated.qHyperCube.qDataPages[0].qMatrix.length,n=this.layout.generatedMatrix.length;if(!e&&this._scrollHandler.isDataSizeChanged(t,n)){const e=this._super,t=this;return this._scrollHandler.getViewData().finally((()=>e.call(t)))}return this._super()},getSlicedData:function(e,t){return _x.generateSlicedHyperCube(this.layout,e,t),Promise.resolve(this.layout)},setSnapshotData:function(e){this._super(e),e.generated=this.layout.generated,e.generatedMatrix=this.layout.generatedMatrix},getViewState:function(){return{scroll:this._scrollHandler.getScrollState()}}});return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator),{qae:Gm(t),ext:Uv(t),component(){const n=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=r.options.renderer,s=e.useMemo((()=>Nm(o)),[o]),a=e.useStaleLayout(),l=e.useConstraints(),[c,u]=e.useState();var h;e.useEffect((()=>{const e=i(n),o=new hM({picasso:s,environment:r,$element:e,flags:t.flags});return u(o),()=>{o.destroy()}}),[]),function(...t){const[,n]=e.usePromise(...t);if(n)throw n}((async()=>{c&&(c.updateEnvironment(r),c.updateConstraints(l),await c.updateData(a),await c.paint())}),[a,c,r]),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}(c),h=c,e.onTakeSnapshot((e=>{if(h)return h.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(h)return h.getViewState()}})),[h])}}}}));
|
|
26
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)g+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},ov({exports:{}});var gv="'Source Sans Pro', 'Arial', 'sans-serif'",mv="#333333",yv="#595959",vv="#737373",bv="#cccccc",xv="#e6e6e6";function wv(e){var t={};return[].concat(Jm(e),Jm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",yv],["object","axis.label.name","fontFamily",gv],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",bv],["object","axis.line.minor","color",xv],["object","axis.title","color"],["object","axis.title","fontFamily",gv],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",xv],["object","grid.line.major","color",bv],["object","grid.line.minor","color",xv],["object","label.value","color",yv],["object","label.value","fontFamily",gv],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",yv],[!1,"label.value","lightColor",xv],["object","outOfRange","color","#999"],["object","legend.title","color",mv],["object","legend.title","fontFamily",gv],["object","legend.title","fontSize","15px"],["object","legend.label","color",yv],["object","legend.label","fontFamily",gv],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",mv],["object","referenceLine.label.name","fontFamily",gv],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",xv],["object","referenceLine.outOfBounds","fontFamily",gv],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",vv,function(e){return"transparent"===e?vv:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Mv=function(e){return e};function kv(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Km(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Km(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||Mv)(h(d));av(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Km(e,2),n=t[0],r=t[1];av(s,n,r)})),s}var _v=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Sv=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Dv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function qv(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Jm(new Set([r].concat(Jm(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Jm(o.map((function(e){return Dv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Jm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Sv:_v}(i).map((function(e){return Dv(e)}))))}function Cv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return qv({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Ev=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Av=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Tv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Jm(new Set([n].concat(Jm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Jm(r.map((function(e){return Av(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Jm(Ev.map((function(e){return Av(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Nv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Cv({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Tv({theme:t,translator:n,id:r,path:i})}}function Rv(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Nv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}const Ov=(e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r},Iv=(e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Lv=(e,t)=>(t.components||[]).find((t=>t.key===e)),Pv=(e,t,n,r)=>{var i,o,s,a,l,c,u,h;const d=r.isEnabled("CLIENT_IM_3364")?null===(i=Lv("axis",n))||void 0===i?void 0:i.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},jv=(e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3364")?null===(i=Lv("value",n))||void 0===i?void 0:i.label:{},u=(null==c||null===(o=c.value)||void 0===o?void 0:o.fontFamily)||t.label.value.fontFamily;let h=(null==c||null===(s=c.value)||void 0===s?void 0:s.fontSize)||t.label.value.fontSize;h=parseFloat(h);return{fontFamily:u,fontSize:h,fill:null==c||null===(a=c.value)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color}},zv=(e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3051")?null===(i=Lv("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==c||null===(o=c.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==c||null===(s=c.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==c||null===(a=c.label)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.label","color")}},Fv="object.waterfallChart";function Hv(e,t,n,r,i){const o=e.color||e.qDef.color;if(!o||o.auto||!o[n]){return{index:i,color:t.getStyle(Fv,`shape.${n}`,"fill")||r}}return o[n].paletteColor}const Vv={valueTypes:{NORMAL:"NORMAL",INVERSE:"INVERSE",SUBTOTAL:"SUBTOTAL"},chartID:Fv,getColorForPositiveValue:function(e,t){return t.getColorPickerColor(Hv(e,t,"positiveValue",null,6))},getColorForNegativeValue:function(e,t){return t.getColorPickerColor(Hv(e,t,"negativeValue","#cc6677",-1))},getColorForSubtotal:function(e,t){return t.getColorPickerColor(Hv(e,t,"subtotal","#c3c3c3",-1))}};Object.freeze(Vv.valueTypes),Object.freeze(Vv);const Bv=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},n.valueLabelSection={translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},$v=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.WaterfallChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Bv(n,t)});function Wv(e){return!e.color.auto}function Uv(e){const{flags:t,translator:n}=e,r=e.flags.isEnabled("SENSECLIENT_IM_2020_STYLINGPANEL_WATERFALLCHART"),i=e.flags.isEnabled("SENSECLIENT_IM_2020_WATERFALLCHART_BG"),o={uses:"data",addTranslation:"Properties.AddData",items:{measures:{disabledRef:"",items:{numberFormatting:{show:!1},valueType:{type:"string",component:"dropdown",ref:"qDef.valueType",translation:"properties.waterfall.measureOperation",options:[{value:Vv.valueTypes.NORMAL,translation:"properties.waterfall.measureOperation.add"},{value:Vv.valueTypes.INVERSE,translation:"properties.waterfall.measureOperation.subtract"},{value:Vv.valueTypes.SUBTOTAL,translation:"properties.waterfall.measureOperation.subtotal"}],defaultValue:Vv.valueTypes.NORMAL},subTotal:{ref:"qDef.subtotal.enable",type:"boolean",defaultValue:!1,translation:"properties.waterfall.measureOperation.subtotal",show:e=>e.qDef.valueType!==Vv.valueTypes.SUBTOTAL},subTotalLabel:{translation:"properties.waterfall.subtotalLabel",component:"string",expression:"optional",ref:"qDef.subtotal.label",defaultValue:()=>n.get("properties.waterfall.measureOperation.subtotal"),show:e=>e.qDef.valueType!==Vv.valueTypes.SUBTOTAL&&e.qDef.subtotal&&e.qDef.subtotal.enable}}}}},s=e.anything.sense.theme,a=Iv(s,n,Vv.chartID,Rv,t),l=Ov(a,s,Vv.chartID),c={type:"items",translation:"properties.presentation",grouped:!0,items:{styleEditor:r&&$v(i,l,t),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:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},u={ref:"color.auto",type:"boolean",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},h={ref:"color.positiveValue.paletteColor",translation:"properties.waterfall.color.positiveValueColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:6,color:null},show:Wv},d={ref:"color.negativeValue.paletteColor",translation:"properties.waterfall.color.negativeValueColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:-1,color:"#cc6677"},show:Wv},f={ref:"color.subtotal.paletteColor",translation:"properties.waterfall.color.subtotalColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:{index:-1,color:"#c3c3c3"},show:Wv},p={classification:{section:"color",tags:["simple"],exclusive:!0},type:"items",items:{simpleItems:{items:{autoColor:{...u,label:e=>{var t;return n.get(null!==(t=e.color)&&void 0!==t&&t.auto?"Common.Auto":"Common.Custom")}},positiveValueColor:h,negativeValueColor:d,subtotalColor:f}}}},g={translation:"properties.colorsAndLegend",type:"items",grouped:!0,items:{colors:{type:"items",items:{autoColor:{...u,translation:"properties.colors"},positiveValueColor:h,negativeValueColor:d,subtotalColor:f}},simpleColors:p,legend:{type:"items",items:{show:{ref:"legend.show",type:"boolean",translation:"properties.legend.show",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},dock:{type:"string",component:"dropdown",ref:"legend.dock",translation:"properties.legend.position",options:[{value:"auto",translation:"Common.Auto"},{value:"right",translation:"properties.dock.right"},{value:"bottom",translation:"Common.Bottom"},{value:"left",translation:"properties.dock.left"},{value:"top",translation:"Common.Top"}],defaultValue:"auto",show:e=>iv(e,"legend.show",!0)}}}}},m={translation:"properties.numberFormatting",type:"items",globalChange(e){e.qHyperCubeDef.qMeasures.forEach((t=>{t.qDef.numFormatFromTemplate=e.qDef.numFormatFromTemplate,t.qDef.qNumFormat=$m(!0,{},e.qDef.qNumFormat)}))},items:{numberFormatting:{uses:"measures.items.numberFormatting",items:{numberFormattingType:void 0}}}};return{type:"items",component:"accordion",items:{data:o,numberFormatting:m,addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{uses:"settings",items:{simpleLabels:{items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}}}}}},presentation:c,colors:g,measureAxis:{uses:"axis.picasso.measureAxis",label:n.get("properties.yAxis"),items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:n.get("properties.yAxis"),classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{translation:"properties.labels",defaultValue:"labels",options:[{value:"labels",translation:"properties.labels"},{value:"none",translation:"Common.None"},null,null]}}}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{show:{translation:"properties.labels",defaultValue:"labels",options:[{value:"labels",translation:"properties.labels"},{value:"none",translation:"Common.None"},null,null]},label:{options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0}}}}}}}}}}function Yv(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Uv(e),support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties(t,n,r){r.mapProperties();const i={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Ym({dataDefinition:Om(e),defaultPropertyValues:i,exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Xm({propertyTree:e,viewDataMode:n})}}const Xv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Gv=function(){};Gv.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]&&Xv.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 Kv={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 Jv(){return Kv.id()}const Zv="scrollbar";function Qv(e,t,n){return"y"===e?eb(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function eb(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var tb={getAxisDock:Qv,getOppositeAxisDock:function(e,t,n){return Qv(e,"far"===t?"near":"far",n)},getYAxisDock:eb};const nb=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),rb=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),ib=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ob(e){return nb.test(e)}function sb(e){return rb.test(e)||ib.test(e)}var ab={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],ob(r))return"ltr";if(sb(r))return"rtl"}return"ltr"}};var lb={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 $m(!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"),$m(!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} ${ab.lrm}(${n})${ab.lrm}`:`${ab.lrm}(${n})${ab.lrm}`:!1!==e.showLabel?t:""}};const cb={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};cb.DEFAULT_CHART_ORIENTATION=cb.HORIZONTAL;const ub=100;function hb(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||cb.DEFAULT_CHART_ORIENTATION,s=o===cb.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=cb.SHOW_AXIS_LABELS_OPTIONS,u=cb.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=$m(i,cb.LAYOUTSETTINGS.measureAxis);const o=fb(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=$m(r,cb.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return fb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=$m(!0,i||{},{component:{ticks:{distance:r.spacing*ub}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=$m(r,cb.LAYOUTSETTINGS.dimensionAxis);const i=pb(t,n);$m(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=$m(r,cb.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return pb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===cb.HORIZONTAL?cb.VERTICAL:cb.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=$m(r,cb.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=$m({},cb.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),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===Zv))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Zv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Zv).emit("panStart",e)},pan(e){this.chart.component(Zv).emit("panMove",e)},panend(e){this.chart.component(Zv).emit("panEnd",e)},pancancel(e){this.chart.component(Zv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=tb.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=$m(o,cb.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Jv()}`,require:["renderer","chart"],dock:tb.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=$m(s,cb.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=$m(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=lb.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=lb.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",cb.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=$m(o,cb.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,pb(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=$m(o,cb.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,fb(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=$m(o,cb.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,pb(n,l).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 fb(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function pb(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function gb(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 $m(!0,{},o,e||{})}function mb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:tb.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=$m(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function yb(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:tb.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return $m(!0,{},c,e||{})}gb.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=gb($m(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},gb.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 gb($m(!0,n,e||{}),t)},mb.xAxis=function(e,t){return mb($m(!0,{key:"x-axis",scale:"x"},e||{}),t)},mb.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:tb.getYAxisDock(n,r)};return mb($m(!0,i,e||{}),t)},yb.xAxisTitle=function(e,t){return yb($m(!0,{key:"x-axis-title"},e||{}),t)},yb.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:tb.getYAxisDock(n,r)||"left"};return yb($m(!0,i,e||{}),t)};var vb={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 bb={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 xb(){return bb}function wb(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}xb.getLayoutModeKeys=function(){const e=[];let t;for(t in bb)e.push(t);return e};const Mb={left:"left",right:"right",up:"top",down:"bottom"};function kb(e,t,n){switch(e){case"scale":return gb(t,n);case"measure-scale":return gb.measureScale(t,n);case"dimension-scale":return gb.dimensionScale(t,n);case"axis":return mb(t,n);case"box-marker":return function(e){return $m(!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 $m(!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 $m(!0,{},o,e||{})}(t,n);case"text":return yb(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})})),$m(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:vb.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vb.getBublesAlign(s,a,l)}}};return $m(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:vb.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:vb.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),$m(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h={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-${Mb[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return $m(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return $m(!0,{},d,e)}(t,n);case"x-axis":return mb.xAxis(t,n);case"y-axis":return mb.yAxis(t,n);case"x-axis-title":return yb.xAxisTitle(t,n);case"y-axis-title":return yb.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 $m(!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 $m(!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 $m(!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 $m(!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:wb}]}}}]}};return $m(!0,{},o,e||{})}(t,n);default:return}}function _b(e){this.options=e||{},this.settings={dockLayout:{layoutModes:xb()},components:[],scales:{}}}_b.prototype.addComponent=function(e,t,n){const r=kb(e,t,$m(!0,{},this.options,n||{}));return this.settings.components.push(r),r},_b.prototype.addInteraction=function(e,t){const n=kb("interaction",e,$m(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},_b.prototype.addScale=function(e,t,n){const r=kb(e,t,$m(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},_b.prototype.getSettings=function(){return this.settings},_b.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},_b.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");hb(t,n)}(e,this,t)},_b.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))},_b.create=function(e){return new _b(e)},_b.createComponent=kb;const Sb={CENTER:0,BOTTOM:1};var Db={DISCLAIMERS:[{label:"NoDataExist",alignment:Sb.CENTER,default:!0},{label:"RequireNumericDimension",alignment:Sb.CENTER,default:!1},{label:"OnlyNanData",alignment:Sb.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:Sb.CENTER,default:!1},{label:"LimitedData",alignment:Sb.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:Sb.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:Sb.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:Sb.BOTTOM,default:!1}],ALIGNMENT:Sb};const qb={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Db.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 Cb(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Eb(e,t){return e&&t&&t[e]}function Ab(e){this.environment=e,this.clear()}Cb.prototype.isValidAndSupported=function(e,t){return Eb(e.label,this.dataAttributes)&&(e.default||Eb(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Cb.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},Cb.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},Ab.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Ab._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Ab.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=$m(!0,{},this.vizAttributes.supportedDisclaimers),i=new Cb(Db.DISCLAIMERS,this.dataAttributes,r);let o,s;if(i.isAnyValidDisclaimer(Db.ALIGNMENT.CENTER))o=i.getMessage(Db.ALIGNMENT.CENTER,n),s="center";else{if(!i.isAnyValidDisclaimer(Db.ALIGNMENT.BOTTOM))return;o=i.getMessage(Db.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Ab.prototype.set=function(e){if(this.clear(),!e)throw new Error(Ab.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=qb.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Ab.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Tb=Gv.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 Ab(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:[_b.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),_b.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=$m(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:iv(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})}),Nb={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}},Rb=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Ob=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Ib=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Lb=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Pb=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,jb=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,zb=Math.floor,Fb=Math.round,Hb=Gv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof Hb)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fb(255*d),f=Fb(255*f),p=Fb(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fb(255*d),f=Fb(255*f),p=Fb(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fb(255*d),f=Fb(255*f),p=Fb(255*p),g=1}else Nb[h.toLowerCase()]?(n=h.toLowerCase(),d=Nb[n].r,f=Nb[n].g,p=Nb[n].b,g="number"==typeof Nb[n].a?Nb[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+g)&&(this._invalid=!0),this._r=zb(d),this._g=zb(f),this._b=zb(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=Hb.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Hb.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Hb.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Hb.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Hb.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Hb.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=Hb.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Hb.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof Hb||(e=new Hb(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[zb(this._r+(e._r-this._r)*t),zb(this._g+(e._g-this._g)*t),zb(this._b+(e._b-this._b)*t),zb(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 Hb(r)}});Hb.toRGB=function(e){if(e instanceof Hb)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Hb.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Hb.toRGBA=function(e,t){if(e instanceof Hb)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Hb.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Hb.toHex=function(e){let t,n,r;return e instanceof Hb?(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=Hb.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}`)},Hb.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Hb(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},Hb.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Hb(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},Hb.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Hb(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},Hb.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Hb)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},Hb.blend=function(e,t,n){const r=(16711680&(e=Hb.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Hb.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Hb.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new Hb(r,i,o,s)},Hb.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Rb.test(e)||Ob.test(e)||Ib.test(e)||Lb.test(e)||Pb.test(e)||jb.test(e)||Nb[e.toLowerCase()])},Hb.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Hb.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)},Hb.isDark=function(){const e={getLuminance:Hb.prototype.getLuminance,isInvalid:Hb.prototype.isInvalid};return Hb.prototype.init.apply(e,[].slice.call(arguments)),Hb.prototype.isDark.call(e)},Hb.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Vb=".scrollHandler";function Bb(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function $b(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function Wb(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some((e=>e.settings.key===r)))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function Ub(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}Bb.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Bb.prototype.setDisabled=function(e){this._disabled=e},Bb.prototype.getDisabled=function(){return this._disabled},Bb.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,$b.call(this))},Bb.prototype.getItemSize=function(){return this._itemSize},Bb.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||$b.call(this);return this._scrollViewSizeInItem},Bb.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Ub.bind(this)));this._$chartElement.on(`mousewheel${Vb} DOMMouseScroll${Vb}`,Wb.bind(this)),this._$chartElement.on(`touchstart${Vb}`,(e=>{e.preventDefault()})),this._on=!0},Bb.prototype.isOn=function(){return this._on},Bb.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(Vb),this._on=!1},Bb.prototype.updateViewState=function(e){$b.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Bb.prototype.onResize=function(){this._sizeChanged=!0,$b.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Bb.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Bb.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Bb.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Bb.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Bb.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Bb.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};var Yb={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 Xb={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Em.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Yb.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Yb.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 Gb={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_HORIZONTAL:Em.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Yb.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yb.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 Kb(e,t){let n;return n="x-axis"===e?"horizontal"===t?Em.DIRECTION_VERTICAL:Em.DIRECTION_HORIZONTAL:"horizontal"===t?Em.DIRECTION_HORIZONTAL:Em.DIRECTION_VERTICAL,n}var Jb={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Kb(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Yb.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yb.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 Zb={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_VERTICAL:Em.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Yb.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yb.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 Qb={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Em.DIRECTION_VERTICAL:Em.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 ex={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Yb.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 tx={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function 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 a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(ex.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(Xb.callLassoGesture(d,x,w)),a?l?(b.push(Zb.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(Gb.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(Zb.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(Jb.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(Gb.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(Jb.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(Qb.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};function nx(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var rx={create:(...e)=>nx(...e)},ix={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 ox=-3;const sx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=ax(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function ax(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)e[n]===ox&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const lx="dist-flow-tooltip",cx=`#${lx}`;function ux(){if(!document.querySelector(cx)){const e=document.createElement("div");e.id=lx,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 hx({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ux()},beforeUpdate(){ux()},destroyed(){!function(){const e=document.querySelector(cx);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(cx),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:dx}=ab;const fx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:ix.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:dx(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:dx(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:dx(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:dx(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function px(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=$m(!0,{},fx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:rx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=hx({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:sx(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var gx={create:(e,t,n)=>px(e,t,n)};const mx=166/26,yx=12,vx=11,bx=12/vx;function xx(e){return(Math.min(e,3)*yx+Math.max(e-3,0)*mx)/vx}function wx(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function Mx(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=wx(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=wx(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk}));const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function kx(e,t,n){return e*(e<=24?t:n)}var _x={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:xx,getCharacterRatios:wx,getTotalCharacterRatios:Mx,getAdjustedMaxGlyphCount:function(e,t,n){const r=Mx(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(xx(i)+o*bx)},estimateLatinLabelWidth:kx,estimateLabelWidth:function(e,t,n,r,i){return e*n+kx(t,r,i)}};var Sx={generateHyperCube:function(e,t){const n=e.qHyperCube.qMeasureInfo,r=e.qHyperCube.qDataPages[0].qMatrix,i=n.length;if(!i)return;const o=Vv.getColorForPositiveValue(e,t),s=Vv.getColorForNegativeValue(e,t),a=Vv.getColorForSubtotal(e,t),l=e=>`${e}`,c=[];let u,h,d=0,f=0,p=-Number.MAX_VALUE,g=Number.MAX_VALUE,m=-Number.MAX_VALUE,y=Number.MAX_VALUE,v=0;for(let e=0;e<i;e++)h=Number.isNaN(+r[0][e].qNum)?0:r[0][e].qNum,n[e].valueType!==Vv.valueTypes.SUBTOTAL?(d=f,f+=h*(n[e].valueType===Vv.valueTypes.INVERSE?-1:1),u=d<f?o:s,c.push([{qText:n[e].qFallbackTitle,qElemNumber:v++},{qText:u},{qNum:d},{qNum:f},{qNum:f-d,qText:r[0][e].qText}]),n[e].subtotal&&n[e].subtotal.enable&&c.push([{qText:n[e].subtotal.label||"",qElemNumber:v++},{qText:a},{qNum:0},{qNum:f},{qNum:f,qText:l(f)}])):(d=0,f=h,c.push([{qText:n[e].qFallbackTitle,qElemNumber:v++},{qText:a},{qNum:d},{qNum:f},{qNum:f-d,qText:r[0][e].qText}])),p=Math.max(p,d),g=Math.min(g,d),m=Math.max(m,f),y=Math.min(y,f);const b=function(e){return e.qHyperCube.qMeasureInfo[0].qNumFormat}(e),x=e.qHyperCube.qMeasureInfo[0].qIsAutoFormat,w=e.qDef.isCustomFormatted,M={qHyperCube:{qMode:"S",qDataPages:[{qArea:{qTop:0,qLeft:0,qWidth:5,qHeight:c.length},qMatrix:c}],qDimensionInfo:[{qStateCounts:{}},{qStateCounts:{}}],qMeasureInfo:[{qMin:g,qMax:p,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w},{qMin:y,qMax:m,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w},{qMin:y,qMax:m,qNumFormat:b,qIsAutoFormat:x,isCustomFormatted:w}]}};e.generatedMatrix=c,e.generated=M},generateSlicedHyperCube:function(e,t,n){e.generated.qHyperCube.qDataPages=[{qArea:{qTop:t,qLeft:0,qWidth:5,qHeight:n},qMatrix:e.generatedMatrix.slice(t,t+n)}]},getGeneratedDimensionPath:function(e){return`qDimensionInfo/${e}`},getGeneratedMeasurePath:function(e){return`qMeasureInfo/${e}`}};function Dx(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qx(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Cx(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=Dx,n=(t,n)=>Dx(e(t),n),r=(t,n)=>e(t)-n):(t=e===Dx||e===qx?e:Ex,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Ex(){return 0}const Ax=Cx(Dx).right;Cx((function(e){return null===e?NaN:+e})).center;var Tx=Ax;const Nx=Math.sqrt(50),Rx=Math.sqrt(10),Ox=Math.sqrt(2);function Ix(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Nx?10:o>=Rx?5:o>=Ox?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Ix(e,t,2*n):[a,l,c]}function Lx(e,t,n){return Ix(e=+e,t=+t,n=+n)[2]}function Px(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function jx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zx(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fx(){}var Hx=.7,Vx=1/Hx,Bx="\\s*([+-]?\\d+)\\s*",$x="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ux=/^#([0-9a-f]{3,8})$/,Yx=new RegExp(`^rgb\\(${Bx},${Bx},${Bx}\\)$`),Xx=new RegExp(`^rgb\\(${Wx},${Wx},${Wx}\\)$`),Gx=new RegExp(`^rgba\\(${Bx},${Bx},${Bx},${$x}\\)$`),Kx=new RegExp(`^rgba\\(${Wx},${Wx},${Wx},${$x}\\)$`),Jx=new RegExp(`^hsl\\(${$x},${Wx},${Wx}\\)$`),Zx=new RegExp(`^hsla\\(${$x},${Wx},${Wx},${$x}\\)$`),Qx={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 ew(){return this.rgb().formatHex()}function tw(){return this.rgb().formatRgb()}function nw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ux.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?rw(t):3===n?new sw(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?iw(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?iw(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=Yx.exec(e))?new sw(t[1],t[2],t[3],1):(t=Xx.exec(e))?new sw(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Gx.exec(e))?iw(t[1],t[2],t[3],t[4]):(t=Kx.exec(e))?iw(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Jx.exec(e))?dw(t[1],t[2]/100,t[3]/100,1):(t=Zx.exec(e))?dw(t[1],t[2]/100,t[3]/100,t[4]):Qx.hasOwnProperty(e)?rw(Qx[e]):"transparent"===e?new sw(NaN,NaN,NaN,0):null}function rw(e){return new sw(e>>16&255,e>>8&255,255&e,1)}function iw(e,t,n,r){return r<=0&&(e=t=n=NaN),new sw(e,t,n,r)}function ow(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Fx||(e=nw(e)),e?new sw((e=e.rgb()).r,e.g,e.b,e.opacity):new sw}(e):new sw(e,t,n,null==r?1:r)}function sw(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function aw(){return`#${hw(this.r)}${hw(this.g)}${hw(this.b)}`}function lw(){const e=cw(this.opacity);return`${1===e?"rgb(":"rgba("}${uw(this.r)}, ${uw(this.g)}, ${uw(this.b)}${1===e?")":`, ${e})`}`}function cw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hw(e){return((e=uw(e))<16?"0":"")+e.toString(16)}function dw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pw(e,t,n,r)}function fw(e){if(e instanceof pw)return new pw(e.h,e.s,e.l,e.opacity);if(e instanceof Fx||(e=nw(e)),!e)return new pw;if(e instanceof pw)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new pw(s,a,l,e.opacity)}function pw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function gw(e){return(e=(e||0)%360)<0?e+360:e}function mw(e){return Math.max(0,Math.min(1,e||0))}function yw(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}jx(Fx,nw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ew,formatHex:ew,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return fw(this).formatHsl()},formatRgb:tw,toString:tw}),jx(sw,ow,zx(Fx,{brighter(e){return e=null==e?Vx:Math.pow(Vx,e),new sw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Hx:Math.pow(Hx,e),new sw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sw(uw(this.r),uw(this.g),uw(this.b),cw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:aw,formatHex:aw,formatHex8:function(){return`#${hw(this.r)}${hw(this.g)}${hw(this.b)}${hw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:lw,toString:lw})),jx(pw,(function(e,t,n,r){return 1===arguments.length?fw(e):new pw(e,t,n,null==r?1:r)}),zx(Fx,{brighter(e){return e=null==e?Vx:Math.pow(Vx,e),new pw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Hx:Math.pow(Hx,e),new pw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new sw(yw(e>=240?e-240:e+120,i,r),yw(e,i,r),yw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new pw(gw(this.h),mw(this.s),mw(this.l),cw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=cw(this.opacity);return`${1===e?"hsl(":"hsla("}${gw(this.h)}, ${100*mw(this.s)}%, ${100*mw(this.l)}%${1===e?")":`, ${e})`}`}}));var vw=e=>()=>e;function bw(e){return 1==(e=+e)?xw: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):vw(isNaN(t)?n:t)}}function xw(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):vw(isNaN(e)?t:e)}var ww=function e(t){var n=bw(t);function r(e,t){var r=n((e=ow(e)).r,(t=ow(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=xw(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function Mw(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function kw(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=Aw(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function _w(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Sw(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dw(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Aw(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var qw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cw=new RegExp(qw.source,"g");function Ew(e,t){var n,r,i,o=qw.lastIndex=Cw.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=qw.exec(e))&&(r=Cw.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Sw(n,r)})),o=Cw.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}function Aw(e,t){var n,r=typeof t;return null==t||"boolean"===r?vw(t):("number"===r?Sw:"string"===r?(n=nw(t))?(t=n,ww):Ew:t instanceof nw?ww:t instanceof Date?_w:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Mw:Array.isArray(t)?kw:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Dw:Sw)(e,t)}function Tw(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Nw(e){return+e}var Rw=[0,1];function Ow(e){return e}function Iw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Lw(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Iw(i,r),o=n(s,o)):(r=Iw(r,i),o=n(o,s)),function(e){return o(r(e))}}function Pw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Iw(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=Tx(e,t,1,r)-1;return o[n](i[n](t))}}function jw(){var e,t,n,r,i,o,s=Rw,a=Rw,l=Aw,c=Ow;function u(){var e=Math.min(s.length,a.length);return c!==Ow&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),r=e>2?Pw:Lw,i=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=r(a,s.map(e),Sw)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Nw),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Tw,u()},h.clamp=function(e){return arguments.length?(c=!!e||Ow,u()):c!==Ow},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function zw(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Fw(e){return(e=zw(Math.abs(e)))?e[1]:NaN}var Hw,Vw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bw(e){if(!(t=Vw.exec(e)))throw new Error("invalid format: "+e);var t;return new $w({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function $w(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ww(e,t){var n=zw(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Bw.prototype=$w.prototype,$w.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Uw={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ww(100*e,t),r:Ww,s:function(e,t){var n=zw(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Hw=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+zw(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Yw(e){return e}var Xw,Gw,Kw,Jw=Array.prototype.map,Zw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qw(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Yw:(t=Jw.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Yw:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Jw.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Bw(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Uw[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=Uw[v],M=/[defgprs%]/.test(v);function k(e){var i,o,l,d=b,k=x;if("c"===v)k=w(e)+k,e="";else{var _=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),_&&0==+e&&"+"!==h&&(_=!1),d=(_?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===v?Zw[8+Hw/3]:"")+k+(_&&"("===h?")":""),M)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){k=(46===l?s+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!f&&(e=r(e,1/0));var S=d.length+e.length+k.length,D=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=r(D+e,D.length?p-k.length:1/0),D=""),n){case"<":e=d+e+k+D;break;case"=":e=d+D+e+k;break;case"^":e=D.slice(0,S=D.length>>1)+d+e+k+D.slice(S);break;default:e=D+d+e+k}return a(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=Bw(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Fw(t)/3))),i=Math.pow(10,-r),o=Zw[8+r/3];return function(e){return n(i*e)+o}}}}function eM(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?Lx(t,e,n):Lx(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=Bw(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Fw(t)/3)))-Fw(Math.abs(e)))}(o,s))||(r.precision=i),Kw(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fw(t)-Fw(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Fw(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Gw(r)}function tM(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,s]=r?Ix(t,e,n):Ix(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eM(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=Lx(l,c,n))===r)return o[s]=l,o[a]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function nM(){var e=jw()(Ow,Ow);return e.copy=function(){return t=e,nM().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Px.apply(e,arguments),tM(e)}!function(e){Xw=Qw(e),Gw=Xw.format,Kw=Xw.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const rM={getMinorTicks({majorTicks:e,minorTickCount:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n},adjustTicks({ticks:e,majorTicks:t,minorTicks:n,autoMinMax:r,minMax:i,min:o,max:s}){const a=n[0]-t[0],l=t[0]-o;l>a&&e.unshift({value:t[0]-a,isMinor:!0});const c=s-t[t.length-1];return c>a&&e.push({value:t[t.length-1]+a,isMinor:!0}),r||(("min"===i||"minMax"===i)&&l>0&&e.unshift({value:o,isMinor:!1}),("max"===i||"minMax"===i)&&c>0&&e.push({value:s,isMinor:!1})),e},getTicks({layout:e,height:t}){const{autoMinMax:n,minMax:r,spacing:i}=e.measureAxis;let o=Math.min(...e.generated.qHyperCube.qMeasureInfo.map((e=>e.qMin))),s=Math.max(...e.generated.qHyperCube.qMeasureInfo.map((e=>e.qMax)));if(!n)switch(r){case"min":o=e.measureAxis.min;break;case"max":s=e.measureAxis.max;break;case"minMax":({min:o,max:s}=e.measureAxis)}const a=100*i,l=Math.max(1,Math.round(t/a)),c=nM().domain([o,s]).ticks(l),u=rM.getMinorTicks({majorTicks:c,minorTickCount:1}),h=[...c.map((e=>({value:e,isMinor:!1}))),...u.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value));return rM.adjustTicks({ticks:h,majorTicks:c,minorTicks:u,autoMinMax:n,minMax:r,min:o,max:s})}},iM=Vv.chartID,oM=20,sM=.7;function aM(e){this._scrollHandler.setDisabled(!!e)}function lM(e){let t=-Number.MAX_VALUE;return e.qHyperCube.qMeasureInfo.forEach((e=>{t=Math.max(t,e.qFallbackTitle.length),e.valueType!==Vv.valueTypes.SUBTOTAL&&e.subtotal&&e.subtotal.enable&&(t=Math.max(t,e.subtotal.label?e.subtotal.label.length:0))})),Math.min(oM,Math.max(0,t))}function cM(e){return{settings:{labels:{mode:e.dimensionAxis.label,maxGlyphCount:Math.ceil(_x.stringWidthOverMWidth(lM(e))),maxLengthPx:this.picassoElement.getBoundingClientRect().height/4}}}}function uM(e){const t=e.data.measure,n=e.dataset(t.source.key).field(t.source.field);return ix.formatMeasureValue(n,t)}function hM(e,t){return{viewSize:t,max:e.generatedMatrix.length}}const dM=Tb.extend("WaterfallChart",{namespace:".waterfallchart",chartID:iM,init:function({picasso:e,environment:t,$element:n,flags:r}){this._super(e,n,t,null,null),this._tooltipHandler=gx.create(this.chartInstance,n,iM),this._scrollHandler=new Bb(this.chartInstance,n,this.getSlicedData.bind(this),this.updateChart.bind(this)),this._scrollHandler.setOptions({direction:"horizontal"}),this.setDataPaths(["generated/qHyperCube"]),this.flags=r},updateConstraints:function(e){const t=!e.active,n=!e.passive;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"]()},off:function(){this._scrollHandler.off(),this._tooltipHandler.off()},createChartSettings:function(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=_b.create({chartID:iM,theme:n,isRtl:t}),o=this.picassoElement.clientWidth,s=this.picassoElement.clientHeight,a={};a.box=this._tooltipHandler.setUp({chartBuilder:i,environment:this.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",headerResolver(){},rowResolver(e,t,n){const r=n.boxColor.value;return{value:ix.formatMeasureValue(e,t),label:n.tooltip.value.qText,color:r}},labelData:["tooltip"],measureRows:["measure"]});const l={scrollHandler:this._scrollHandler,selectionHandler:null};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=tx.create(l,"vertical",t,{componentKey:"box-marker"}),i.addPreset("dimension-measure-chart",{isRtl:t,orientation:"vertical",theme:n,gridlines:e.gridlines,includeDimensionAxis:!0,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:cM.call(this,e),dimensionSource:Sx.getGeneratedDimensionPath(0),dimensionScaleSettings:{component:{maxPxStep:()=>s/4}},includeMeasureAxis:!0,measureAxisProperties:e.measureAxis,measureSource:[Sx.getGeneratedMeasurePath(0),Sx.getGeneratedMeasurePath(1)],measureScaleSettings:{component:{expand:0,include:[0],ticks:{values:()=>rM.getTicks({layout:e,height:s})}}},hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:hM(e,this._scrollHandler.getScrollViewSizeInItem()),refLines:e.refLine&&e.refLine.refLines,brushActions:this._dependentActions.gestures,axisLabelStyle:Pv(iM,n,e,this.flags)}),i.addComponent("box-marker",function(e,t){const n=e?[e.box.trigger]:[],r=e?e.box.consume:[];return{data:{extract:{key:"qHyperCube",field:Sx.getGeneratedDimensionPath(0),props:{start:{field:Sx.getGeneratedMeasurePath(0)},end:{field:Sx.getGeneratedMeasurePath(1)},measure:{field:Sx.getGeneratedMeasurePath(2),reduce:"first",value:e=>e},boxColor:{field:Sx.getGeneratedDimensionPath(1),value:e=>e.qText},isCustomFormatted:!!t.qDef.isCustomFormatted,tooltip:{value:e=>e}}}},settings:{major:{scale:"dimension"},minor:{scale:"measure"},orientation:"",box:{width:sM,maxWidthPx:4e3,fill:e=>e.datum.boxColor.value,strokeWidth:0}},brush:{trigger:n,consume:r}}}(a,e)),i.addComponent("point-marker",function(e,t){const n=t.getStyle(iM,"shape.bridge","stroke");return{data:{extract:{key:"qHyperCube",field:Sx.getGeneratedDimensionPath(0),props:{x:{},y:{field:Sx.getGeneratedMeasurePath(1)}}}},settings:{x:{scale:"dimension",ref:"x",fn:t=>e?t.scale(t.datum.value):t.scale(t.datum.value)+t.scale.bandwidth()},y:{scale:"measure"},sizeLimits:{maxPx:2e4,maxRelExtent:1e4,minRelDiscrete:0,maxRelDiscrete:1},shape:"line",stroke:n,size:1-sM,strokeDasharray:"4 4",fill:"none",strokeWidth:(e,t)=>t===e.data.items.length-1?0:2}}}(t,n)),e.legend&&!e.legend.show||i.addComponent("categorical-legend",function(e,t,n){const{theme:r,translator:i}=e,o=Vv.getColorForPositiveValue(t,r),s=Vv.getColorForNegativeValue(t,r),a=Vv.getColorForSubtotal(t,r),l=i.get("waterfall.legend.positiveValue.label"),c=i.get("waterfall.legend.negativeValue.label"),u=i.get("waterfall.legend.subtotal.label"),h=zv(iM,r,t,n);return{displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,scale:{type:"categorical-color",data:[l,c,u],range:[o,s,a]},style:{item:{label:{fontSize:h.fontSize,fontFamily:h.fontFamily,fill:h.color}},title:{show:!1}}}}(this.environment,e,this.flags),{dock:e.legend?e.legend.dock:"auto",isRtl:t,chartWidth:o,chartHeight:s});const c=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,h={theme:t,matrix:wv(s),styles:void 0};return h.styles=kv({theme:t,id:i,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=kv({theme:e,id:i,transform:l,extend:u,matrix:h.matrix})}}}({theme:n,config:{id:"waterfallChart"}});e.dataPoint.showLabels&&i.addComponent("labels",function(e,t,n){const r=e.getStyles(),i=jv(iM,r,t,n),o=(null==i?void 0:i.fill)||r.label.value.color,s=r.label.value.darkColor,a=r.label.value.lightColor;return{settings:{sources:[{strategy:{settings:{...i,direction:e=>e.data&&e.data.end.value>e.data.start.value?"up":"down",labels:[{placements:[{fill:o},{fill:n.isEnabled("CLIENT_IM_3364")&&null!=i&&i.fill?o:e=>Hb.isDark(e.node.attrs.fill)?a:s},{position:"opposite",fill:o,justify:0}],label:uM}]}}}]}}}(c,e,this.flags));const u=i.getSettings();return this.addSnapshotChartSettings(u,e),u},updateData:function(e){const{theme:t,options:n}=this.environment,r=this;return this._super(e).then((()=>{if(r._destroyed)return Promise.reject();let i,o;if(!!e.snapshotData){const e=r.layout.generated.qHyperCube.qDataPages[0].qArea;i=e.qTop,o=e.qHeight,Sx.generateHyperCube(r.layout,t)}else{Sx.generateHyperCube(r.layout,t),aM.call(r,!0);const{viewState:e}=n;e?(r._scrollHandler.updateViewState(r.layout.generatedMatrix.length),r._scrollHandler.setScrollState(e.scroll),i=e.scroll):(r._scrollHandler.resetScroll(),i=0),o=r._scrollHandler.getScrollViewSizeInItem()}Sx.generateSlicedHyperCube(r.layout,i,o)}))},resize:function(){this._scrollHandler.onResize(),this._super()},paint:function(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||aM.call(this,!1),this._tooltipHandler.closeTooltip();const t=this.layout.generated.qHyperCube.qDataPages[0].qMatrix.length,n=this.layout.generatedMatrix.length;if(!e&&this._scrollHandler.isDataSizeChanged(t,n)){const e=this._super,t=this;return this._scrollHandler.getViewData().finally((()=>e.call(t)))}return this._super()},getSlicedData:function(e,t){return Sx.generateSlicedHyperCube(this.layout,e,t),Promise.resolve(this.layout)},setSnapshotData:function(e){this._super(e),e.generated=this.layout.generated,e.generatedMatrix=this.layout.generatedMatrix},getViewState:function(){return{scroll:this._scrollHandler.getScrollState()}}});return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator),{qae:Gm(t),ext:Yv(t),component(){const n=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=r.options.renderer,s=e.useMemo((()=>Nm(o)),[o]),a=e.useStaleLayout(),l=e.useConstraints(),[c,u]=e.useState();var h;e.useEffect((()=>{const e=i(n),o=new dM({picasso:s,environment:r,$element:e,flags:t.flags});return u(o),()=>{o.destroy()}}),[]),function(...t){const[,n]=e.usePromise(...t);if(n)throw n}((async()=>{c&&(c.updateEnvironment(r),c.updateConstraints(l),await c.updateData(a),await c.paint())}),[a,c,r]),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}(c),h=c,e.onTakeSnapshot((e=>{if(h)return h.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(h)return h.getViewState()}})),[h])}}}}));
|
|
27
27
|
//# sourceMappingURL=sn-waterfall.js.map
|