@nebula.js/sn-bar-chart 1.31.2 → 1.31.3

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/core/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-bar-chart v1.31.2
2
+ * @nebula.js/sn-bar-chart v1.31.3
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -15,4 +15,4 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.le
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */
18
- Object.defineProperty(Jf,"__esModule",{value:!0});var Xf="function"==typeof Symbol&&Symbol.for,Zf=Xf?Symbol.for("react.element"):60103,Qf=Xf?Symbol.for("react.portal"):60106,em=Xf?Symbol.for("react.fragment"):60107,tm=Xf?Symbol.for("react.strict_mode"):60108,nm=Xf?Symbol.for("react.profiler"):60114,rm=Xf?Symbol.for("react.provider"):60109,im=Xf?Symbol.for("react.context"):60110,om=Xf?Symbol.for("react.async_mode"):60111,am=Xf?Symbol.for("react.concurrent_mode"):60111,sm=Xf?Symbol.for("react.forward_ref"):60112,lm=Xf?Symbol.for("react.suspense"):60113,um=Xf?Symbol.for("react.suspense_list"):60120,cm=Xf?Symbol.for("react.memo"):60115,dm=Xf?Symbol.for("react.lazy"):60116,fm=Xf?Symbol.for("react.fundamental"):60117,mm=Xf?Symbol.for("react.responder"):60118,pm=Xf?Symbol.for("react.scope"):60119;function hm(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Zf:switch(e=e.type){case om:case am:case em:case nm:case tm:case lm:return e;default:switch(e=e&&e.$$typeof){case im:case sm:case rm:return e;default:return t}}case dm:case cm:case Qf:return t}}}function gm(e){return hm(e)===am}Jf.typeOf=hm,Jf.AsyncMode=om,Jf.ConcurrentMode=am,Jf.ContextConsumer=im,Jf.ContextProvider=rm,Jf.Element=Zf,Jf.ForwardRef=sm,Jf.Fragment=em,Jf.Lazy=dm,Jf.Memo=cm,Jf.Portal=Qf,Jf.Profiler=nm,Jf.StrictMode=tm,Jf.Suspense=lm,Jf.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===em||e===am||e===nm||e===tm||e===lm||e===um||"object"==typeof e&&null!==e&&(e.$$typeof===dm||e.$$typeof===cm||e.$$typeof===rm||e.$$typeof===im||e.$$typeof===sm||e.$$typeof===fm||e.$$typeof===mm||e.$$typeof===pm)},Jf.isAsyncMode=function(e){return gm(e)||hm(e)===om},Jf.isConcurrentMode=gm,Jf.isContextConsumer=function(e){return hm(e)===im},Jf.isContextProvider=function(e){return hm(e)===rm},Jf.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Zf},Jf.isForwardRef=function(e){return hm(e)===sm},Jf.isFragment=function(e){return hm(e)===em},Jf.isLazy=function(e){return hm(e)===dm},Jf.isMemo=function(e){return hm(e)===cm},Jf.isPortal=function(e){return hm(e)===Qf},Jf.isProfiler=function(e){return hm(e)===nm},Jf.isStrictMode=function(e){return hm(e)===tm},Jf.isSuspense=function(e){return hm(e)===lm},"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),bf.exports.oneOfType([bf.exports.func,bf.exports.PropTypes.object]);var ym=["xs","sm","md","lg","xl"];function vm(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=Wf(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=ym.indexOf(t)+1;return r===ym.length?l(e):"@media (min-width:".concat(n[e]).concat(i,") and ")+"(max-width:".concat(n[ym[r]]-a/100).concat(i,")")}return Uf({keys:ym,values:n,up:l,down:function(e){var t=ym.indexOf(e)+1,r=n[ym[t]];return t===ym.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}function bm(e,t,n){var r;return Uf({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Uf({paddingLeft:t(2),paddingRight:t(2)},n,Vf({},e.up("sm"),Uf({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},Vf(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Vf(r,e.up("sm"),{minHeight:64}),r)},n)}var xm="#7986cb",qm="#3f51b5",Mm="#303f9f",Sm="#ff4081",Dm="#f50057",Cm="#c51162",wm={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},Lm="#e57373",Em="#f44336",Tm="#d32f2f",km={black:"#000",white:"#fff"},Nm={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:km.white,default:wm[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.08)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.14)",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)"}},Am={text:{primary:km.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:wm[800],default:"#303030"},action:{active:km.white,hover:"rgba(255, 255, 255, 0.1)",hoverOpacity:.1,selected:"rgba(255, 255, 255, 0.2)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"}};function Om(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=zf(e),t=Hf(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return Bf(e)}(e.main,r):"dark"===t&&(e.dark=function(e,t){if(e=zf(e),t=Hf(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return Bf(e)}(e.main,1.5*r)))}function Im(e){var t=e.primary,n=void 0===t?{light:xm,main:qm,dark:Mm}:t,r=e.secondary,i=void 0===r?{light:Sm,main:Dm,dark:Cm}:r,o=e.error,a=void 0===o?{light:Lm,main:Em,dark:Tm}:o,s=e.type,l=void 0===s?"light":s,u=e.contrastThreshold,c=void 0===u?3:u,d=e.tonalOffset,f=void 0===d?.2:d,m=Wf(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function p(e){return function(e,t){var n=_f(e),r=_f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,Am.text.primary)>=c?Am.text.primary:Nm.text.primary}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(e=Uf({},e)).main&&e[t]&&(e.main=e[t]),Om(e,"light",n,f),Om(e,"dark",r,f),e.contrastText||(e.contrastText=p(e.main)),e}var g={dark:Am,light:Nm};return Yf(Uf({common:km,type:l,primary:h(n),secondary:h(i,"A400","A200","A700"),error:h(a),grey:wm,contrastThreshold:c,getContrastText:p,augmentColor:h,tonalOffset:f},g[l]),m,{clone:!1})}function Pm(e){return Math.round(1e5*e)/1e5}var Rm={textTransform:"uppercase"};function Fm(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,f=void 0===d?500:d,m=n.fontWeightBold,p=void 0===m?700:m,h=n.htmlFontSize,g=void 0===h?16:h,y=n.allVariants,v=n.pxToRem,b=Wf(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,q=v||function(e){return"".concat(e/g*x,"rem")},M=function(e,t,n,r,o){return Uf({fontFamily:i,fontWeight:e,fontSize:q(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===i?{letterSpacing:"".concat(Pm(r/t),"em")}:{},{},o,{},y)},S={h1:M(l,96,1,-1.5),h2:M(l,60,1,-.5),h3:M(c,48,1.04,0),h4:M(c,34,1.17,.25),h5:M(c,24,1.33,0),h6:M(f,20,1.6,.15),subtitle1:M(c,16,1.75,.15),subtitle2:M(f,14,1.57,.1),body1:M(c,16,1.5,.15),body2:M(c,14,1.43,.15),button:M(f,14,1.75,.4,Rm),caption:M(c,12,1.66,.4),overline:M(c,12,2.66,1,Rm)};return Yf(Uf({htmlFontSize:g,pxToRem:q,round:Pm,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:f,fontWeightBold:p},S),b,{clone:!1})}function jm(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var Hm=["none",jm(0,2,1,-1,0,1,1,0,0,1,3,0),jm(0,3,1,-2,0,2,2,0,0,1,5,0),jm(0,3,3,-2,0,3,4,0,0,1,8,0),jm(0,2,4,-1,0,4,5,0,0,1,10,0),jm(0,3,5,-1,0,5,8,0,0,1,14,0),jm(0,3,5,-1,0,6,10,0,0,1,18,0),jm(0,4,5,-2,0,7,10,1,0,2,16,1),jm(0,5,5,-3,0,8,10,1,0,3,14,2),jm(0,5,6,-3,0,9,12,1,0,3,16,2),jm(0,6,6,-3,0,10,14,1,0,4,18,3),jm(0,6,7,-4,0,11,15,1,0,4,20,3),jm(0,7,8,-4,0,12,17,2,0,5,22,4),jm(0,7,8,-4,0,13,19,2,0,5,24,4),jm(0,7,9,-4,0,14,21,2,0,5,26,4),jm(0,8,9,-5,0,15,22,2,0,6,28,5),jm(0,8,10,-5,0,16,24,2,0,6,30,5),jm(0,8,11,-5,0,17,26,2,0,6,32,5),jm(0,9,11,-5,0,18,28,2,0,7,34,6),jm(0,9,12,-6,0,19,29,2,0,7,36,6),jm(0,10,13,-6,0,20,31,3,0,8,38,7),jm(0,10,13,-6,0,21,33,3,0,8,40,7),jm(0,10,14,-6,0,22,35,3,0,8,42,7),jm(0,11,14,-7,0,23,36,3,0,9,44,8),jm(0,11,15,-7,0,24,38,3,0,9,46,8)],zm={borderRadius:4};function Bm(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;e="function"==typeof t?t:function(e){return t*e};var n=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return 0===n.length?e(1):1===n.length?e(n[0]):n.map((function(t){var n=e(t);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return t}}),n.mui=!0,n}var _m={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Vm={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195},Um=function(e){return"".concat(Math.round(e),"ms")},Wm={easing:_m,duration:Vm,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?Vm.standard:n,i=t.easing,o=void 0===i?_m.easeInOut:i,a=t.delay,s=void 0===a?0:a;return Wf(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:Um(r)," ").concat(o," ").concat("string"==typeof s?s:Um(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},$m={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Km(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.shadows,l=e.spacing,u=e.typography,c=void 0===u?{}:u,d=Wf(e,["breakpoints","mixins","palette","shadows","spacing","typography"]),f=Im(a),m=vm(n),p=Bm(l),h=Uf({breakpoints:m,direction:"ltr",mixins:bm(m,p,i),overrides:{},palette:f,props:{},shadows:s||Hm,typography:Fm(f,c),spacing:p},Yf({shape:zm,transitions:Wm,zIndex:$m},d));return h}f({defaultTheme:Km()});const Gm=Km({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const Ym=m({productionPrefix:"qb739",disableGlobal:!0,seed:""});function Jm(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,o=e();const a={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=o.scaleRatio.x,n=o.scaleRatio.y;return r.style.left=Math.round(o.margin.left+o.x*t)+"px",r.style.top=Math.round(o.margin.top+o.y*n)+"px",r.style.width=Math.round(o.width)+"px",r.style.height=Math.round(o.height)+"px",r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",d.render(function(e,t){return i.createElement(p,{generateClassName:t},i.createElement(h,{theme:Gm},e))}(e,Ym),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&d.unmountComponentAtNode(r),a),destroy(){r&&r.parentElement&&(d.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(o=e(t)),o)};return a}}function Xm(){return function(e){e.renderer("react",Jm()),e.component("data-title",jf(e.renderer("svg")())),e.component("disclaimer",function(){class e extends i.Component{render(){const{label:e,spanStyle:t}=this.props;return i.createElement(i.Fragment,null,i.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:bf.exports.string.isRequired,spanStyle:bf.exports.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:o={}}=this.settings,a="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",s=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=n.height+"px",r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=n.height+"px",r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=n.width+"px",r.height=n.height+"px",r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:case"top":case"bottom":r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(o,r,this.rect),l="center"===r?t:"* "+t,u="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return i.createElement("div",{style:s,dir:a},i.createElement(i.Fragment,null,i.createElement(e,{label:l,spanStyle:u})))}}}())}}var Zm={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:Qm}=Zm;function ep({layoutService:e,largeDataService:t}){const{maxNumPoints:n=Qm}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:tp}=Zm,np=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=tp}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!ep({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:rp}=Zm,{MAX_NUM_POINTS:ip,DEFAULT_NUM_POINTS:op,DEFAULT_NUM_LINES:ap}=Zm,{DEFAULT_NUM_POINTS:sp}=Zm,lp=({layoutService:e,largeDataService:t})=>{if(!ep({layoutService:e,largeDataService:t})){const{maxNumPoints:e=sp}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=ap,maxNumPoints:o=op,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(np({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>ap||o>op)?Math.min(u,Math.ceil(ip/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=rp}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})};function up({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>ep({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>lp({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>np({layoutService:t,largeDataService:n}),fetch:(i,o)=>(({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:lp({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:np({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)})({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function cp(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function dp({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function fp(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function mp(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=fp(),o=fp();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function pp(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function hp(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=mp(e,t,n.qMatrix),i=pp(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}function gp(e){return e.qIsOtherCell}function yp({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(gp)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some(gp)||t++})),t}(n)}const vp={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var bp={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};function xp(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function qp(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const f={x:c+i,y:i,width:d-2*i,height:t.height-2*i},m=s(l[0]+"…").width,p=Math.max(0,f.width-u.width),h=Math.max(0,f.height-u.height),g=o*p,y=a*h;return{show:f.width>=Math.min(m,u.width),text:l,dx:g,dy:y,rect:f,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=xp(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:xp(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function Mp(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=xp(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:xp(i,n.minorGuideLine.strokeWidth),x2:o,y2:xp(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Sp(e){return e.filter((e=>e.show)).map((e=>G({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var Dp={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=xp(1,t.line.strokeWidth);return{show:n.line.show,x1:xp(0,t.line.strokeWidth),y1:r,x2:xp(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=qp(n,this),this.state.minor=Mp(r,this)},render(){return[...Sp([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>G({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...Sp(this.state.major.map((e=>e.guideLine))),...Sp(this.state.minor.map((e=>e.guideLine)))];var e}};function Cp(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function wp(e){return e.qTags.indexOf("$qualified")>-1}function Lp({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];Cp(o,a)?(wp(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function Ep({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function Tp({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(""+e.qText).width+16}))),r.clamp(n),i.rangeAndWidth}}}function kp({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Np({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Tp,queryFactory:s=kp}={attributesFactory:Tp,queryFactory:kp}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Ap({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Np,mapper:a=Lp,resolver:s=Ep}={metaFactory:Np,mapper:Lp,resolver:Ep}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),f=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=f.resolve(t);return n.set(r,i),i}}}function Op(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Ip=Op(0).getTime();function Pp(e){return(e.getTime()-Ip)/86400/1e3}var Rp=new Date,Fp=new Date;function jp(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return jp((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Rp.setTime(+t),Fp.setTime(+r),e(Rp),e(Fp),Math.floor(n(Rp,Fp))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Hp=jp((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Hp.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jp((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Hp:null},Hp.range;var zp=jp((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}));function Bp(e){return jp((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}zp.range,jp((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})).range,jp((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})).range,jp((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})).range;var _p=Bp(0),Vp=Bp(1),Up=Bp(2),Wp=Bp(3),$p=Bp(4),Kp=Bp(5),Gp=Bp(6);_p.range,Vp.range,Up.range,Wp.range,$p.range,Kp.range,Gp.range,jp((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})).range;var Yp=jp((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Yp.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jp((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},Yp.range;var Jp=jp((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()}));Jp.range;var Xp=jp((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}));Xp.range;var Zp=jp((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}));function Qp(e){return jp((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}Zp.range;var eh=Qp(0),th=Qp(1),nh=Qp(2),rh=Qp(3),ih=Qp(4),oh=Qp(5),ah=Qp(6);eh.range,th.range,nh.range,rh.range,ih.range,oh.range,ah.range;var sh=jp((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));sh.range;var lh=jp((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));lh.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jp((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},lh.range;const uh=1,ch=2,dh=3,fh=4,mh=5,ph=6;function hh({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return lh.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=zp.count(e,t),l=Jp.count(e,t),u=Xp.count(e,t),c=Zp.count(e,t),d=eh.count(e,t),f=sh.count(e,t),m=lh.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:m,interval:lh.every(1),formatter:r.year.formatter,offset:e=>lh.offset(e,-1),floor:lh.floor};if(s<=p)v.type=uh,v.desc="second",v.count=s,v.interval=zp.every(1),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-1),v.floor=zp.floor;else if(s/2<=p)v.type=uh,v.desc="every other second",v.count=s/2,v.interval=zp.every(2),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-2),v.floor=zp.floor;else if(s/5<=p)v.type=uh,v.desc="every 5 second",v.count=s/5,v.interval=zp.every(5),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-5),v.floor=zp.floor;else if(s/15<=p)v.type=uh,v.desc="every 15 second",v.count=s/15,v.interval=zp.every(15),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-15),v.floor=zp.floor;else if(s/30<=p)v.type=uh,v.desc="every 30 second",v.count=s/30,v.interval=zp.every(30),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-30),v.floor=zp.floor;else if(l<=h)v.type=ch,v.desc="minute",v.count=l,v.interval=Jp.every(1),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-1),v.floor=Jp.floor;else if(l/2<=h)v.type=ch,v.desc="every 2 minute",v.count=l/2,v.interval=Jp.every(2),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-2),v.floor=Jp.floor;else if(l/5<=h)v.type=ch,v.desc="every 5 minute",v.count=l/5,v.interval=Jp.every(5),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-5),v.floor=Jp.floor;else if(l/10<=h)v.type=ch,v.desc="every 10 minute",v.count=l/10,v.interval=Jp.every(10),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-10),v.floor=Jp.floor;else if(l/15<=h)v.type=ch,v.desc="every 15 minute",v.count=l/15,v.interval=Jp.every(15),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-15),v.floor=Jp.floor;else if(l/30<=h)v.type=ch,v.desc="every 30 minute",v.count=l/30,v.interval=Jp.every(30),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-30),v.floor=Jp.floor;else if(u<=h)v.type=dh,v.desc="hour",v.count=u,v.interval=Xp.every(1),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-1),v.floor=Xp.floor;else if(u/2<=h)v.type=dh,v.desc="every 2 hour",v.count=u/2,v.interval=Xp.every(2),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-2),v.floor=Xp.floor;else if(u/3<=h)v.type=dh,v.desc="every 3 hour",v.count=u/3,v.interval=Xp.every(3),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-3),v.floor=Xp.floor;else if(u/6<=h)v.type=dh,v.desc="every 6 hour",v.count=u/6,v.interval=Xp.every(6),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-6),v.floor=Xp.floor;else if(u/12<=h||i)v.type=dh,v.desc="every 12 hour",v.count=u/12,v.interval=Xp.every(12),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-12),v.floor=Xp.floor;else if(c<=g)v.type=fh,v.desc="day",v.count=c,v.interval=Zp.every(1),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-1),v.floor=Zp.floor;else if(c/2<=g)v.type=fh,v.desc="every 2 day",v.count=c/2,v.interval=Zp.every(2),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-2),v.floor=Zp.floor;else if(c/3<=g)v.type=fh,v.desc="every 3 day",v.count=c/3,v.interval=Zp.every(3),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-3),v.floor=Zp.floor;else if(d<=g)v.type=fh,v.desc="week",v.count=d,v.interval=eh.every(1),v.formatter=r.date.formatter,v.offset=e=>eh.offset(e,-1),v.floor=Zp.floor;else if(d/2<=g)v.type=fh,v.desc="every 2 week",v.count=d/2,v.interval=eh.every(2),v.formatter=r.date.formatter,v.offset=e=>eh.offset(e,-2),v.floor=Zp.floor;else if(f<=g)v.type=mh,v.desc="month",v.count=f,v.interval=sh.every(1),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-1),v.floor=Zp.floor;else if(f/3<=g)v.type=mh,v.desc="quarter",v.count=f/3,v.interval=sh.every(3),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-3),v.floor=Zp.floor;else if(f/6<=g)v.type=mh,v.desc="half year",v.count=f/6,v.interval=sh.every(6),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-6),v.floor=Zp.floor;else if(m<=y)v.type=ph,v.desc="year",v.count=m,v.interval=lh.every(1),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-1),v.floor=lh.floor;else if(m/2<=y)v.type=ph,v.desc="every 2 year",v.count=m/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-2),v.floor=lh.floor;else if(m/5<=y)v.type=ph,v.desc="every 5 year",v.count=m/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-5),v.floor=lh.floor;else if(m/10<=y)v.type=ph,v.desc="every 10 year",v.count=m/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-10),v.floor=lh.floor;else{const e=Math.floor(m/y);v.type=ph,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>lh.offset(t,-e),v.floor=lh.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const f=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let m=[];if(!o&&c.type<=dh){const n=t.getFormat("date"),r=e.ticks(Zp.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Zp.offset(r[0],-1)),m=(r.length?r:[Zp.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:f,outer:m}}const gh={};function yh(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function vh(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=function(){return Ot.apply(yo(Xr,Jr,Vr,Br,zr,Hr,Er,Lr,ni).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}().domain([Op(l),Op(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let f;f="d3"===d.type?(e,i)=>hh({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Op(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(gh[[t,n,r,r,o]])return gh[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Op(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,f=t/(i-r),m=f/1440,p=f/86400,h=366*f,g=3*f*30,y=a.second.width/p,v=a.minute.width/m,b=a.date.width/g,x=a.year.width/h;let q,M,S,D=0,C=0,w=null,L=null,E=null,T=null,k=null,N=null;const A={outer:[],inner:[]};for(y<1?(w=1,C=1/86400):y<2?(w=2,C=1/86400*2):y<5?(w=5,C=1/86400*5):y<10?(w=10,C=1/86400*10):y<30?(w=30,C=1/86400*30):v<1?(L=1,C=1/1440):v<2?(L=2,C=1/1440*2):v<5?(L=5,C=1/1440*5):v<10?(L=10,C=1/1440*10):v<30?(L=30,C=1/1440*30):v<60?(E=1,C=1/24):v<120?(E=2,C=2/24):v<360?(E=6,C=.25):v<720?(E=12,C=.5):b<1/90?(C=1,T=1):b<2/90?(C=2,T=2):b<7/90?(C=7,T=7):b<31/90?(k=1,C=31):b<1?(k=3,C=90):x<1?(N=1,C=366):x<2?(N=2,C=732):x<5?(N=5,C=1826.25):(N=10,C=3652.5),M=Math.floor((d+n%1)/C);D<i;){S=M+1,q=N?yh("year",[l+M*N,0,1],[l+S*N,0,1],a.year.formatter):k?yh("month",[l,u+M*k,1],[l,u+S*k,1],a.date.formatter):T?yh("day",[l,u,c+M*T],[l,u,c+S*T],a.date.formatter):E?yh("hour",[l,u,c,0+M*E],[l,u,c,0+S*E],a.minute.formatter):L?yh("minute",[l,u,c,0,0+M*L],[l,u,c,0,0+S*L],a.minute.formatter):yh("second",[l,u,c,0,0,0+M*w],[l,u,c,0,0,0+S*w],a.second.formatter),D=Pp(q.start),A.inner.push(q);const e=Math.floor(D);if(!(o||N||k||T)){const t={type:"day",start:Op(e),end:Op(e+1),formatter:a.date.formatter,qStart:e};A.outer[A.outer.length-1]&&A.outer[A.outer.length-1].qStart===t.qStart||A.outer.push(t)}M++}return A.min=r,A.max=i,gh[[t,n,r,r,o]]=A,A}(n,e,d.min,l,u,"T"===s.qType);const m={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>f(t,n)[a].map((t=>{let n;return n="start"===i?Pp(t.start):"end"===i?Pp(t.end):(Pp(t.start)+Pp(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Pp(t.start),end:Pp(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return m}const bh=/t+/i;const xh={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function qh(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Mh="continuousPan";var Sh={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=vp,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=up,snapshotFetcherFactory:u=dp,cacheFetcherFactory:c=cp,cache:d={initial:{},merged:{}}}=s,f=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),m=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,r;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,r=v,Math.max(1e-6,2.3841857910156157e-7*(r-n)))),g=t.meta.isSnapshot?m:f,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=m.getSnapshotData()),o.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),e},initialFetch(){return g.fetch(y,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=pp(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>hp(y,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>g.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=pp(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>hp(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>hp(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return G({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return G({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>yp(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=mu(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return pu(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),f=Math.abs(d-c),m=f-(r>0?.7071067811865475:1.4142135623730951)*f,p=c+m*u,h=d-m*(1-u),g=p<a?a-p:0,y=h>s?h-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(h+g,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Mh,pointers:1,threshold:10,enable(r,i){return this.started===Mh||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{continuousPanstart(n){n.preventDefault(),this.started=Mh;const{min:i,max:o}=r.get("zoom");this[Mh]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},continuousPanmove(e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[Mh],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},continuousPanend(e){e.preventDefault(),this.started=!1},continuousPancancel(e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:bp,timeAxis:Dp},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=G(!0,{},t[i],o)})),r}(t,xh,n),{qAxis:i}=r,o=Sr(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const f=function(e){return Number.isNaN(+e)?NaN:o(e)};f.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},f.invert=e=>o.invert(e),f.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),f.range=e=>Array.isArray(e)?o.range(e):o.range(),f.norm=e=>(qh(a,f),a.instance(e)),f.normInvert=e=>(qh(a,f),a.instance.invert(e)),f.copy=()=>e(t,n),f.clamp=(e=!0)=>(o.clamp(e),o.clamp()),f.min=()=>Math.min(s,l),f.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const m=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return i&&bh.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(41000.2343433)).width+16)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=Op(t[0].data.start),i=Op(t[n-1].data.start);return Zp.count(r,i)/n>=1?o.date:Xp.count(r,i)/n>0?o.minute:Jp.count(r,i)/n>0?o.second:o.date},t}(r);return c=vh(o.copy(),r,m),u=Ap({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*m.getFormat("minute").width,cache:r.cache,scale:f}),f.data=()=>({fields:[{formatter:f.formatter,id:()=>"qHyperCube/"+r.field,key:()=>r.field,raw:uu(n,"fields.0.raw",(()=>({})))}]}),f.formatter=()=>m.getFormatFromTicks(d).formatter,f}}};const Dh={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Ch={OPTIONS:Dh,DEFAULT:Dh.MINI_CHART};function wh({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Lh({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Eh=e=>({miniChart:e===Ch.OPTIONS.MINI_CHART.value,bar:e===Ch.OPTIONS.BAR.value,none:e===Ch.OPTIONS.NONE.value});function Th({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Eh(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Eh(Ch.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Eh(!n&&(r||!r&&i)?Ch.OPTIONS.NONE.value:Ch.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Ch.OPTIONS.MINI_CHART.value,n.bar=t.value===Ch.OPTIONS.BAR.value,n.none=t.value===Ch.OPTIONS.NONE.value),n}function kh({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Th({layoutService:e,override:l});if(d.none)return!1;const{orientation:f}=t.meta.major,m={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===f?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:f,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Lh({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(m.settings.style="slim",m.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(m.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(m.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(m.settings.injections=()=>[wh({layoutService:e,discrete:n})]),m}function Nh({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),f="horizontal"===o.meta.major.orientation,m=f?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=f?d.rect.computedInner.width:d.rect.computedInner.height,h=f&&a?p-m:m,g=Math.max(0,Math.min(h/p,1)),[y,v]=Lh({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,q=!b&&!x;return{pixel:h,relative:g,thumb:q?h-y*p:0,beforeThumb:b,afterThumb:x,onThumb:q}}}function Ah({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,f]=Lh({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(f-d)*c}}}function Oh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}function Ih({e:e}){return(e.srcEvent||e).srcElement.getAttribute("data-scrollbar-handle")||""}const Ph="scrollbarResize";function Rh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:"event:scrollbarResize",options:{event:Ph,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[Ph]=this[Ph]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&Ih({e:t})&&(this[Ph].panningEvent=t.srcEvent),!!this[Ph].panningEvent))}},events:{scrollbarResizestart(n){n.preventDefault(),this[Ph]=this[Ph]||{},this[Ph].panningEvent&&t.component(e).emit("dragStart",this[Ph].panningEvent)},scrollbarResizemove(n){if(n.preventDefault(),this[Ph]=this[Ph]||{},!this[Ph].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=Ih({e:this[Ph].panningEvent});let f="start"===d?Math.min(c,o.max):o.min,m="end"===d?Math.max(c,o.min):o.max;f===m&&(f-="start"===d?u:0,m+="end"===d?u:0),r.set("zoom",{min:f,max:m}),t.component(e).emit("render")},scrollbarResizeend(n){n.preventDefault(),this[Ph]=this[Ph]||{},delete this[Ph].panningEvent,t.component(e).emit("dragEnd")},scrollbarResizecancel(n){n.preventDefault(),this[Ph]=this[Ph]||{},delete this[Ph].panningEvent,t.component(e).emit("dragEnd")}}}}const Fh="scrollbarPan";function jh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:"event:scrollbarPan",options:{event:Fh,threshold:0,enable(r,i){return this[Fh]=this[Fh]||{},!(i&&!this[Fh].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{scrollbarPanstart(n){n.preventDefault();const a=u(n);if(this[Fh]=this[Fh]||{},this[Fh].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[Fh].relative=a.relative,this[Fh].zoom=r.get("zoom"),this[Fh].zoom.span=this[Fh].zoom.max-this[Fh].zoom.min,this[Fh].zoom.fullSpan=o-n}else if(a.onThumb)this[Fh].offset=a.thumb;else{const e=c();this[Fh].offset=a.beforeThumb?0:e.thumbSize}},scrollbarPanmove(n){n.preventDefault();const a=u(n);if(this[Fh]=this[Fh]||{},o.meta.isContinuous){const e=a.relative-this[Fh].relative,{fullSpan:t,span:n,min:o,max:s}=this[Fh].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[Fh].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},scrollbarPanend(n){n.preventDefault(),this[Fh]=this[Fh]||{},this[Fh].isPanning=!1,t.component(e).emit("unlockState")},scrollbarPancancel(n){n.preventDefault(),this[Fh]=this[Fh]||{},this[Fh].isPanning=!1,t.component(e).emit("unlockState")}}}}function Hh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Oh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),Rh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),jh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function zh({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function Bh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...Hh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:zh({componentKey:e,chart:t,actions:n,layoutService:o})}}const _h={background:"rgba(0, 0, 0, 0.1)"},Vh={top:-1,bottom:-1,width:6},Uh={width:2,background:"#595959"};var Wh={before:_h,after:_h,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Vh,endHandle:Vh,startHandleBorder:Uh,endHandleBorder:Uh};const $h={background:"rgba(0, 0, 0, 0.1)"},Kh={top:-1,bottom:-1,width:6},Gh={width:2,background:"#595959"};var Yh={before:$h,after:$h,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Kh,endHandle:Kh,startHandleBorder:Gh,endHandleBorder:Gh};const Jh={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Xh={pointerEvents:"initial"},Zh={pointerEvents:"none"};const Qh="ew-resize",eg="default";function tg(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function ng(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Qh:eg}function rg(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function ig(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function og(){const{size:e,start:t,end:n}=tg.call(this);this.renderer.render(this.elements(this.h,rg.call(this,e,t,n)))}function ag(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?Yh:Wh;return{container:{...Jh},before:{...Jh,...n.before,...t.before},after:{...Jh,...n.after,...t.after},thumb:{...Jh,...n.thumb,...t.thumb},startHandle:{...Jh,...Xh,...n.startHandle},endHandle:{...Jh,...Xh,...n.endHandle},startHandleBorder:{...Jh,...Zh,...n.startHandleBorder},endHandleBorder:{...Jh,...Zh,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var sg={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){og.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!ig.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Ih({e:e});t&&(this.state.hover[t]=!0),ng.call(this),og.call(this)},leave(){this.state.locked||(this.state.hover.reset(),ng.call(this),og.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Ih({e:e});t&&(this.state.drag[t]=!0),ng.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),ng.call(this),og.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=tg.call(this);return this.elements(e,rg.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},f={[i.start]:r},m={left:-3},p={left:1},h={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?f:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:f},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:m},class:"scrollbar--start-handle","data-scrollbar-handle":"start"},o?e("div",{style:{...s.startHandleBorder,...u?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?m:h},class:"scrollbar--end-handle","data-scrollbar-handle":"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:ag.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};const lg={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function ug({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=G({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const f=o?n:t,m=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:f}),p=(c-m)/2,h=p+d.major+m/2;return{item:d,boxCenter:h,boxWidth:m,boxPadding:p,rendWidth:t,rendHeight:n}}function cg({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=G(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const f=i.minor||{};let m;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{start:{scale:f.scale,ref:"start"},end:{scale:f.scale,ref:"end"},min:{scale:f.scale,ref:"min"},max:{scale:f.scale,ref:"max"},med:{scale:f.scale,ref:"med"}},f)})};for(let n=0,r=e.length;n<r;n++)m=e[n],p[m]=s.resolve({data:t,defaults:l[m],settings:i[m],scaled:u});return p}const dg=["oob"];const fg={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=cg({keys:dg,data:i,defaultSettings:{oob:lg.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l;return function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=ug}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:f,rendWidth:m,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,g=[];if(d.oob.show){g.push(lg.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:m,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:g};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:dg,symbol:s,dockValue:n})}},mg={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},pg=["hat"];function hg(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function gg({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let f=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const m=G({},e.hat,{type:"path",d:hg(f)});f=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[m,G({},e.hat,{type:"path",d:hg(f)})]}const yg={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=cg({keys:pg,data:r,defaultSettings:mg,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a;return function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=ug}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...gg({item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(g)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:pg})}};function vg(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:vg(i,t,n)},i}function bg(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),vg(i,a,l,e.invert)}))}const xg={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function qg(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const Mg={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function Sg(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var f;if(a=e.session.options||(null===(f=e.enigmaModel)||void 0===f?void 0:f.session.sessionConfig),!a){var m;a=null===(m=e.session)||void 0===m?void 0:m.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?":"+a.port:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c+="/"),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await Mg.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function Dg(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,f=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!f)return[];const[m]=f,p=m.size||"small",h=m.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===m.cId){g=e;break}const y=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==g&&y[g]&&(v=y[g]),"media"===h&&null!==(l=m.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return Sg(m,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&qg(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:n,width:i,imageError:s}=await Mg.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await Mg.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,m,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(qg(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:r,width:o,imageError:a}=await Mg.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],p,v)}return[]}const Cg={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(Dg(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},wg={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Cg.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Cg.checkIfPromisesExist({customTooltipModel:e})};const Lg=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:xg.CHART.CHART_PARENT_TYPE,qId:xg.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},Eg=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:xg.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const Tg={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=xg.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:xg.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Tg.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=xg.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=xg.CHART.STATE,a=Lg(t,o),s=await e.createSessionObject(a),l=Eg(t);if(s.id!==xg.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,f,m,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(f=n[0].data)||void 0===f?void 0:f.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,g;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var y;const t=null==e||null===(y=e.source)||void 0===y?void 0:y.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(xg.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(m=u.miniChartToken.model)||void 0===m?void 0:m.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await Tg.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(Tg.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(xg.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=xg.CHART.STATE;await e.removeSessionAlternateState(r),n.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function kg(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Ng(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=xg.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Ag(e){const t=Ng();return e.filter((e=>t[e.id]))}const Og={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Og.getAttrExprData(a);o.length||n.length?wg.handlePromises({customTooltipModel:i,nodes:Og.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&Tg.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>wg.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[xg.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[xg.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[xg.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(Ag(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[xg.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[xg.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=kg(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Ag(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=kg(e)||[];[...i,t].forEach((e=>{const t=Ag(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Ng(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Me.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Me.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function Ig(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case xg.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case xg.CUSTOM.TITLE:case xg.CUSTOM.DESCRIPTION:case xg.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const Pg={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>Ig(t,e,r,n)}}};const Rg={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[xg.CUSTOM.TITLE]:!0,[xg.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Og.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===xg.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===xg.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>Se.getMeasure(e,t))),e,o)}};function Fg({nodes:e,layout:t,dataset:n}){return function(e,t,n){const r=[];return e.forEach((e=>{r.push(Rg.getCustomAttrExps(n,e,t))})),r}(e,t,n).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function jg(e){const t=xg.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function Hg(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}var zg={attrExpr:{migrateProperties(e){var t,n,r,i;const o=G(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=Hg(o);return s=function(e,t){return t.concat(e.map((e=>jg(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1;return function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=jg(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Hg(e),o,a)},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}))}}},Bg=7005;const _g=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg},Vg=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&ae(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Ug=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ae(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ae(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Wg=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},$g=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then((e=>e.getLayout())).then((t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Ug(e,n)}return r})):t.getField(r.qDef.qFieldDefs[0]).then((t=>t.getCardinal().then((t=>(Ug(e,t),r)))),(()=>r))}return Vg(e),Promise.resolve()};function Kg(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?cu(e,"color.persistent",!0):"byDimension"===r&&n.length>1?cu(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?cu(e,"color.mode","primary"):0===t.length&&n.length>0&&(cu(e,"color.byMeasureDef",void 0),cu(e,"color.byDimDef",void 0),1===n.length&&cu(e,"color.mode","primary"))}const Gg=(e,t)=>{Kg(t),Dt(e),Og.addCallbackCustomTooltip(t)},Yg=e=>{Kg(e)};function Jg({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=null!=i&&i.layout?i.layout.qHyperCube.qDimensionInfo.filter((e=>_g(e))).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),null!=n&&n.app?$g(t,n.app).then((()=>(Gg(e,t),e))):(Wg(t),Gg(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter((e=>_g(e))).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Vg(t),Kg(t),Og.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Kg(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),Og.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Og.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>null!=n&&n.app?$g(t,n.app).then((()=>(e.qSortBy.qSortByNumeric=-1,Yg(t),e))):(Wg(t),Yg(t),e),move(e,t){Vg(t),Kg(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Kg(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Xg(e){return{properties:{version:"1.31.2",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[{path:"/qHyperCubeDef",...Jg(e)}]}}}var Zg={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function Qg({env:e}){var t,n;const{flags:r}=e,i=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.isUnsupportedFeature,o=g();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Zg).forEach((t=>{e.add(Zg[t])}))}}(e.translator);const a=y(),s=v(),[l,u]=b(),c=x(),d=q(),{qLocaleInfo:f}=d;return M((()=>{u({translator:o,theme:s,embed:a,deviceType:c,localeInfo:f,isUnsupportedFeature:i,flags:r})}),[f,i,o.language(),s.name(),c]),l}function ey(){const[e]=b((()=>du())),[t]=b((()=>function(e){var t=Ma({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0})));return{viewCache:e,viewState:t}}const ty=()=>{},ny=2,ry=20,iy=200;var oy={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-10<=t.qTop,i=n.qLeft+n.qWidth+10>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+10>=t.qTop+t.qHeight,a=n.qLeft-10<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var ay={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-10<=t.qTop,i=n.qTop+n.qHeight+10>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var sy={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const ly="pages";function uy({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:"discretePan",pointers:1,threshold:10,enable(r,i){return"discretePan"===this.started||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{discretePanstart(e){e.preventDefault(),this.started="discretePan";const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},discretePanmove(e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},discretePanend(e){e.preventDefault(),this.started=!1},discretePancancel(e){e.preventDefault(),this.started=!1}}}}function cy({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function dy({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(iy,n));return{width:e,height:Math.max(ry,Math.min(n*ny,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function fy(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject("REJECTED"),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject("REJECTED"),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject("REJECTED"),n=null)},i}const my={command:{update:()=>{}}};function py({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=my,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:dy({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:fy(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=pu(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if("REJECTED"!==e)throw e}))}),50);return function(e,{onProcessing:t=ty,onDataPage:n=ty}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var hy={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var gy={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function yy(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function vy(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function by(e){return vy(e.qMatrix,(e=>e[0].qElemNumber))-1}var xy={inTotal:function({layoutService:e}){const t=yy(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=yy(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=yy(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=by(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const qy=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function My(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return qy(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:qy(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return qy(e,n);return vy(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var Sy={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=My(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=My(t).area(e(),l,a.qArea),d=by(a),f=a.qArea.qHeight+d,m=u===o?(r.inView-f)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[m,r.inView>=r.inTotal?m+1:m+f/r.inView]}};function Dy({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:m}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=f;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);case"auto":default:return u?v/m:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return f>o;const m=(90-d)*(Math.PI/180);return f>Math.cos(m)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function Cy({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:f}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?hy:n?r?xy:Sy:gy}({layoutService:r}),m=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?m()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:Dy({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/m()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,o+e/i]}({viewSize:m(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=f({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:m(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function wy({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:f,rtl:m}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=Cy({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:m}),h=()=>{const e=p.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},y=e=>{const t=Date.now(),r=h(),a=g({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=g({pixelOffset:u,items:a});f.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),f.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;y(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(r)}}}function Ly({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:f,renderer:m,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const g=du(),y=function({qMode:e}){switch(e){case"S":default:return oy;case"K":return ay;case"T":return sy}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(ly,[]),{add:t=>{const n=e.get(ly);n.length=0,n.push(t)},getCurrent:()=>e.get(ly)[0],getAll:()=>e.get(ly),contains:n=>t(e.get(ly)[0],n)}}({state:g,contains:y.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:y});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=py({dataStore:v,composition:y,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),q=wy({chart:e,componentKey:n,state:g,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:m,areaBuffer:b,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(n){const r=uu(n,""+e.refs.dataPages);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v});return{interactions:function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[uy({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:cy({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:q}),query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var Ey="AVERAGE",Ty="LINEAR",ky="POLYNOMIAL2",Ny="POLYNOMIAL3",Ay="POLYNOMIAL4",Oy="EXPONENTIAL",Iy="LOG",Py="POWER";function Ry({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){default:case ky:return o;case Ny:return o.y+=i[3]*t**3,o;case Ay:return o.y+=i[4]*t**4+i[3]*t**3,o}}var Fy={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Ry,polynomial3:Ry,polynomial4:Ry,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function jy(e,t){const n=Fy[t.qType.toLowerCase()],r=Math.max(1,e/500);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}function Hy(e){return Fy[e.qType.toLowerCase()]}function zy(e,t){return e.meta.isContinuous?function(e,t){return{generate:(e,n,r)=>{const i=[],o=Hy(e),{min:a,max:s}=t.get("zoom"),l=(s-a)/100;if(l>0){const t=t=>{const a=o({dimValue:t,value:t,qTrendLine:e});a.layerId=n,a.measureIndex=r,a.dimValue=t,i.push(a)};let u=a;for(let e=a;e<=s;e+=l)t(e),u=e;u!==s&&t(s)}return i},calculate:(e,t)=>Hy(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map((({y:e})=>e));return{min:Math.min(...n),max:Math.max(...n)}}}}(0,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],u=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=r,u.dimValue=o.qText,i.push(u)}return i},findMinMax:jy}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,c=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},calculate:(e,t,n)=>(0,Fy[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:jy}}(e)}var By={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},_y={color:"#f93f17",index:9};const{isDark:Vy}=St,Uy={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Wy=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=(()=>!1)})=>{const{translator:s}=i,l=[Uy],u=[],c=[],d=zy(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach(((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map((()=>t))))}));return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:fu((e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=r.scale(o)(t);return Vy(n)?function(e){const t=ht(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=ht(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(_y)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"})),getLineDash:e=>{const{style:t}=u[e]||{};return t.lineDash},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(By.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach((r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)})),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=u[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,u.forEach(((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)}))}}}};var $y={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Ky=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Gy=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];return[(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=Ky(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:$y,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:2,stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:uf.nonUpdatingNode.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=Ky(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:$y,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r})]};function Yy(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Jy(e,{h:t,style:n}){return e.map((e=>{const r={style:{direction:"string"==typeof e.content?Me.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map((t=>e("span",{style:t.style,direction:Me.detectTextDirection(t.content)},t.content)))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",r,i)}))}function Xy(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter((e=>e.title===o)),s=[function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:Me.detectTextDirection(t)},t);return e("tr",{},n)}(n,o)];if(a.slice(0,2).forEach((e=>{s.push(n("tr",{},Jy(e.row,{h:n,style:i})))})),r.length>2){const i=r.length-2;s.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=Me.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return s}}function Zy(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=ve({key:e.tooltip,rtl:i});return G(!0,o,{settings:{extract:Yy(e,t),content:Xy(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function Qy(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function ev(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Qy(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=Qy(r,t),u=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(u.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),c=(null!=s&&s.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);u.forEach((e=>{e.data.dimValue.value=r,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,r).y}))}return u}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some((t=>t.key===e.tooltipOverlay)))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const tv=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},nv=e=>{tv(e),e.qMultiDimMode="Sum",e.qXColIx=0};function rv(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!de.dimensionless(n)&&!de.groupedByDimension(n)&&(r||!de.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:By.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(By.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:By.ADD_BUTTON,add:nv,globalChange:e=>{const t=uu(e,"qHyperCubeDef.qMeasures",[]).reduce(((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e)),[]),r=(e=>!uu(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach((e=>{e.qContinuousXAxis=r})),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:By.TYPE,options:[{value:Ey,translation:By.TYPES.AVERAGE},{value:Ty,translation:By.TYPES.LINEAR},{value:ky,translation:By.TYPES.POLYNOMIAL2},{value:Ny,translation:By.TYPES.POLYNOMIAL3},{value:Ay,translation:By.TYPES.POLYNOMIAL4},{value:Oy,translation:By.TYPES.EXPONENTIAL},{value:Iy,translation:By.TYPES.LOG},{value:Py,translation:By.TYPES.POWER}],defaultValue:Ey},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:_y,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:By.STYLE.DASHED,type:"boolean",defaultValue:!0,change:tv}}}}var iv={};function ov(){ov.init.call(this)}iv.isObject=function(e){return"object"==typeof e&&null!==e},iv.isNumber=function(e){return"number"==typeof e},iv.isUndefined=function(e){return void 0===e},iv.isFunction=function(e){return"function"==typeof e};var av=ov;ov.EventEmitter=ov,ov.prototype._events=void 0,ov.prototype._maxListeners=void 0,ov.defaultMaxListeners=10,ov.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},ov.prototype.setMaxListeners=function(e){if(!iv.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},ov.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],iv.isUndefined(n))return!1;if(iv.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(iv.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},ov.prototype.addListener=function(e,t){var n;if(!iv.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,iv.isFunction(t.listener)?t.listener:t),this._events[e]?iv.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,iv.isObject(this._events[e])&&!this._events[e].warned)&&((n=iv.isUndefined(this._maxListeners)?ov.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,iv.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),iv.isFunction(console.trace)&&console.trace()));return this},ov.prototype.on=ov.prototype.addListener,ov.prototype.once=function(e,t){if(!iv.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},ov.prototype.removeListener=function(e,t){var n,r,i,o;if(!iv.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||iv.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(iv.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},ov.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],iv.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},ov.prototype.listeners=function(e){return this._events&&this._events[e]?iv.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},ov.listenerCount=function(e,t){return e._events&&e._events[t]?iv.isFunction(e._events[t])?1:e._events[t].length:0};const sv={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function lv(){const[e]=b({}),[t]=b({}),n=function(){var e,t,n,r;const i=C(),o=g(),a=!(null==i||null===(e=i.qSelectionInfo)||void 0===e||!e.qInSelections),s=!(null==i||null===(t=i.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qIsOneAndOnlyOne),[l,u]=b(!1),[c,d]=b(!1),[f,m]=b({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),p=e=>{d("boolean"==typeof e?e:!c)};return w((()=>(m({key:"lasso",action:p,enabled:()=>l,active:()=>c}),{key:"lasso",label:o.get(c?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:sv,hidden:!l||!a||s,active:c,action:p})),[a,s,c,l,o.language()]),{get:()=>f,setAllows:e=>{u(!!e)}}}(),[r,i]=b();return M((()=>{const r={};r.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:r}=e;return t.allowScroll&&((null==n?void 0:n.meta.isContinuous)||(null==r?void 0:r.query.getCanScroll()))}},r.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},r.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},r.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},r.lasso=n.get(),Object.keys(r).forEach((e=>{return t=r[e],Object.keys(av.prototype).forEach((e=>{t[e]=av.prototype[e]})),av.init(t),t;var t})),i(r)}),[]),M((()=>{r&&n&&(r.lasso={...r.lasso,...n.get()})}),[n]),{get:()=>r,setAllows:e=>{Object.assign(t,e),n.setAllows(null==e?void 0:e.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(r).forEach((e=>r[e].removeAllListeners()))}}}var uv={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},cv={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",MAJOR_NUM:"majorNum",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",STACK:"stack",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"},STYLING:{AXIS:"axis"}};function dv({layout:e}){const t=ie.canBeContinuous(e),n=de.continuous(e),r=de.dimensionless(e);return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:ie.isTime(n,e),isDimensionless:r,isSimple:de.simple(e),isGrouped:de.grouped(e),isGroupedByMeasure:de.groupedByMeasure(e),isGroupedByDimension:de.groupedByDimension(e),isStacked:de.stacked(e),isStackedByDimension:de.stackedByDimension(e),isStackedByMeasure:de.stackedByMeasure(e),isSnapshot:de.snapshot(e)}}const fv={extractDimsAndNode(e){const t=[];let n;return e.forEach((e=>{if(e.key===cv.COMPONENT.BAR){n=e;const r=uu(e,"data.selectionDimension",!1);r&&(t.push(r.label),r.label!==e.data.label&&t.push(e.data.label))}})),{nodeDims:t,node:n}}};function mv(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(me).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize")}}}))}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function pv({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=mv(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var r;u.should(e)&&u(e),c.mode=G(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map(((e,t)=>"qMeasureInfo/"+t)):n.fields.minor},c.scales={major:cv.SCALE.REDUCED.MAJOR,minor:cv.SCALE.REDUCED.MINOR},c.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=G(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then((e=>e))},setSnapshotData(e){e.reducedHyperCube=c.cube}}}function hv({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}function gv({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function yv({picasso:e,chart:t,environment:n,viewState:r,viewCache:i}){const o=L(),a=E(),s=T(),l=k(),u=N(),c=D(),[d,f]=b(),[m,p]=b(),[h,g]=b(),y=A(),v=lv();return M((()=>{if(!t)return()=>{};const e=v.get(),n=function({chart:e,actions:t,selections:n}){const r=e.scale(cv.SCALE.MAIN.MAJOR);return Vd({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{clear:hv},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}({chart:t,actions:e,selections:u});return p(e),g(n),()=>{n.destroy(),v.destroy()}}),[t]),M((()=>{if(!y)return;const e={allowScroll:!y.active,allowInteract:!y.active,allowTooltip:!y.passive,allowSelect:!y.select&&!y.active};v.setAllows(e)}),[y]),M((()=>{if(!h||!n)return;const{theme:u,translator:d,localeInfo:p,flags:g,embed:y}=n,{direction:b="ltr"}=c,x=bu({source:o,metaAdditionsFn:dv,experimental:{filter:g.isEnabled("IM_1579_HIDE_DIM_MEA")}});h.setFilteredFields(x.meta.filteredFields);const q=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(x.getLayout())?bu({source:x.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:o,options:c}),S=function({layoutService:e,viewCache:t,flags:n,options:r}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map(((e,t)=>"qDimensionInfo/"+t)),minor:e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>"qMeasureInfo/"+t))};return n.majorNumeric=(t.isStackedByDimension?n.majorStack:n.major)+":numeric",n}(e),i.selectionDimensionIdx=(e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}})(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==r.chartAnimations&&!!n.isEnabled("IM_1355_ANIMATIONS_BAR")&&!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!uf.propertiesHaveChanged({viewCache:t,layout:e.getLayout()}),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:x,viewCache:i,flags:g,options:c}),D=lu({chart:t,layoutService:x,config:{logicalSize:M,rtl:"rtl"===b},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),C=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:Jd(a),styles:void 0};return d.styles=Zd({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=Zd({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:u,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]]}}),w=function({layoutService:e,themeService:t,flags:n}){const r=t.getStyles(),i=t=>n.isEnabled("CLIENT_IM_747")?(e.getLayoutValue("components",[])||[]).find((e=>e.key===t)):void 0;return{axis:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fontFamily:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.axis.title.fontFamily,fontSize:null!==(a=null===(s=i("axis"))||void 0===s||null===(l=s.axis)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.axis.title.fontSize,color:null!==(c=null===(d=i("axis"))||void 0===d||null===(f=d.axis)||void 0===f||null===(m=f.title)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p,h,g,y;return{fill:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.label)||void 0===o||null===(a=o.name)||void 0===a||null===(s=a.color)||void 0===s?void 0:s.color)&&void 0!==e?e:r.axis.label.name.color,fontSize:null!==(l=null===(u=i("axis"))||void 0===u||null===(c=u.axis)||void 0===c||null===(d=c.label)||void 0===d||null===(f=d.name)||void 0===f?void 0:f.fontSize)&&void 0!==l?l:r.axis.label.name.fontSize,fontFamily:null!==(m=null===(p=i("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.name)||void 0===y?void 0:y.fontFamily)&&void 0!==m?m:r.axis.label.name.fontFamily}}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fill:null!==(e=null===(t=i("label"))||void 0===t||null===(n=t.label)||void 0===n||null===(o=n.value)||void 0===o||null===(a=o.color)||void 0===a?void 0:a.color)&&void 0!==e?e:r.label.value.color,fontSize:null!==(s=null===(l=i("label"))||void 0===l||null===(u=l.label)||void 0===u||null===(c=u.value)||void 0===c?void 0:c.fontSize)&&void 0!==s?s:r.label.value.fontSize,fontFamily:null!==(d=null===(f=i("label"))||void 0===f||null===(m=f.label)||void 0===m||null===(p=m.value)||void 0===p?void 0:p.fontFamily)&&void 0!==d?d:r.label.value.fontFamily}}}}}({layoutService:x,themeService:C,flags:g}),L=Sh.model({model:a,layoutService:x,viewCache:i,viewState:r}),E=pv({enigma:a,layoutService:x,viewModel:S});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:x,viewState:r,viewStateOptions:null==c?void 0:c.viewState});const T=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,f={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const m=[],{isReduced:p}=u.model().mode,h=c||p||d,g=!c&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return f.main=Zl({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:gv,key:cv.SCALE.MAIN.COLOR},createConfig:()=>({hc:h?g||s.getHyperCube():u.model().cube,source:h?y:"miniCube",theme:o})}),m.push(f.main.initialize()),c&&(f.mini=Zl({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:gv,key:cv.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),m.push(f.mini.initialize())),Promise.all(m)},getMain:()=>f.main,getMini:()=>f.mini}}({picasso:e,model:a,app:s,translator:d,localeInfo:p,theme:u,continuousDataModel:L,layoutService:x,legendLayoutService:q,reducedDataModel:E}),k=Wy({layoutService:x,viewState:r,colorModel:{settings:()=>T.getMain().getSettings(),resolveUIColor:e=>T.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:cv.SCALE.MAIN.COLOR},isEnabled:()=>!x.meta.isGroupedByDimension&&(!x.meta.isStackedByDimension||g.isEnabled("TRENDLINES_STACKED_DIM"))&&!x.meta.isDimensionless});zg.attrExpr.updateProperties(a,o);const N=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Og,miniChartToken:{},embed:s}}({layout:o,app:s,model:a,picasso:e,chart:t,translator:d,localeInfo:p,embed:y,extractDimsAndNode:fv.extractDimsAndNode});let A;x.meta.isDiscrete&&(A=Ly({chart:t,actions:m,componentKey:cv.COMPONENT.BAR,enigmaModel:a,layoutService:x,dockService:D,trendLineModel:k,itemWidths:uv,viewState:r,rtl:"rtl"===b,options:{axisKey:cv.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const O=yf({layoutService:x,discreteModel:A}),I=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:cv.SCALE.MAIN.MINOR,MAJOR:cv.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:cv.COMPONENT.BAR,BAR_AXIS:cv.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:cv.COLLECTION.MAIN}}}}(x),P=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return wa(Sa().mark((function e(){var r,a,s,l;return Sa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=wa(Sa().mark((function e(n){var r;return Sa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(Ma({},i));case 4:if("object"===Da(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(Ma({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,ka(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Ta(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=Ba(!0,{},n.brush);Ba(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Da(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=xu({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=xu({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:l||[],pluginArgs:I});v.setContext({discrete:A,layoutService:x}),f({discrete:A,continuous:Sh,legendLayoutService:q,layoutService:x,viewModel:S,dockService:D,themeService:C,styleService:w,continuousDataModel:L,reducedDataModel:E,colorService:T,trendLineModel:k,refLineModel:O,pluginService:P,customTooltipModel:N,selectionService:h,logicalSize:M})}),[h,c,n,o]),d}function vv(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function bv(e){return e.some(vv)}function xv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{bv(e)||e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))}))})),{min:n,max:r}}function qv(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function Mv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{if(!bv(e)){let i=0,o=0;e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)})),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}})),{min:n,max:r}}function Sv(e,t){const n={};e.forEach((e=>{if(!bv(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)}))}}));let r=NaN,i=NaN;return Object.keys(n).forEach((e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)})),{min:r,max:i}}function Dv(e){return"number"==typeof e&&!Number.isNaN(e)}function Cv(e){const t=e.getHyperCubeValue("qMeasureInfo");return{min:Math.min(...t.filter((e=>Dv(e.qMin))).map((e=>e.qMin))),max:Math.max(...t.filter((e=>Dv(e.qMax))).map((e=>e.qMax)))}}function wv(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function Lv(e){return!Number.isNaN(+e.qNum)}function Ev(e){return e.qNum}function Tv(e){return!Number.isNaN(+e.qNum)}function kv(e){return e.qNum}function Nv(e,t){return e.push(...t),e}const{getValueWithOffset:Av,isNumber:Ov}=Ro;function Iv(e,t){return Math.abs(e/t)<5||0===t}function Pv({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=Mv,stackedByDimensionExtractor:i=Sv,straightExtractor:o=xv,measureInfoExtractor:a=Cv,explicitExtractor:s=qv}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),u=this.extractExplicit(),c=[0,o,a].filter((e=>Ov(e)));let d=Math.min(...c),f=Math.max(...c);d=Iv(s,d)?Math.min(d,s):d,f=Iv(l,f)?Math.max(f,l):f;const m=[u.explicitMin,u.explicitMax,d,f].filter((e=>Ov(e)));return o=Number.isNaN(u.explicitMin)?Math.min(...m):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...m):u.explicitMax,o===a&&(Number.isNaN(u.explicitMin)?o=Av(o,-.2):Number.isNaN(u.explicitMax)&&(a=Av(a,.2))),{min:o,max:a,implicitMin:d,implicitMax:f,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.map((e=>e.qMinNeg))),max:Math.max(...n[0].qSubNodes.map((e=>e.qMaxPos)))}:{min:0,max:0};var n},extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=wv(uu(e,"0.qData.0.qSubNodes",[]),vv,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=uu(e,"0.qMatrix",[]).filter(bv).reduce(Nv,[]).filter(Tv).map(kv);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=wv(uu(e,"0.qMatrix",[]),bv,[]).filter(Lv).map(Ev);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Rv(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then((t=>({qDataPages:t,count:e})))}const u=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then((e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}}))}}}(e),n=Pv(e);return t.resolve().then((e=>n.extract(e)))}const Fv=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:"event:"+e,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:"lasso",enable(e,n){if("lasso"===this.started||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),"lasso"!==this.started&&(i.actions.select.emit("start","lasso"),this.chart.component(e).emit("lassoStart",t),this.started="lasso")},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end","lasso"),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const jv=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),f=this.chart.component("tooltip"),m="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else m&&f.emit("hide")}}}};const Hv=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const zv=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:"event:"+t,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key)));return 0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(t+"-"))}(i,t)?(this.started=e,!0):a.length>0}},events:{[e+"start"](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(a+"Start",n),this.started=e},[e+"move"](e){e.preventDefault(),this.chart.component(t).emit(a+"Move",e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[e+"end"](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(a+"End",n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function Bv(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>"@"+e)).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=zv(e,t,"range");return{interactions:[e.onEdited?Hv(e,t):null,r].filter(Boolean),components:[n]}}const _v={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}};const Vv={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){var t;const n=null==e||null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal,{qLocked:r=0,qOption:i=0,qSelected:o=0}=(null==e?void 0:e.qStateCounts)||{};return[void 0,0].includes(n)?r+i+o:n}},Uv={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=Vv.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach((e=>{n=Math.max(n,e.qFallbackTitle.length)}));return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?uu(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Uv.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=Uv.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return ge.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Uv.getAxisData(e),n=Vv.getMaxGlyphCount(e,0);return ge.getAdjustedMaxGlyphCount(n,t,0)}};var Wv=3,$v=13;function Kv(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,f=_v[t.dockService.meta.major.orientation+"DimensionAxis"].minimumLayoutMode,m={type:"grid-line",x:{},layout:{minimumLayoutMode:_v.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.lines.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isTime:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isTime:!0})}};c.push(G(!0,{},d,{key:"inner-time-axis",scale:cv.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:G(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),c.push(G(!0,{},d,{key:"outer-time-axis",scale:cv.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:cv.SCALE.MAIN.MAJOR,layout:{dock:"@outer-time-axis",minimumLayoutMode:f}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:cv.SCALE.MAIN.MAJOR_INNER,layout:{dock:"@inner-time-axis",minimumLayoutMode:f}}),c.push(p)}return c.push(G(!0,{},m,{key:"inner-time-grid",x:{scale:cv.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(G(!0,{},m,{key:"outer-time-grid",x:{scale:cv.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,scale:cv.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:cv.SCALE.MAIN.MAJOR,layout:{dock:"@"+e,minimumLayoutMode:f}}),c.push(p)),c.push(G(!0,{},m,{key:"continuous-grid",x:{scale:cv.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,f=t.styleService.axis.label.getStyle(),m={type:"axis",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:_v[t.dockService.meta.major.orientation+"DimensionAxis"].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...f},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(G(!0,{},m,{key:"group-axis",scale:cv.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":m.settings.labels.mode,maxGlyphCount:Uv.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&m.settings.line.show}}}));const p=Uv.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(G(!0,{},m,{key:cv.COMPONENT.BAR_AXIS,scale:cv.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>Wv&&p<$v?1:void 0},line:{show:!(u&&l)&&m.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",formatter:cv.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:_v.measureAxis.minimumLayoutMode},scale:cv.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var Gv={BAR:{WIDTH:.7,STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function Yv({layoutService:e,discrete:t,componentKey:n}){var r;const{isContinuous:i,isGrouped:o}=e.meta;if(i)return 1;const a=(e.getLayoutValue("components",[])||[]).filter((e=>e.key===n))[0];if(null!=a&&null!==(r=a.style)&&void 0!==r&&r.width){const{style:e}=a;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=Gv.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return o?.9:.7}const Jv={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Xv(e,t,n={}){return({data:r})=>{const i=e.chart.component(t).rect;if(!r.items.length||!i)return 2;const{min:o,max:a}=e.viewState.get("zoom");if(n[[o,a]])return n[[o,a]];const s=Jv[ee.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-o),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=function(e,t,n){return e*(1-n)+t*n}(2,s,1-Math.min(l/u/.2,1));return n[[o,a]]=Math.max(2,Math.min(s,c)),n[[o,a]]}}function Zv(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function Qv(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function eb(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function tb(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const nb="max",rb="min",ib={min:"Min",max:"Max"};function ob(e,t,n){return void 0===n?Zv(e,t)||Qv(e,t):n===nb?Zv(e,t):Qv(e,t)}function ab({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e["hasExplicit"+ib[t]]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===nb?e.implicitMax:e.implicitMin;return!ob(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function sb(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===nb?s.implicitMax:s.implicitMin;if(!ob(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===nb?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===nb?"sumOfPositives":"sumOfNegatives");const f=a.getStyles();return{type:"box-out-of-bounds",key:"bar-oob-"+n,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:pe.getDockValue(c),oob:G({},t.settings.box,{fill:f.outOfRange.color,alignment:1,opacity:1,show:function(e){var t;return!0!==(null===(t=e.datum.null)||void 0===t?void 0:t.value)&&((!r||0!==e.datum[d].value)&&ob(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:uf.barOobs.compensateForLayoutChanges}}}function lb(e){return Math.min(Math.max(0,e),1)}const ub=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!ab({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${cv.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:cv.SCALE.MAIN.MAJOR,fn:d},minor:{scale:cv.SCALE.MAIN.MINOR,start(e){var n,r;return lb(t.scale(cv.SCALE.MAIN.MINOR)((null==e||null===(n=e.datum)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.value)||0))},end(e){const r=t.scale(cv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return lb(r(o))}},box:{width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:r}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(cv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function cb(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.fill!==n.color||e.onBackground?o.fill:function(e){return function(t){return St.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n),s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function db(e){return{placements:e.simplifiedPlacements.map((t=>cb(t,e))),label:e.label}}function fb(e,t){if(t){if(function(e,t){return Zv(e,t)}(e,t))return-1;if(function(e,t){return Qv(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function mb(e,t,n,r){const i=fb(e,r);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function pb(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function hb(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function gb(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function yb({layout:e,component:t,minorScale:n},r,i){if(!pb(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=r,{meta:d}=l,f=s.get("minorMinMax"),m=c.getStyles(),p=r.styleService.label.getStyle();let h;!d.isStacked&&(h=d.isStacked?1:0);const g=0===h?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,q=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>q?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:x,simplifiedPlacements:gb(h,g,y,d.isContinuous),style:m.label.value},S=[db(G(r,M))],D={key:"bar-labels",type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>mb(e.data.end.value,u.meta.minor.orientation,i,f),labels:S,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:uf.labels.linkData}}}]},animations:{enabled:r.viewModel.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(D.beforeRender=()=>{q=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),D}const vb={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let r;return t.isStackedByDimension?r=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(r=n.group?n.group.label:void 0),void 0!==r?`${n.label}, ${r}`:n.label},getMeasure(e,t,n,r,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const o=t.data,a=n.isStacked?r.viewModel.fields.minor[n.isStackedByDimension?0:o.measureIndex.value]:void 0,s=n.isStacked?{source:{key:o.source.key,field:a},label:!0===(null===(l=o.null)||void 0===l?void 0:l.value)?"":n.isStackedByDimension&&i?i(o.segment.value):o.segment.label}:o.end;var l;return Se.getMeasure(e,s)},getMeasures(e,t,n,r,i){const o=e.resources.dataset;return t.map((e=>vb.getMeasure(o,e,n,r,i))).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const r=e.resources.dataset;return Fg({nodes:t,layout:n.layoutService.getLayout(),dataset:r})},extractBarTooltipData(e,t,n,r,i){const o={title:vb.getTitle(t,n),color:Se.getColor(e,t,r),measures:vb.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,r,i)};if(vb.useCustomTooltip(r)){var a,s,l,u;const n=vb.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],r);o.customMeasures=n.customTooltipAttrExpsArr,o.customTitle=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===xg.CUSTOM.TITLE)),o.customDescription=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===xg.CUSTOM.DESCRIPTION));let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach((e=>{var t;(null===(t=e.data.customTooltipImages)||void 0===t?void 0:t.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)})),i.length>0&&(o.customImages=i);const p=r.layoutService.getLayout();var c,d,f,m;if(null!==(a=p.tooltip)&&void 0!==a&&null!==(s=a.chart)&&void 0!==s&&null!==(l=s.object)&&void 0!==l&&l.refId&&r.app&&r.customTooltipModel.embed&&"function"==typeof(null===(u=r.customTooltipModel.model)||void 0===u?void 0:u.getEffectiveProperties))if(null!==(c=(d=r.app).isInModalSelection)&&void 0!==c&&c.call(d)){if((null==p||null===(f=p.qHyperCube)||void 0===f||null===(m=f.qDimensionInfo)||void 0===m?void 0:m.length)>0){Tg.destroyVisualization({customTooltipModel:r.customTooltipModel});const e=r.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");o.customLimitation=e}}else{const t=Tg.createContainer({ctx:e,layout:p});o.customChart=t}}return o},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData:(e,t,n)=>({title:e.data.label,measures:[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter((e=>0!==e)).map((e=>({label:""+vb.getTotalStackTitle(e,t),value:n?n(e):e})))}),extractTooltipData(e,t){const n=t.chart.formatter(cv.FORMATTER.MINOR),{meta:r}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],o=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map((e=>vb.extractStackTotalBarTooltipData(e,t.translator,n))):[];return{barTooltipData:i.map((i=>vb.extractBarTooltipData(e,i,r,t,n))),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:o}},extractBarNodeData(e,t,n,r,i,o,a){let s=!i&&Se.getTitleRow(t,r);const l=Se.hideColorRow(t,n),u=!o&&!l&&Se.getColorRow(e,t,r),c=t.measures.map((i=>!a&&Se.getMeasureRow(i,e,t,r,l&&i.field===n.coloring.field))).filter((e=>!vb.isSameMeasureAndColorRow(e,u,r)));if(vb.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map((n=>Se.getMeasureRow(n,e,t,r,!1))),o=!(!t.customTitle[0]||i)&&Se.getTitleRow(t.customTitle[0],r),a=!(!t.customDescription[0]||i)&&Se.getDescriptionRow(t.customDescription[0],r);s=!vb.shouldIgnoreTitleRowForCtt(o,a,c,n)&&s;const l=[o,a,s,u,...c,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(Og.getFooterRow(t.customLimitation,r)),t.customImages){const n=t.customImages.map((t=>Og.getImageRow(t,e)));l.push(...n)}return l.filter(Boolean)}return[s,u,...c].filter(Boolean)},extractStackTotalBarNodeData:(e,t,n)=>[!!t.measures.length&&Se.getTitleRow(t,n),...t.measures.map((r=>Se.getMeasureRow(r,e,t,n,!1)))].filter(Boolean),useCustomTooltip:e=>uu(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,r)=>!1===n[0]&&0===r.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some((e=>e.field===n.coloring.field)),shouldIgnoreDefaultRows:(e,t)=>vb.useCustomTooltip(t)&&uu(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,r){const{meta:i}=t.layoutService,o=t.layoutService.getLayout(),a=r.length;let s,l,u=[];const c=vb.shouldIgnoreDefaultRows(o,t);for(s=0;s<a;s++){l=r[s];const o=vb.shouldIgnoreTitleRow(i,s),d=c||vb.shouldIgnoreColorRow(i,s),f=c||vb.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(vb.extractBarNodeData(e,l,t,n,o,d,f)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let r=[];return n.some((e=>e.measures.length))&&n.forEach((n=>{r=r.concat(vb.extractStackTotalBarNodeData(e,n,t))})),r},extractData(e,t,n){const{barTooltipData:r,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:o}=vb.extractTooltipData(e,t),a=vb.extractStackTotalBarsData(e,n,o);a.length&&a.push(Se.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=vb.extractBarsData(e,t,n,r),u=a.concat(s),c=i+l;return c&&u.push(Se.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter((e=>{const t=e.bounds;return t.width>0&&t.height>0})),n=t.length?t:e;return vf.combineBounds(n.map((e=>e.bounds)))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:r,data:i,groupProp:o}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,f;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===r&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,f=n===r&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[o]?i[o].value:void 0,d=u(n===r&&void 0!==c?[c,e]:e),f=n===r&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const m=(d+f/2)*a[l],p={width:0,height:0};return"horizontal"===s?(p.x=m,p.y=a.height):(p.y=m,p.x=0),p},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:r,barAxisKey:i,majorScale:o,majorInnerScale:a,groupProp:s}){const l=n.filter((e=>e.children&&e.children.length));let u;return u=l.length?vb.calculateBoundsFromBars(l):vb.calculateBoundsFromScale({opts:e,barKey:r,scale:t[0].key===i?o:a,majorScale:o,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter((e=>e.data&&t.indexOf(e.key)>-1)),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels:(e,t,n,r)=>e.filter((e=>t.some((t=>n(e,t,r))))),findBarsFromGroupLabelsInGroupedByDim(e,t,n){const r=vb.isBarMatchingLabelOnProp;return vb.findBarsMatchingLabels(e,t,r,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter((e=>t.some((t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)))),findBarsFromLabelsInSingleDim(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,r){const i=t.filter((e=>e.key===n)),o=t.filter((e=>e.key!==n)),a=vb.findBarsFromBarLabelsInGroupedByDim(e,i,r),s=vb.findBarsFromGroupLabelsInGroupedByDim(e,o,r);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const r=vb.isBarMatchingLabelOnProp;return vb.findBarsMatchingLabels(e,t,r,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>vb.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:r,groupProp:i,stackProp:o}){const{meta:a}=t.layoutService,s=vb.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?vb.findBarsFromLabelsInStackedByDim(s,e,o):a.isStackedByMeasure?vb.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?vb.findBarsFromLabelsInGroupedByDim(s,e,r,i):vb.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:r}=t.layoutService;if(r.isStacked){const i=vb.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return r.isStackedByDimension?vb.findStackTotalBarsFromLabelsInStackedByDim(i,e):vb.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:f}=t.layoutService;if(e.length){let m=vb.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(m=m.filter(d)),vb.isSingleBarMode(f,m))return[m[0]];if(m.length){let f=vb.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,o,a],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});d&&(f=f.filter(d));const p=vb.calculateTotalBounds({opts:t,labels:e,bars:f,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),h=vb.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:r});return[{key:n,bounds:p,childrenNodes:m,data:m.map((e=>e.data)),stackTotalBarNodes:h}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,groupAxisKey:o,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let f=vb.filterNodesOnKeys(e,[i,o]),m=f&&f.length?[f[0]]:[];const p=vb.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(p&&p.length)return p;const{meta:h}=t.layoutService;if(h.isStackedByMeasure){f=vb.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>vb.filterNodesForOob(e,n,a),p=vb.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}if(h.isStackedByDimension){f=vb.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>vb.filterNodesForOob(e,n,a),p=vb.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}const g=vb.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function bb(e,t={},n){let r=[];const i=ve({key:cv.COMPONENT.BASE_TOOLTIP,rtl:n});return G(!0,i,{scale:cv.SCALE.MAIN.COLOR,settings:{filter:e=>vb.filterNodes({nodes:e,opts:t,barKey:cv.COMPONENT.BAR,stackTotalBarKey:cv.COMPONENT.STACK_TOTAL_BAR,barAxisKey:cv.COMPONENT.BAR_AXIS,groupAxisKey:cv.COMPONENT.GROUP_AXIS,barOobMaxKey:cv.COMPONENT.BAR_OOB_MAX,barOobMinKey:cv.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(r=e.node.childrenNodes?e.node.childrenNodes:[e.node],vb.extractData(e,t,n)),placement:"bounds",afterShow:()=>{var e;const{app:i,properties:o,customTooltipModel:a}=t;i&&(null===(e=i.isInModalSelection)||void 0===e||!e.call(i))&&a.useCustomTooltip&&a.embed&&Tg.show({app:i,properties:o,selectedNodes:r,customTooltipModel:a,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const xb={extractData:(e,t)=>[Se.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter((e=>e.data&&e.key===t));return n.length?[n[0]]:[]}};function qb(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const r=ve({key:cv.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return G(!0,r,{scale:cv.SCALE.MAIN.COLOR,settings:{filter:e=>xb.filterNodes(e,cv.COMPONENT.LEGEND_COLOR_CAT),extract:e=>xb.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function Mb(e){return"NaN"===e.qMin&&"NaN"===e.qMax}function Sb({layout:e},t,n){const r=function(e,t){if(e.qHyperCube.qSize.qcx*e.qHyperCube.qSize.qcy==0)return"NoDataExist";if(e.qHyperCube.qMeasureInfo.every(Mb))return"OnlyNanData";let n=!1;if(t.layoutService.meta.isContinuous&&2===e.qHyperCube.qDimensionInfo.length){const t=e.qHyperCube.qDimensionInfo[1];n=Vv.getDimensionSize(t)>ie.maxNumberOfLines}return!!n&&"LimitedData"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:X[e].alignment},settings:{label:i.get("Object.Disclaimer."+e),rtl:o},style:r}}(r,t,{rtl:n},{fontFamily:i})}function Db(e,{fill:t}){return{[cv.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[cv.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const Cb=1,wb=3;function Lb(e){return e.getLayoutValue("gridLine.auto")}function Eb(e){return!Lb(e)&&e.getLayoutValue("gridLine.spacing")===Cb}function Tb(e){return!Lb(e)&&e.getLayoutValue("gridLine.spacing")===wb}const kb=e=>({enabled:e.animations.enabled,trackBy:uf.lines.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}),Nb=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!Lb(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:_v.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!Eb(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:Tb(n),stroke:o.line.minor.color},animations:kb(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=cv.SCALE.MAIN.MINOR,a};function Ab(e,t){const n=[Nb(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:cv.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:cv.SCALE.MAIN.MINOR,lines:a,animations:kb(r)}})(t)),n}const Ob=e=>({type:"Pan",key:"panorama",options:{event:"areaPan",pointers:1,threshold:10,enable(t,n){return"areaPan"===this.started||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===cv.COMPONENT.BAR))}},events:{areaPanstart(t){t.preventDefault(),this.started="areaPan";const n=e.viewState.get("zoom");this.areaPan={min:n.min,max:n.max,size:e.chart.component(cv.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this.areaPan,a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Ib(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=Sh.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:cv.COMPONENT.BAR}),s={last:0,diff:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===cv.COMPONENT.BAR))},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Pb({chart:e},t,n){const r=e.component(cv.COMPONENT.BASE_TOOLTIP);var i;r&&r.show&&(r.emit("hide"),null!=n&&null!==(i=n.customTooltipModel)&&void 0!==i&&i.useCustomTooltip&&t&&t({},r,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const o=e.component(cv.COMPONENT.LEGEND_CAT_TOOLTIP);o&&o.show&&o.emit("hide");const a=e.component(cv.COMPONENT.TREND_LINES_TOOLTIP);a&&a.show&&a.emit("hide")}function Rb(e,t){const{viewCache:n,viewState:r,chart:i,trendLineModel:o,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?Sh.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:s,threshold:50,targetKey:cv.COMPONENT.BAR}):void 0,u=ev({majorInnerScale:cv.SCALE.MAIN.MAJOR_INNER,tooltip:cv.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:cv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:r,trendLineModel:o,layoutService:a,rtl:s}),c=[cv.COMPONENT.BAR,cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS,cv.COMPONENT.BAR_OOB_MAX,cv.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,f=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter((e=>e.key===cv.COMPONENT.BAR)),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT)),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault(),Pb(e,f,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),r=this.chart.component(cv.COMPONENT.BASE_TOOLTIP);if(r&&r.show)if(n.some((e=>c.indexOf(e.key)>-1))){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);f(t,r,{nodes:i,opts:e,customTooltipModel:n})}else r.emit("show",t)}else r.emit("hide");const i=this.chart.component(cv.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT))?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&Pb(this,f,e)},mouseleave(){Pb(this,f,e)}}}}const Fb=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Bh({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Ob(e,t.rtl),Ib(e,t)]]});function jb(e,t){const{actions:n}=e;if(!n.interact.enabled())return[];const r=[Fb(e,t),Rb(e,t),Bh({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&r.push(e.discrete.interactions.native),r}const Hb=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges});const zb=(e,t,{collectionKey:n})=>{if(!Th({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:r,viewModel:i},{collectionKey:o}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:o},settings:{box:G(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:G(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Hb(i)}}(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Hb(t.viewModel)}},{measureText:Bb}=e.renderer("svg")();function _b(e,t,n){return{reducedMinor:function(e){const t=G(!0,{},e);return delete t.data,t}(t.minor),reducedMajor:function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map(((e,t)=>({field:e,value:t}))):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=G(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=G(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n)}}const Vb=50,Ub=100,Wb=200;function $b(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Vb;case 1:return Ub;case 2:return Wb;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function Kb(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function Gb(e,t,n){return 0===t||0===e||t===n.length-1}function Yb(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function Jb(e,t,n,r,i){e.domain([t,n]),e.nice(10);const[o,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}(s),c=u?Gb:Kb;s=s.filter(c),l&&!u&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(cv.FORMATTER.MINOR):void 0;return Yb(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function Xb(e,t,n,r,i,o,a,s){const l=o.formatter(cv.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Bb({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[f,m]=e.domain(),p=e.ticks(r);function h(){const e=p.map(l);return!Yb(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!h();i--)e.domain([t,n]),e.nice(i),[f,m]=e.domain(),p=e.ticks(i);return{roundedMin:f,roundedMax:m,ticks:p}}const Zb=(e,t)=>e.value-t.value,Qb=e=>({value:e,isMinor:!1}),ex=e=>({value:e,isMinor:!0});function tx(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter((e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e))).length<=r}function nx({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i}){const{explicitMin:o,explicitMax:a,hasExplicitMin:s,hasExplicitMax:l}=t.get("minorMinMax"),{min:u,max:c}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),d=fu((()=>{const d=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(cv.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),f=$b(d,r),m=function(e,t,n){const r=Sr().domain([e,t]);return r.nice(n),r}(u,c,f);let p,h,g=[];"SPARK"===n.meta.chart.mode?({roundedMin:p,roundedMax:h}=function(e,t){return{roundedMin:e,roundedMax:t}}(u,c)):(({roundedMin:p,roundedMax:h,ticks:g}=Xb(m,u,c,f,d,e,n,i)),tx(g,o,a)&&({roundedMin:p,roundedMax:h,ticks:g}=Jb(m,u,c,s||l,e)));const y=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(g,1);g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.unshift(t),n.filter((e=>e>=t))):n}(s,o,g),g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.push(t),n.filter((e=>e<=t))):n}(l,a,g);return{roundedMin:p,roundedMax:h,ticks:function(e,t){return[...e.map(Qb),...t.map(ex)].sort(Zb)}(g,y)}}),(()=>t.get("isPreRender")));return{values:()=>d().ticks,min:()=>s?o:d().roundedMin,max:()=>l?a:d().roundedMax}}function rx(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d},{localeInfo:f,rtl:m}){const{meta:p}=r,{fields:h}=o,g=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},y=!("none"===r.getLayoutValue("measureAxis.show"))?(v=i.meta.minor.orientation,b=i.meta.minor.dock,"vertical"===v?"near"===b||"left"===b?0:1:"near"===b||"bottom"===b?1:0):.5;var v,b;const x={},q="vertical"===i.meta.minor.orientation&&m,M=l.getMain().getScales(),S=l.getMini().getScales();if(Object.assign(x,M,{reducedFill:S.reducedFill}),x[cv.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,layoutService:i,themeService:o},{rtl:a}){const s=nx({chart:e,dockService:n,viewCache:r,layoutService:i,themeService:o}),l={invert:"vertical"===n.meta.minor.orientation||a,ticks:{values:s.values},minorTicks:{count:1},min:s.min,max:s.max};return i.meta.isStacked||(l.data={source:"qHyperCube",fields:t.minor}),l}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:u},{rtl:m}),p.isGroupedByDimension)[cv.SCALE.MAIN.MAJOR_INNER,cv.SCALE.MAIN.MAJOR].forEach(((e,t)=>{x[e]={invert:q,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:h.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:g,align:y}})),o.isDimensionLocked(0)||(x[cv.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)x[cv.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:q,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:g,align:y};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=o.formatter("q-time"),d=l.getStyles(),f=e=>Bb({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const m={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=u().map((e=>e.qName));return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:m},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:m}}}({picasso:t,localeInfo:f,viewState:c,viewModel:o,viewCache:a,themeService:u,layoutService:r},m);x[cv.SCALE.MAIN.MAJOR_INNER]=e,x[cv.SCALE.MAIN.MAJOR]=n}else p.isContinuous?x[cv.SCALE.MAIN.MAJOR]={type:"linear",invert:q,data:{extract:{key:"qHyperCube",field:h.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:x[cv.SCALE.MAIN.MAJOR]={invert:q,data:{extract:p.isDimensionless?h.minor.map(((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n}))):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:g,align:y};const{reducedMinor:D,reducedMajor:C}=_b(s,{major:x[cv.SCALE.MAIN.MAJOR],minor:x[cv.SCALE.MAIN.MINOR]},{majorScaleInvert:q,maxPxStep:g,align:y,getProp:a.get});return p.isDiscrete&&(x[cv.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(x[cv.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),x[s.scales.major]=C,x[s.scales.minor]=D,x}function ix(e,t,n){const{layoutService:r,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[jv(e,t)],components:[]}}({targets:[r.meta.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?cv.COMPONENT.STACK_TOTAL_BAR:cv.COMPONENT.BAR,cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",cv.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return cv.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]}},{...e,isLocked:n=>n.some((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT))?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function ox(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[Fv(n,t)],components:[r]}}({key:"lasso",componentTargetKey:cv.COMPONENT.BAR,components:[t?{key:cv.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:cv.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function ax(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>"@"+e)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[zv(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:cv.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",cv.COMPONENT.BAR_AXIS,cv.COMPONENT.BAR],fillTargets:["group-axis",cv.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function sx(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=ix(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=ox(e),u=function(e,t){return e.layoutService.meta.isStacked||null!=t&&t("rangeSelections")?{components:[],interactions:[]}:Bv({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",cv.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:cv.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?Bv({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",cv.COMPONENT.BAR]:["continuous-axis",cv.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?cv.SCALE.MAIN.MAJOR_INNER:cv.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:r}){const i=e.layoutService.meta.isTime?r.formatter():e.chart.formatter(cv.FORMATTER.MINOR),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=ax(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}function lx({layoutService:e,viewModel:t,dockService:n}){var r;const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,a=e.getLayoutValue("components",null),s=a?a.filter((e=>"bar"===e.key))[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMaxPos)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMaxPos.toFixed(13))}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMinNeg)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMinNeg.toFixed(13))}}}]},settings:{major:{scale:cv.SCALE.MAIN.MAJOR},minor:{scale:cv.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:null!=s&&null!==(r=s.style)&&void 0!==r&&r.width&&s.style.width>0?s.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:uf.shadowBars.trackBy,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges}}}const ux={min:"Min",max:"Max"};function cx(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?eb(e,t)||tb(e,t):n===nb?eb(e,t):tb(e,t)}(Number(r.toFixed(13)),e,t)}function dx(e,{barComponent:t,type:n,isStacked:r}){var i,o,a,s;const{viewCache:l,layoutService:u,dockService:c}=e,d=l.get("minorMinMax"),f=n===nb;if(function(e,t){return!e["hasOther"+ux[t]]}(d,n)){if(function(e,t){return!e["hasExplicit"+ux[t]]}(d,n))return!1;if(cx(d,n,f))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e["hasExplicit"+ux[t]]&&r(e["explicit"+ux[t]])}(d,n,f))return!1;let m="end";r&&(m=f?"sumOfPositives":"sumOfNegatives");const p=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.chart.scale(cv.SCALE.MAIN.MINOR)[n]())),h=f?e=>e.datum[m].value>p():e=>e.datum[m].value<p(),g=cv.COMPONENT.BAR,y=e.layoutService.getLayoutValue("components",[]),v=y?y.filter((e=>e.key===g))[0]:null;return{type:"box-sliced-hat",key:"sliced-hat-"+n,layout:{dock:f?c.meta.minor.end:c.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:G({},t.settings.box,{fill:u.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:h,width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:g}),strokeWidth:null!=v&&null!==(i=v.style)&&void 0!==i&&i.strokeWidth?Gv.BAR.STROKE.WIDTH[v.style.strokeWidth.toUpperCase()]:Gv.BAR.STROKE.WIDTH.NONE,stroke:null!==(o=null==v||null===(a=v.style)||void 0===a||null===(s=a.strokeColor)||void 0===s?void 0:s.color)&&void 0!==o?o:Gv.BAR.STROKE.COLOR})}}}function fx(e,t){var n;let r;return r=e.isContinuous?1:.7,!e.isContinuous&&null!=t&&null!==(n=t.style)&&void 0!==n&&n.width&&t.style.width>0?t.style.width:r}function mx(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum",a=e=>"NaN"===e[o]?0:e[o];function s(t){const n=e.ds.field(t).raw(),r=e.ds.field(t).formatter(),i=!n.isCustomFormatted&&(n.qIsAutoFormat||"U"===n.qNumFormat.qType);return{field:t,reduceLabel:"none",value:a,label:e=>i?(e=>"NaN"===e[o]?"-":r(e[o]))(e):e.qText}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map(((t,o)=>{const a=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),c=a[Object.keys(a)[0]],d=null==c?void 0:c.field,f=d?{field:d,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,m={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:r.isStacked?s(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:f,...a,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?Pg.getNode(e.layoutService.getLayout(),r):void 0}};var p;return r.isDimensionless&&(m.value=o),void 0!==n&&(m.source=n),se(m.props),m}))}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}function px({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},null:{fields:t.minor.map((e=>({field:e}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>Number(e.qMaxPos.toFixed(13))},sumOfNegatives:{value:e=>Number(e.qMinNeg.toFixed(13))},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every((e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue))}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t>0?e+t:e),0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t<0?e+t:e),0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const hx="main-collection",gx="stack-total-collection";const yx="mini-collection",vx="mini-stack-collection",bx="mini-continuous-collection",xx="miniCube",qx=(e,t)=>{const n=(e=>{const t=[mx(e,{collectionKey:hx})];return e.layoutService.meta.isStacked&&t.push(px(e,{collectionKey:gx})),t})(t),r=((e,t)=>{const n=[];return Th({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(mx(t,{collectionKey:bx},xx)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}})),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:vx})):n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o=i.isReduced?{}:n.getMain().getDatumProps(t),a={end:{field:e},start:0,group:{field:r.majorGroup},measureIndex:t,...o},s={source:"miniCube",field:i.isDimensionless?e:r.major,props:a};return i.isDimensionless&&(s.value=t),s}))}}}(t,{collectionKey:yx}))),n})(0,t);return n.concat(r)};function Mx(e,t,n){const r=[{position:e,onBackground:!0,justify:0,overflow:n}];return t&&r.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:{fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}}}),r}function Sx({layout:e,component:t},n,r){if(!hb(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!pb(e,n),f=l.getStyles(),m=u.label.getStyle();function p(e){const t=o.formatter(cv.FORMATTER.MINOR);return t?t(e):e}const h={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:Mx("outside",d,c.isContinuous),style:f.label.value},g={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:Mx("opposite",d,c.isContinuous),style:f.label.value};return{key:"stack-total-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>mb(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:[db(G(n,h)),db(G(n,g))],fontSize:parseInt(m.fontSize,10),fontFamily:m.fontFamily,linkData:uf.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}}}function Dx(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function Cx({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!pb(e,n)||l&&!hb(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===nb&&0===u.max||t===rb&&0===u.min)return!1;if(!ob(t===nb?u.implicitMax:u.implicitMin,u,t))return!1;const c=o.getStyles(),d=a.label.getStyle();let f=e=>e.data.end.label;s.isStacked&&(f=t===nb?function(e){if(ob(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(cv.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(ob(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(cv.FORMATTER.MINOR);return r?r(t):t}return""});const m={label:f,simplifiedPlacements:Dx("outside",true,s.isContinuous),styles:c},p={label:f,simplifiedPlacements:Dx("opposite",true,s.isContinuous),styles:c},h=[db(G(n,m)),db(G(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y={component:`${cv.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:h,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:uf.labels.linkData}}};return{key:"bar-oob-labels-"+t,type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[y]},animations:{enabled:n.viewModel.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}}}function wx(e){return"all"===e||"title"===e}function Lx(e,t,n){if(!wx(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const{actions:r,properties:i}=t,o={hyperCube:e.qHyperCube,hyperCubeDef:i&&i.qHyperCubeDef,isDimension:!0,disabled:()=>{var e;return!(null!=r&&null!==(e=r.interact)&&void 0!==e&&e.enabled())},model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},a=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleDimensions&&(o.padding="0",o.minWidth="auto"),{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:_v[t.dockService.meta.major.orientation+"DimensionAxisTitle"].minimumLayoutMode,dock:t.dockService.meta.major.dock},settings:o,style:a}}function Ex(e,t,n){if(!wx(e.measureAxis.show))return!1;const{layoutService:r,actions:i}=t,o=t.properties,a=r.getLayoutValue("qUndoExclude")?"qUndoExclude.qHyperCubeDef":"qHyperCubeDef",s={hyperCube:r.getHyperCube(),hyperCubeDef:uu(o,a),isDimension:!1,disabled:()=>!i.interact.enabled(),model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},l=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleMeasures&&(s.padding="0",s.minWidth="auto"),{key:"measure-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},settings:s,style:l}}function Tx({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},f=a.getStyles(),m=s.animations.enabled;return[pf({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:cv.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:cv.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:_v.refLines.minimumLayoutMode}),pf({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:cv.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:cv.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:cv.COMPONENT.BAR,minimumLayoutMode:_v.refLines.minimumLayoutMode}),...gf({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.minor.opposite,scale:cv.SCALE.MAIN.MINOR,style:f,formatter:cv.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:cv.COMPONENT.MEASURE_REF_LINE_LABEL}),...gf({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.major.opposite,scale:cv.SCALE.MAIN.MAJOR,style:f,theme:u,localeInfo:c,rtl:t,key:cv.COMPONENT.DIMENSION_REF_LINE_LABEL})]}const kx=(e,t,n)=>{var r;const{layoutService:i,dockService:o,colorService:a,chart:s,actions:l,discrete:u,continuousDataModel:c,reducedDataModel:d,viewModel:f,viewState:m,viewCache:p,themeService:h,refLineModel:g,pluginService:y,rtl:v,logicalSize:b,trendLineModel:x}=t,{localeInfo:q}=n,M=Sb({layout:e},t,v);if(M&&"center"===M.layout.dock)return{components:[M]};const S=rx(e,t,{localeInfo:q,rtl:v}),D=!(null!=l&&null!==(r=l.interact)&&void 0!==r&&r.enabled()),C=a.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:s,styleReference:"object.barChart",rtl:v,settings:{item:{shape:{size:10}}}},{actions:l,navigationDisabled:D}),w=C.components[0];if(w){const{dock:e}=w.layout;if(S.fillRange&&(["right","left"].includes(e)||v)&&(S.fillRange.invert=!0),"legend-seq"===w.type&&void 0!==f.selectionDimensionIdx&&S.fillRange&&S.fillRange.min<S.fillRange.max){const e=Bv({eventName:"legendRange",key:"legendRangeBrush",targets:[w.key],fillTargets:[w.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:w.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{l.select.emit("end","legendRange")}},t);C.components.push(...e.components),C.interactions.unshift(...e.interactions)}}else S.fillRange&&v&&(S.fillRange.invert=!0);const L=((e,{componentKey:t,collectionKey:n})=>{var r,i,o,a;const{meta:s}=e.layoutService;let l,u;s.isGroupedByDimension?l=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:s.isGroupedByMeasure&&(l=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let c=2;s.isContinuous?(u={start:"timeStart",end:"timeEnd"},c=Xv(e,t)):s.isStacked&&(u="stack");const d=s.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,f=e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)},m=e.layoutService.getLayoutValue("components",null),p=m?m.filter((e=>e.key===t))[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:s.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:s.isContinuous||d?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:cv.SCALE.MAIN.MAJOR,fn:l,ref:u},minor:{scale:cv.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:t}),minWidthPx:c,fill:e.colorService.getMain().getColor(),opacity:e=>f(e)?0:void 0,minHeightPx:function(e){return s.isStacked?.1:f(e)?.01:.3},strokeWidth:null!=p&&null!==(r=p.style)&&void 0!==r&&r.strokeWidth?Gv.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:Gv.BAR.STROKE.WIDTH.NONE,stroke:null!==(i=null==p||null===(o=p.style)||void 0===o||null===(a=o.strokeColor)||void 0===a?void 0:a.color)&&void 0!==i?i:Gv.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:uf.bars.trackBy,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges}}})(t,{componentKey:cv.COMPONENT.BAR,collectionKey:cv.COLLECTION.MAIN}),E=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=Xv(e,t));const o=e.layoutService.getLayoutValue("components",null),a=o?o.filter((e=>e.key===t))[0]:null,s={key:t,type:"box",data:{collection:n},settings:{major:{scale:cv.SCALE.MAIN.MAJOR},minor:{scale:cv.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:fx(r,a),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1}},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:.3}}}}]}};return r.isContinuous&&(s.settings.major.ref={start:"timeStart",end:"timeEnd"}),s})(t,{componentKey:cv.COMPONENT.STACK_TOTAL_BAR,collectionKey:cv.COLLECTION.STACK_TOTAL}),T=sx(t,n,f.selectionDimensionIdx),{isStacked:k}=i.meta;let N;N=d.mode.isContinuous?cv.COLLECTION.MINI_CONTINUOUS:k?cv.COLLECTION.MINI_STACK:cv.COLLECTION.MINI;const A=k?E:L,O=Ab(0,t),I=[...O,dx(t,{barComponent:A,type:"max",isStacked:k}),dx(t,{barComponent:A,type:"min",isStacked:k}),sb(t,{barComponent:A,type:"max",isStacked:k}),sb(t,{barComponent:A,type:"min",isStacked:k}),ub(t,{chart:s,barComponent:A,type:"max",scales:S,collectionKey:k?cv.COLLECTION.STACK_TOTAL:cv.COLLECTION.MAIN}),ub(t,{chart:s,barComponent:A,type:"min",scales:S,collectionKey:k?cv.COLLECTION.STACK_TOTAL:cv.COLLECTION.MAIN}),...Kv(e,t,v,!!O[0]),L,E,lx({layoutService:i,viewModel:f,layout:e,dockService:o}),Lx(e,t,v),Ex(e,t,v),...Tx({environment:n,rtl:v,refLineModel:g,layoutService:i,colorService:a,dockService:o,themeService:h,viewModel:f,chart:s}),qo({viewState:m,viewCache:p,layoutService:i,dockService:o,rtl:v}),zb(L,t,{collectionKey:N}),kh({layoutService:i,dockService:o,discrete:u,continuousDataModel:c,viewState:m,viewCache:p,themeService:h,rtl:v,deviceType:n.deviceType}),...Gy({majorScale:cv.SCALE.MAIN.MAJOR,minorScale:cv.SCALE.MAIN.MINOR,tooltipOverlay:cv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:x,dockService:o,animationsEnabled:f.animations.enabled}),...C.components,yb({layout:e,component:cv.COMPONENT.BAR,minorScale:S.minor},t,v),Sx({layout:e,component:cv.COMPONENT.STACK_TOTAL_BAR},t,v),Cx({layout:e,component:"bar-oob-max",type:"max"},t),Cx({layout:e,component:"bar-oob-min",type:"min"},t),...T.components,bb(0,{...t,coloring:a.getMain().getSettings()},v),qb(0,{...t,coloring:a.getMain().getSettings()},v),(!1!==e.showDisclaimer||!t.flags.isEnabled("SHOW_DISCLAIMER"))&&M,Zy({tooltip:cv.COMPONENT.TREND_LINES_TOOLTIP,formatter:cv.FORMATTER.MINOR,majorScale:cv.SCALE.MAIN.MAJOR},t,{rtl:v})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(I);return{interactions:jb(t,{rtl:v,hammer:{gestures:[...C.interactions,...T.gestures].sort(((e,t)=>(t.prio||0)-(e.prio||0)))}}),scales:S,palettes:a.getMain().getPalettes(),components:y.extendComponents(I),strategy:te(0,{logicalSize:b,minCenterRatio:0}),formatters:Db(t,S),collections:qx(0,t)}};function Nx({picasso:e,chart:t,services:n,environment:r,viewState:i,viewCache:o,bootstrapped:a}){const{width:s,height:l}=O(),u=E(),c=N(),d=D(),[f,m]=b(),[p,h]=b(),[g,y]=b(),[v,x]=b(),q=T();function S(){if(!t.layoutComponents)return Promise.resolve();const{discrete:a,layoutService:s,viewModel:l}=n;o.set("isPreRender",!0);const m=function(a={}){const{selectionService:s,refLineModel:l,discrete:m,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,pluginService:y,colorService:v,viewModel:b,dockService:x,themeService:M,customTooltipModel:S,layoutService:D,logicalSize:C,styleService:w}=n,L=s.custom.getActions(),E=e.data("q")(f.prepPicassoDataSet()),T={picasso:e,ds:E,rtl:"rtl"===(null==d?void 0:d.direction),model:u,app:q,chart:t,actions:L,localeInfo:r.localeInfo,logicalSize:C,flags:r.flags,translator:r.translator,selections:c,isLocked:s.getIsSelectionLocked,viewCache:o,viewState:i,layoutService:D,dockService:x,viewModel:b,colorService:v,selectionService:s,themeService:M,trendLineModel:g,discrete:m,continuousDataModel:h,reducedDataModel:p.model(),customTooltipModel:S,debouncer:mu,refLineModel:l,pluginService:y,styleService:w,...a};return kx(D.getLayout(),T,r)}(p);f.extractDataPages(),t.layoutComponents({settings:m,data:g}),o.set("isPreRender",!1),f.insertDataPages(),l.animations.hasSlicedHats=m.components.filter((e=>"box-sliced-hat"===e.type)).length>0;const h=[];return 1!==m.components.length&&s.meta.isDiscrete&&h.push(a.command.initialize()),Promise.all(h)}const[[C,w]=[]]=I((()=>{var s;if(!(e&&t&&n&&r&&i&&o&&a))return Promise.resolve();const{layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:f,reducedDataModel:m,continuousDataModel:p,trendLineModel:h,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b}=n;if(null==u||null===(s=u.custom)||void 0===s||!s.getActions())return Promise.resolve();const q=()=>{x(Date.now()),b.animations.isPartialUpdating=!0};i.onChanged("scrollOffset",(()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),q()})),i.onChanged("legendScrollOffset",q),i.intercept("zoom",f.event.onZoomIntercept({viewCache:o})),i.onChanged("zoom",f.event.onZoomChange({layoutService:l,continuousDataModel:p},q)),u.setLayout(l.getLayout());const M=[];l.meta.isContinuous&&(p.update(l.getLayout()),M.push(p.initialFetch())),h.command.update(),M.push(m.fetch().then((({reducedCube:e})=>{m.update(e)}))),M.push(Promise.resolve({properties:a.properties}));return Promise.all(M).then((e=>Promise.all([v.initialize(),y.initialize(),Rv({reducedDataModel:m,layoutService:l,continuousDataModel:p,trendLineModel:h})]).then((t=>[e,t.pop()]))))}),[a]);M((()=>{var e;if(null==n||null===(e=n.colorService)||void 0===e||!e.getMain()||!w)return;const{layoutService:t,selectionService:i,reducedDataModel:a,continuousDataModel:s,trendLineModel:l,legendLayoutService:u,colorService:c,viewModel:d}=n;o.set("minorMinMax",w);const f=t.getHyperCube(),p=t.meta.isContinuous?s.getInitialCube():a.model().cube,{field:g}=c.getMain().getSettings(),y=!t.meta.isContinuous&&(a.model().mode.isReduced||t.meta.isStacked)&&u,v=y?u.getHyperCube():void 0;i.setBrushAliases({colorField:g,useLegendCube:y,legendAlias:"legendCube/"+g});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:c}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:c}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:f,miniCube:p,legendCube:v,localeInfo:r.localeInfo,layoutService:t,viewModel:d,trendLineModel:l}),x=C[C.length-1];h({localeInfo:r.localeInfo,...x}),m(b)}),[w]),M((()=>{if(!n||!p||!f)return;const e=n.colorService.getMain();if(!e)return;f.prepPicassoDataSet();const t=f.prepPicassoData(e.getData());y(t)}),[p]),M((()=>{var e;null!=n&&null!==(e=n.colorService)&&void 0!==e&&e.getMain()&&t.update&&f&&g&&S().then((()=>{const{layoutService:e,discrete:r,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([r.query.getCurrentDataPage()])}t.update(),uf.cacheProperties({viewCache:o,layout:e.getLayout()})}))}),[g]),M((()=>{if(!(s&&l&&f&&null!=t&&t.update&&null!=n&&n.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:o}=n;i.update({width:s,height:l}),o.setTheme(r.theme),S().then((()=>{t.update&&t.update()}))}),[s,l]),M((()=>{if(null==t||!t.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1}),[v])}function Ax({env:e,services:t}){const n=T(),r=E(),i=F(),[o,a]=I((async()=>{if(!e||!t)return Promise.resolve();const{flags:o}=e,{layoutService:a}=t,{isSnapshot:s,isStacked:l,isContinuous:u}=a.meta,c=[];return s||c.push(r.getEffectiveProperties()),Promise.all(c).then((async e=>{const t=e[0]||void 0;if(o.isEnabled("IM_1579_HIDE_DIM_MEA")&&null!=t&&t.qHyperCubeDef){const e=a.getLayout(),o=G(!0,{},t);if((({properties:e,layout:t,isStacked:n,isContinuous:r,model:i})=>{var o,a;const s=t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),l=t.qHyperCube.qMeasureInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),u=G(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&(n.color.mode="primary"))})(s,l,e),s.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),s.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),null===(o=i.colorSupport)||void 0===o||null===(a=o.colorByUpdater)||void 0===a||a.call(o,e,"qHyperCubeDef.",t),JSON.stringify(u)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)})({properties:t,layout:e,isStacked:l,isContinuous:u,model:r}))return i.pending(),(e=>{var t;return!(!e||e.qHasSoftPatches||e.qExtendsId||!(((null===(t=e.qMeta)||void 0===t?void 0:t.privileges)||[]).indexOf("update")>-1))})(e)?r.setProperties(t).then((()=>{n.clearUndoBuffer()})):void await((e,t,n)=>{if(!e)return Promise.resolve();let r=Lo.generate(t,n);return G(!0,t,n),r&&r.length?(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0)):Promise.resolve()})(r,o,t);i.restore()}return{properties:t}}))}),[e,t]);if(a&&!a.isHandled)throw a;return o}var Ox={exports:{}};window;var Ix=H(Ox.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},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)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).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 h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),f=c(r[1],i),m=p(0),h=p(1),g=y(d,m),v=y(f,h);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var q={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(m(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};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 S=i.a.bind(null,!0),D={},C=Array.isArray;function w(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function L(e){return void 0===e}function E(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=L(e[n||t])?o:e[t],e=e[n||t]}})),e}function k(e,t){var n=!0;if(w(e)&&w(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){k(e[r],t[r])||(n=!1)})),n);if(C(e)&&C(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||E(t,i)||(L(a)?r.push({op:"add",path:s,value:o}):w(o)&&w(a)?r=r.concat(D.generate(a,o,s)):C(o)&&C(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&L(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(k(t,i))return r;if(!L(t[0])&&L(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){L(t[i])&&!E(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},D.apply=function(e,t){t.forEach((function(t){var n,r=T(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(C(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(C(o)&&C(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(w(o)&&w(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!E(n,e)&&delete n[e]})),S(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 u=T(e,t.from);C(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(C(r)?r.splice(+i,1):delete r[i])}))},D.clone=function(e){return S({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):S(e,t)};var N=D,A=function(e,t,n){if(!e)return Promise.resolve();var r=N.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()},O="accumulation";function I(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===O)return n[r]}function P(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===O)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var R={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},F={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=q.getNumStepComp(n,l),f=q.getAboveComp(n,l,c,d),m=q.getRangeComp("RangeSum",f);if(q.needDimension({modifier:n,properties:r,layout:i})){var p=q.getDimComp(u,1),h=q.getDimComp(u,0),g=q.getAggrComp(m,p,h);m=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return m},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,R)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(P(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(P(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(P(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(P(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=I(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=I(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(P(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(O))return!1;var o=I(t,e);return o&&!o.disabled}}}},j="movingAverage";function H(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},_={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=q.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),m=q.getNumStepComp(r,u),p=q.getAboveComp(r,u,f,m);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",p);else{var h=q.getRangeComp("RangeSum",p),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(q.needDimension({modifier:r,properties:i,layout:o})){var v=q.getDimComp(c,1),b=q.getDimComp(c,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return q.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=H(t,e);return o&&!o.disabled}}}},V="difference";function U(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function W(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},K={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=q.getAboveComp(n,l,c),f="".concat(c," - ").concat(d);if(q.needDimension({modifier:n,properties:r,layout:i})){var m=q.getDimComp(u,1),p=q.getDimComp(u,0),h=q.getAggrComp(f,m,p);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!q.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 q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=U(t,e);return o&&!o.disabled}}}},G={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},Y={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},J="normalization";function X(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}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:Y.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:Y.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:Y.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}(X(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:G.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:G.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:G.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}(X(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:Y.DISREGARD_ALL_DIMENSIONS,selectionScope:G.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(q.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(q.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,d,n.field,n.value,f,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!q.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:G.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 X(t,e).selectionScope===G.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 X(t,e).selectionScope===G.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:Y.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(X(t,e).dimensionalScope||0)===Y.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.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=X(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe={accumulation:F,movingAverage:_,difference:K,normalization:se},me=(t.default={modifiers:fe,apply:pe,applyModifiers:he,cleanUpMeasure:ge,destroy:function(e){e&&me[e.id]&&me[e.id].masterItemSubscriber&&(me[e.id].masterItemSubscriber&&me[e.id].masterItemSubscriber.unsubscribe(),delete me[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return fe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return fe[e]&&fe[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=qe(e);Ee({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Oe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;me[t.id]=me[t.id]||{isFirstTime:!0};var l=me[t.id].isFirstTime;if(me[t.id].isFirstTime=!1,n&&"object"===de(n))return he({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),f=me[t.id].lastReloadTime;if(me[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:d,layout:u})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Le({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,lastReloadTime:f});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ee({modifiers:qe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Se(n);var r=Ie(n);return Te({model:t}).then((function(i){return ke({libraryIds:r,model:t}).then((function(r){return m&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Le({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(fe[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=fe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ce(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),he({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ie(n);return Pe({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ae({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function he(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Se(r);var f=Ie(r);return Pe({model:t,libraryIds:f,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ie(n);return Te({model:r,dimensionAndFieldList:s}).then((function(e){return ke({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ee({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");fe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=fe[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof fe[n.type].updateModifier&&fe[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=fe[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Ae({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=qe(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!fe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,De(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ee({modifiers:qe(e),properties:n,layout:r})}))}function ve(e){var t=qe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(fe[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||fe[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function qe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Se(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:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function De(e){var t=qe(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!fe[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ce(e){return e.base||e.qDef&&e.qDef.base}function we(e){var t=Ce(e);return e.qLibraryId||t&&t.qLibraryId}function Le(e){var t=e.measure,n=e.properties,r=e.layout;return!we(t)&&Ee({modifiers:qe(t),properties:n,layout:r})}function Ee(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!fe[e.type])&&(void 0===i[e.type]&&(i[e.type]=fe[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Te(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ne(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ae(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Ne)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Ne)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ne)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ne);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):A(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Oe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&fe[e.type]&&fe[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ie(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=qe(t);if(Ee({modifiers:r,properties:e})){var o=we(t);o&&n.push(o),i=i||Oe({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Pe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(me[t.id].masterItemSubscriber=me[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(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 c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),me[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(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)?u(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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},f=n(1),m=n.n(f),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(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 a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){m.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function h(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function M(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return 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}var w={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,q),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,q),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=M(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=D(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&m.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function L(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var E={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.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:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(h(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(h(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(h(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,f=void 0===d||d,m=e.isHCModifierSupported,p=void 0===m||m,h={qChildren:[]},g=w.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=w.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,M=b.maxMeasures,S=b.minMeasures,D=l.defaultDimension,C=void 0===D?w.getDefaultDimension():D,E=l.defaultMeasure,T=void 0===E?w.getDefaultMeasure():E;v.qDimensions.length=0,v.qMeasures.length=0,w.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S})&&w.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S,newHyperCubeDef:v}),w.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:C}),w.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:S,newHyperCubeDef:v,defaultMeasure:T}),w.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),w.copyPropertyIfExist("qMaxStackedCells",y,v),w.copyPropertyIfExist("qNoOfLeftDims",y,v),w.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),w.copyPropertyOrSetDefault("qMode",y,v,"S"),w.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),w.copyPropertyOrSetDefault("qSortbyYValue",y,v),w.copyPropertyOrSetDefault("qIndentMode",y,v),w.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),w.importCommonProperties(g,t,r),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return w.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:k}),f&&L(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&L(h.qProperty,"dynamicScript"),h}},T={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function k(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function N(e,t){return e.length!==t}var A={create:function(e,t){if(!e||!T[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(k(a,t,r,i),N(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},O={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}},I={colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>0&&O.getNumMeasures(e)<=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>0},expression:function(e){return O.getNumMeasures(e)>=1}}},P={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},R={scatterplot:P,"sn-scatter-plot":P,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)<=1},expression:function(e){return O.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>=1},expression:function(e){return O.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 O.getNumDimensions(e)>=1}}}};function F(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=A.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)})),t.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)}))}function H(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var m=A.create(A.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:m,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:m,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(m.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(m)):l.qAttributeExpressions.push(m)}}}function B(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:m.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return m.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var _={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=O.getItemLabel(t);switch(H(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||O.wrapFieldName(t.name),key:O.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&_.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=A.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,B("dimension",!!a,a||r)),!!a}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"),[]),a=o.getValue(e,"color.byDimDef");if(a&&H(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=B("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&U(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&H(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=B("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=A.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,B("measure",!!s,s||r[0])),!!s}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var K={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=(R[t]||I).colorModeOptions||I.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=E.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=A.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return A.moveByIdFromGroup(a,[],"qAttributeDimensions",u),A.moveByIdFromGroup(a,[],"qAttributeExpressions",u),A.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=E.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,f=o.getValue(d,"visualization"),m=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),g=K.getCanColorBy(d,f),y=K.shouldUpdateColorBy({canColorBy:g,autoColor:h,colorMode:p,dimensions:m});return g[p]?K.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:d})&&K.addColorByExpression(d):K.switchToAutoColor(d),y&&K.updateColorBy(d,"qHyperCubeDef."),K.shouldSwitchToColorPersistent(d)&&K.changeProperty(d,"color.persistent",!0),K.deleteTotalMode(m),c}},Y=["bar","marker","line"],J={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?L(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):L(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var 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}}),Y.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(h(s,"measureAxis.min","supportedAutoMinMax"),h(s,"measureAxis.max","supportedAutoMinMax")):(h(s,"measureAxis.min","unsupportedAutoMinMax"),h(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return J.handleAutoMinMax({initialProperties:n,properties:d}),J.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),J.setInterColumnSortOrder(d.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:E,colorChart:G,axisChart:X,quarantineProperty:h,unquarantineProperty:L,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}]));function Px(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,r=t.layout.qHyperCube.qDimensionInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const Rx=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Fx=(e,t)=>{var n,r,i,o,a;const s=null===(n=t.qHyperCube)||void 0===n||null===(r=n.qMeasureInfo)||void 0===r?void 0:r.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,l=null===(i=t.qHyperCube)||void 0===i||null===(o=i.qDimensionInfo)||void 0===o?void 0:o.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,u="grouped"===(null===(a=e.barGrouping)||void 0===a?void 0:a.grouping)&&l>0&&s+l>2;return de.continuous(t)?1:u?.9:.7},jx=(e,t,n)=>{const r=e+".fontFamily",i=e+".fontSize";return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:e+".color",defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function Hx(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach((function(e){for(var r=e.split("."),i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=af({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var l=function(e){for(var t=e.split("."),n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==t?void 0:t.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(Rx).map((e=>Rx[e])),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return de.continuous(r)?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:jx("axis.title",r,e)}}}:void 0,axisLabelSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:jx("axis.label.name",r,e)}}}:void 0,labelSection:null!=t&&t.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:jx("label.value",r,e)}}}:void 0}}}function zx(e=!1,t,n,r){return e?function(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(Rx).map((e=>Rx[e])),schemaIgnore:!0,defaultValue:Rx[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>Fx(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(Ch.OPTIONS).map((e=>Ch.OPTIONS[e])),schemaIgnore:!0,defaultValue:Ch.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}(n):Hx(t,n,r)}const Bx={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"bar",ref:"components",defaultValues:(e,t)=>({key:"bar",style:{width:Fx(e,t.layout),strokeColor:{index:-1,color:"#205891"},strokeWidth:"none"}}),items:{bar:{components:"items",type:"items",uses:"styling.box",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},width:{show:(e,t,n)=>!de.continuous(n.layout),component:"slider",min:.01,max:1,step:.01,defaultValue:.7}}}}},_x=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg},Vx=(e,t)=>e.qHyperCube[t].filter((e=>_x(e))),Ux=e=>({get:(t,n,r)=>de.continuous(r.layout)?e:t(n.type),set(e,t,n){const r=he(n.type,n);t(n.type,e,r)}}),Wx=e=>{const t=G(!0,{},e);return t.qHyperCube.qMeasureInfo=Vx(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=Vx(e,"qDimensionInfo"),t&&!de.continuous(t)&&de.stacked(t)},$x=({translator:e,flags:t,anything:n})=>{var r,i,o;const a=null==n||null===(r=n.sense)||void 0===r||null===(i=r.isUnsupportedFeature)||void 0===i?void 0:i.call(r,"continuousData"),s={items:{labels:{items:{header:{show:(e,t,n)=>Vx(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!Wx(t.layout)&&Vx(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>Wx(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>Wx(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>Vx(n.layout,"qDimensionInfo").length&&Vx(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>Vx(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},l=null==n||null===(o=n.sense)||void 0===o?void 0:o.theme,u={uses:"settings",items:{simpleStyling:zx(!0,l,t,e),simpleLabels:s,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_BARCHART")?zx(!1,l,t,e):Bx,grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=Vx(t.layout,"qMeasureInfo").length,r=Vx(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},change(e,t){Vx(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:Ux("stacked")},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:Ux("vertical")},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(Ch.OPTIONS).map((e=>Ch.OPTIONS[e])),defaultValue:Ch.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!de.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(Wx(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Wx(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Wx(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,n,r)=>t&&t.isEnabled("BC_XAXIS_MODE")&&!de.continuous(r.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=Vx(n.layout,"qMeasureInfo").length,i=Vx(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:Px,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!a}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};return null!=t&&t.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(u.items.dimensionAxis.items.othersGroup={items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}),u},Kx={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){Dt(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Gx={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"}}},Yx=({translator:e,flags:t,anything:n})=>{var r,i;return{uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,r){var i,o;if(null!=n&&null!==(i=n.sense)&&void 0!==i&&null!==(o=i.isUnsupportedFeature)&&void 0!==o&&o.call(i,"includeZeroValues"))return!1;const a=((e,t)=>{var n,r,i,o,a,s;const l=null===(n=t.layout)||void 0===n||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.findIndex((e=>_x(e)));return(null===(o=t.properties)||void 0===o||null===(a=o.qHyperCubeDef)||void 0===a||null===(s=a.qDimensions)||void 0===s?void 0:s[l])===e})(e,t),s=de.continuous(r.layout);return!(a&&s)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")},trendLines:null!=n&&null!==(r=n.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"trendlines")?void 0:rv({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}}};function Jx({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Yx({translator:e,flags:t,anything:n}),sorting:Kx,addons:Gx,settings:$x({translator:e,flags:t,anything:n})}}}const Xx=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg};function Zx(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter((e=>Xx(e))).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){return t.qHyperCube.qMeasureInfo.filter((e=>Xx(e))).length+t.qHyperCube.qDimensionInfo.filter((e=>Xx(e))).length>2&&!de.continuous(t)&&!((null==(n=t)||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.filter((e=>Xx(e))).length)>1&&(null==n||null===(o=n.qHyperCube)||void 0===o?void 0:o.isHCEnabled));var n,r,i,o},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!de.continuous(t)}}},color:{uses:"color"}}}}function Qx(e){const t={},n=uu(e,"components"),r=uu(e,"dimensionAxis.axisDisplayMode"),i=uu(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter((e=>"bar"===e.key))[0]:void 0,a=uu(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach((e=>{t["chart_style_"+e]=o.style[e]})),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=uu(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const eq=e=>!!(e&&e.qHyperCube.qSize.qcy>0),tq={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function nq(){const e=[];return Object.keys(tq).forEach((t=>{e.push(tq[t])})),e}function rq(e){const{flags:t}=e;return{definition:Jx(e),softDefinition:Zx(),support:{snapshot:eq,export:eq,exportData:!0,sharing:eq,viewData:!0,effects:!0,modifiers:nq()},importProperties:(n,r,i,o)=>{const a={layout:{templateId:r.templateId}};i.mapProperties(a);const s={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},l=Ix.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:Jg(e),defaultPropertyValues:s,hypercubePath:o,extension:i}),u=l.qProperty;return u.qHyperCubeDef.qDimensions.length>1&&"stacked"===u.barGrouping.grouping&&(u.qHyperCubeDef.qMode="K",u.qHyperCubeDef.qAlwaysFullyExpanded=!0),t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Ix.conditionalShow.unquarantine(u),Ix.conditionalShow.unquarantineAlternative(u)),l},exportProperties:(e,n,r)=>{t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Ix.conditionalShow.quarantine(e.qProperty),Ix.conditionalShow.quarantineAlternative(e.qProperty));return Ix.axisChart.exportProperties({propertyTree:e,hyperCubePath:n,viewDataMode:r})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(Dt)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=Ch.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Qx}}function iq(i){const o=function(){const i=e();return i.use(t),i.use(n(r)),i.use(Xm()),i.use(bg),i.component("box-sliced-hat",yg),i.component("box-out-of-bounds",fg),i.component("scrollbar",sg),i.component("scroll-hint",xo),i.component("reference-line-labels",xa),i.component("axis-overlay",Sh.picassoComponents.axisOverlay),i.component("time-axis",Sh.picassoComponents.timeAxis),i.scale("q-time-axis",Sh.picassoScales.time),i}();return{qae:Xg(i),ext:rq(i),component(){const e=Qg({env:i}),{viewState:t,viewCache:n}=ey(),r=function({picasso:e}){const t=S(),n=D(),[r,i]=b();return M((()=>{if(!e)return()=>{};t.style.overflow="hidden";const r=e({renderer:{prio:[(null==n?void 0:n.renderer)||"canvas"]}}).chart({element:t,data:[],settings:{}});i(r);const{destroy:o}=r;return()=>{o()}}),[n.renderer]),r}({picasso:o}),a=yv({picasso:o,chart:r,environment:e,viewState:t,viewCache:n}),s=Ax({env:i,services:a});Nx({picasso:o,chart:r,services:a,environment:e,viewState:t,viewCache:n,bootstrapped:s}),(({services:e,chart:t,viewState:n})=>{P((r=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discrete:s,continuousDataModel:l,reducedDataModel:u}=e,{width:c,height:d}=o.meta.chart.size;return r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(r.snapshotData.content.chartData={scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:fe(t,cv.COMPONENT.LEGEND_COLOR_CAT)},i.meta.isDiscrete?(s.command.setSnapshotData(r),u.setSnapshotData(r)):l.setSnapshotData(r),a.getMain().getSnapshotData().then((e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}})).catch((()=>{})))})),R((()=>({getViewState(){if(n&&t)return{scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:fe(t,cv.COMPONENT.LEGEND_COLOR_CAT)}}})),[n,t])})({services:a,chart:r,viewState:t})}}}export{iq as default};
18
+ Object.defineProperty(Jf,"__esModule",{value:!0});var Xf="function"==typeof Symbol&&Symbol.for,Zf=Xf?Symbol.for("react.element"):60103,Qf=Xf?Symbol.for("react.portal"):60106,em=Xf?Symbol.for("react.fragment"):60107,tm=Xf?Symbol.for("react.strict_mode"):60108,nm=Xf?Symbol.for("react.profiler"):60114,rm=Xf?Symbol.for("react.provider"):60109,im=Xf?Symbol.for("react.context"):60110,om=Xf?Symbol.for("react.async_mode"):60111,am=Xf?Symbol.for("react.concurrent_mode"):60111,sm=Xf?Symbol.for("react.forward_ref"):60112,lm=Xf?Symbol.for("react.suspense"):60113,um=Xf?Symbol.for("react.suspense_list"):60120,cm=Xf?Symbol.for("react.memo"):60115,dm=Xf?Symbol.for("react.lazy"):60116,fm=Xf?Symbol.for("react.fundamental"):60117,mm=Xf?Symbol.for("react.responder"):60118,pm=Xf?Symbol.for("react.scope"):60119;function hm(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Zf:switch(e=e.type){case om:case am:case em:case nm:case tm:case lm:return e;default:switch(e=e&&e.$$typeof){case im:case sm:case rm:return e;default:return t}}case dm:case cm:case Qf:return t}}}function gm(e){return hm(e)===am}Jf.typeOf=hm,Jf.AsyncMode=om,Jf.ConcurrentMode=am,Jf.ContextConsumer=im,Jf.ContextProvider=rm,Jf.Element=Zf,Jf.ForwardRef=sm,Jf.Fragment=em,Jf.Lazy=dm,Jf.Memo=cm,Jf.Portal=Qf,Jf.Profiler=nm,Jf.StrictMode=tm,Jf.Suspense=lm,Jf.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===em||e===am||e===nm||e===tm||e===lm||e===um||"object"==typeof e&&null!==e&&(e.$$typeof===dm||e.$$typeof===cm||e.$$typeof===rm||e.$$typeof===im||e.$$typeof===sm||e.$$typeof===fm||e.$$typeof===mm||e.$$typeof===pm)},Jf.isAsyncMode=function(e){return gm(e)||hm(e)===om},Jf.isConcurrentMode=gm,Jf.isContextConsumer=function(e){return hm(e)===im},Jf.isContextProvider=function(e){return hm(e)===rm},Jf.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Zf},Jf.isForwardRef=function(e){return hm(e)===sm},Jf.isFragment=function(e){return hm(e)===em},Jf.isLazy=function(e){return hm(e)===dm},Jf.isMemo=function(e){return hm(e)===cm},Jf.isPortal=function(e){return hm(e)===Qf},Jf.isProfiler=function(e){return hm(e)===nm},Jf.isStrictMode=function(e){return hm(e)===tm},Jf.isSuspense=function(e){return hm(e)===lm},"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),bf.exports.oneOfType([bf.exports.func,bf.exports.PropTypes.object]);var ym=["xs","sm","md","lg","xl"];function vm(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=Wf(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=ym.indexOf(t)+1;return r===ym.length?l(e):"@media (min-width:".concat(n[e]).concat(i,") and ")+"(max-width:".concat(n[ym[r]]-a/100).concat(i,")")}return Uf({keys:ym,values:n,up:l,down:function(e){var t=ym.indexOf(e)+1,r=n[ym[t]];return t===ym.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}function bm(e,t,n){var r;return Uf({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Uf({paddingLeft:t(2),paddingRight:t(2)},n,Vf({},e.up("sm"),Uf({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},Vf(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Vf(r,e.up("sm"),{minHeight:64}),r)},n)}var xm="#7986cb",qm="#3f51b5",Mm="#303f9f",Sm="#ff4081",Dm="#f50057",Cm="#c51162",wm={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},Lm="#e57373",Em="#f44336",Tm="#d32f2f",km={black:"#000",white:"#fff"},Nm={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:km.white,default:wm[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.08)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.14)",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)"}},Am={text:{primary:km.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:wm[800],default:"#303030"},action:{active:km.white,hover:"rgba(255, 255, 255, 0.1)",hoverOpacity:.1,selected:"rgba(255, 255, 255, 0.2)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"}};function Om(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=zf(e),t=Hf(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return Bf(e)}(e.main,r):"dark"===t&&(e.dark=function(e,t){if(e=zf(e),t=Hf(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return Bf(e)}(e.main,1.5*r)))}function Im(e){var t=e.primary,n=void 0===t?{light:xm,main:qm,dark:Mm}:t,r=e.secondary,i=void 0===r?{light:Sm,main:Dm,dark:Cm}:r,o=e.error,a=void 0===o?{light:Lm,main:Em,dark:Tm}:o,s=e.type,l=void 0===s?"light":s,u=e.contrastThreshold,c=void 0===u?3:u,d=e.tonalOffset,f=void 0===d?.2:d,m=Wf(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function p(e){return function(e,t){var n=_f(e),r=_f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,Am.text.primary)>=c?Am.text.primary:Nm.text.primary}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(e=Uf({},e)).main&&e[t]&&(e.main=e[t]),Om(e,"light",n,f),Om(e,"dark",r,f),e.contrastText||(e.contrastText=p(e.main)),e}var g={dark:Am,light:Nm};return Yf(Uf({common:km,type:l,primary:h(n),secondary:h(i,"A400","A200","A700"),error:h(a),grey:wm,contrastThreshold:c,getContrastText:p,augmentColor:h,tonalOffset:f},g[l]),m,{clone:!1})}function Pm(e){return Math.round(1e5*e)/1e5}var Rm={textTransform:"uppercase"};function Fm(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,f=void 0===d?500:d,m=n.fontWeightBold,p=void 0===m?700:m,h=n.htmlFontSize,g=void 0===h?16:h,y=n.allVariants,v=n.pxToRem,b=Wf(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,q=v||function(e){return"".concat(e/g*x,"rem")},M=function(e,t,n,r,o){return Uf({fontFamily:i,fontWeight:e,fontSize:q(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===i?{letterSpacing:"".concat(Pm(r/t),"em")}:{},{},o,{},y)},S={h1:M(l,96,1,-1.5),h2:M(l,60,1,-.5),h3:M(c,48,1.04,0),h4:M(c,34,1.17,.25),h5:M(c,24,1.33,0),h6:M(f,20,1.6,.15),subtitle1:M(c,16,1.75,.15),subtitle2:M(f,14,1.57,.1),body1:M(c,16,1.5,.15),body2:M(c,14,1.43,.15),button:M(f,14,1.75,.4,Rm),caption:M(c,12,1.66,.4),overline:M(c,12,2.66,1,Rm)};return Yf(Uf({htmlFontSize:g,pxToRem:q,round:Pm,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:f,fontWeightBold:p},S),b,{clone:!1})}function jm(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var Hm=["none",jm(0,2,1,-1,0,1,1,0,0,1,3,0),jm(0,3,1,-2,0,2,2,0,0,1,5,0),jm(0,3,3,-2,0,3,4,0,0,1,8,0),jm(0,2,4,-1,0,4,5,0,0,1,10,0),jm(0,3,5,-1,0,5,8,0,0,1,14,0),jm(0,3,5,-1,0,6,10,0,0,1,18,0),jm(0,4,5,-2,0,7,10,1,0,2,16,1),jm(0,5,5,-3,0,8,10,1,0,3,14,2),jm(0,5,6,-3,0,9,12,1,0,3,16,2),jm(0,6,6,-3,0,10,14,1,0,4,18,3),jm(0,6,7,-4,0,11,15,1,0,4,20,3),jm(0,7,8,-4,0,12,17,2,0,5,22,4),jm(0,7,8,-4,0,13,19,2,0,5,24,4),jm(0,7,9,-4,0,14,21,2,0,5,26,4),jm(0,8,9,-5,0,15,22,2,0,6,28,5),jm(0,8,10,-5,0,16,24,2,0,6,30,5),jm(0,8,11,-5,0,17,26,2,0,6,32,5),jm(0,9,11,-5,0,18,28,2,0,7,34,6),jm(0,9,12,-6,0,19,29,2,0,7,36,6),jm(0,10,13,-6,0,20,31,3,0,8,38,7),jm(0,10,13,-6,0,21,33,3,0,8,40,7),jm(0,10,14,-6,0,22,35,3,0,8,42,7),jm(0,11,14,-7,0,23,36,3,0,9,44,8),jm(0,11,15,-7,0,24,38,3,0,9,46,8)],zm={borderRadius:4};function Bm(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;e="function"==typeof t?t:function(e){return t*e};var n=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return 0===n.length?e(1):1===n.length?e(n[0]):n.map((function(t){var n=e(t);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return t}}),n.mui=!0,n}var _m={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Vm={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195},Um=function(e){return"".concat(Math.round(e),"ms")},Wm={easing:_m,duration:Vm,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?Vm.standard:n,i=t.easing,o=void 0===i?_m.easeInOut:i,a=t.delay,s=void 0===a?0:a;return Wf(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:Um(r)," ").concat(o," ").concat("string"==typeof s?s:Um(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},$m={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Km(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.shadows,l=e.spacing,u=e.typography,c=void 0===u?{}:u,d=Wf(e,["breakpoints","mixins","palette","shadows","spacing","typography"]),f=Im(a),m=vm(n),p=Bm(l),h=Uf({breakpoints:m,direction:"ltr",mixins:bm(m,p,i),overrides:{},palette:f,props:{},shadows:s||Hm,typography:Fm(f,c),spacing:p},Yf({shape:zm,transitions:Wm,zIndex:$m},d));return h}f({defaultTheme:Km()});const Gm=Km({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const Ym=m({productionPrefix:"q0158",disableGlobal:!0,seed:""});function Jm(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,o=e();const a={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=o.scaleRatio.x,n=o.scaleRatio.y;return r.style.left=Math.round(o.margin.left+o.x*t)+"px",r.style.top=Math.round(o.margin.top+o.y*n)+"px",r.style.width=Math.round(o.width)+"px",r.style.height=Math.round(o.height)+"px",r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",d.render(function(e,t){return i.createElement(p,{generateClassName:t},i.createElement(h,{theme:Gm},e))}(e,Ym),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&d.unmountComponentAtNode(r),a),destroy(){r&&r.parentElement&&(d.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(o=e(t)),o)};return a}}function Xm(){return function(e){e.renderer("react",Jm()),e.component("data-title",jf(e.renderer("svg")())),e.component("disclaimer",function(){class e extends i.Component{render(){const{label:e,spanStyle:t}=this.props;return i.createElement(i.Fragment,null,i.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:bf.exports.string.isRequired,spanStyle:bf.exports.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:o={}}=this.settings,a="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",s=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=n.height+"px",r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=n.height+"px",r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=n.width+"px",r.height=n.height+"px",r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:case"top":case"bottom":r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(o,r,this.rect),l="center"===r?t:"* "+t,u="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return i.createElement("div",{style:s,dir:a},i.createElement(i.Fragment,null,i.createElement(e,{label:l,spanStyle:u})))}}}())}}var Zm={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:Qm}=Zm;function ep({layoutService:e,largeDataService:t}){const{maxNumPoints:n=Qm}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:tp}=Zm,np=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=tp}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!ep({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:rp}=Zm,{MAX_NUM_POINTS:ip,DEFAULT_NUM_POINTS:op,DEFAULT_NUM_LINES:ap}=Zm,{DEFAULT_NUM_POINTS:sp}=Zm,lp=({layoutService:e,largeDataService:t})=>{if(!ep({layoutService:e,largeDataService:t})){const{maxNumPoints:e=sp}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=ap,maxNumPoints:o=op,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(np({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>ap||o>op)?Math.min(u,Math.ceil(ip/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=rp}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})};function up({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>ep({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>lp({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>np({layoutService:t,largeDataService:n}),fetch:(i,o)=>(({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:lp({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:np({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)})({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function cp(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function dp({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function fp(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function mp(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=fp(),o=fp();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function pp(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function hp(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=mp(e,t,n.qMatrix),i=pp(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}function gp(e){return e.qIsOtherCell}function yp({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(gp)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some(gp)||t++})),t}(n)}const vp={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var bp={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};function xp(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function qp(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const f={x:c+i,y:i,width:d-2*i,height:t.height-2*i},m=s(l[0]+"…").width,p=Math.max(0,f.width-u.width),h=Math.max(0,f.height-u.height),g=o*p,y=a*h;return{show:f.width>=Math.min(m,u.width),text:l,dx:g,dy:y,rect:f,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=xp(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:xp(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function Mp(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=xp(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:xp(i,n.minorGuideLine.strokeWidth),x2:o,y2:xp(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Sp(e){return e.filter((e=>e.show)).map((e=>G({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var Dp={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=xp(1,t.line.strokeWidth);return{show:n.line.show,x1:xp(0,t.line.strokeWidth),y1:r,x2:xp(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=qp(n,this),this.state.minor=Mp(r,this)},render(){return[...Sp([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>G({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...Sp(this.state.major.map((e=>e.guideLine))),...Sp(this.state.minor.map((e=>e.guideLine)))];var e}};function Cp(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function wp(e){return e.qTags.indexOf("$qualified")>-1}function Lp({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];Cp(o,a)?(wp(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function Ep({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function Tp({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(""+e.qText).width+16}))),r.clamp(n),i.rangeAndWidth}}}function kp({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Np({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Tp,queryFactory:s=kp}={attributesFactory:Tp,queryFactory:kp}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Ap({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Np,mapper:a=Lp,resolver:s=Ep}={metaFactory:Np,mapper:Lp,resolver:Ep}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),f=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=f.resolve(t);return n.set(r,i),i}}}function Op(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Ip=Op(0).getTime();function Pp(e){return(e.getTime()-Ip)/86400/1e3}var Rp=new Date,Fp=new Date;function jp(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return jp((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Rp.setTime(+t),Fp.setTime(+r),e(Rp),e(Fp),Math.floor(n(Rp,Fp))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Hp=jp((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Hp.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jp((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Hp:null},Hp.range;var zp=jp((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}));function Bp(e){return jp((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}zp.range,jp((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})).range,jp((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})).range,jp((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})).range;var _p=Bp(0),Vp=Bp(1),Up=Bp(2),Wp=Bp(3),$p=Bp(4),Kp=Bp(5),Gp=Bp(6);_p.range,Vp.range,Up.range,Wp.range,$p.range,Kp.range,Gp.range,jp((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})).range;var Yp=jp((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Yp.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jp((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},Yp.range;var Jp=jp((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()}));Jp.range;var Xp=jp((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}));Xp.range;var Zp=jp((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}));function Qp(e){return jp((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}Zp.range;var eh=Qp(0),th=Qp(1),nh=Qp(2),rh=Qp(3),ih=Qp(4),oh=Qp(5),ah=Qp(6);eh.range,th.range,nh.range,rh.range,ih.range,oh.range,ah.range;var sh=jp((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));sh.range;var lh=jp((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));lh.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jp((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},lh.range;const uh=1,ch=2,dh=3,fh=4,mh=5,ph=6;function hh({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return lh.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=zp.count(e,t),l=Jp.count(e,t),u=Xp.count(e,t),c=Zp.count(e,t),d=eh.count(e,t),f=sh.count(e,t),m=lh.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:m,interval:lh.every(1),formatter:r.year.formatter,offset:e=>lh.offset(e,-1),floor:lh.floor};if(s<=p)v.type=uh,v.desc="second",v.count=s,v.interval=zp.every(1),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-1),v.floor=zp.floor;else if(s/2<=p)v.type=uh,v.desc="every other second",v.count=s/2,v.interval=zp.every(2),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-2),v.floor=zp.floor;else if(s/5<=p)v.type=uh,v.desc="every 5 second",v.count=s/5,v.interval=zp.every(5),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-5),v.floor=zp.floor;else if(s/15<=p)v.type=uh,v.desc="every 15 second",v.count=s/15,v.interval=zp.every(15),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-15),v.floor=zp.floor;else if(s/30<=p)v.type=uh,v.desc="every 30 second",v.count=s/30,v.interval=zp.every(30),v.formatter=r.second.formatter,v.offset=e=>zp.offset(e,-30),v.floor=zp.floor;else if(l<=h)v.type=ch,v.desc="minute",v.count=l,v.interval=Jp.every(1),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-1),v.floor=Jp.floor;else if(l/2<=h)v.type=ch,v.desc="every 2 minute",v.count=l/2,v.interval=Jp.every(2),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-2),v.floor=Jp.floor;else if(l/5<=h)v.type=ch,v.desc="every 5 minute",v.count=l/5,v.interval=Jp.every(5),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-5),v.floor=Jp.floor;else if(l/10<=h)v.type=ch,v.desc="every 10 minute",v.count=l/10,v.interval=Jp.every(10),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-10),v.floor=Jp.floor;else if(l/15<=h)v.type=ch,v.desc="every 15 minute",v.count=l/15,v.interval=Jp.every(15),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-15),v.floor=Jp.floor;else if(l/30<=h)v.type=ch,v.desc="every 30 minute",v.count=l/30,v.interval=Jp.every(30),v.formatter=r.minute.formatter,v.offset=e=>Jp.offset(e,-30),v.floor=Jp.floor;else if(u<=h)v.type=dh,v.desc="hour",v.count=u,v.interval=Xp.every(1),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-1),v.floor=Xp.floor;else if(u/2<=h)v.type=dh,v.desc="every 2 hour",v.count=u/2,v.interval=Xp.every(2),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-2),v.floor=Xp.floor;else if(u/3<=h)v.type=dh,v.desc="every 3 hour",v.count=u/3,v.interval=Xp.every(3),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-3),v.floor=Xp.floor;else if(u/6<=h)v.type=dh,v.desc="every 6 hour",v.count=u/6,v.interval=Xp.every(6),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-6),v.floor=Xp.floor;else if(u/12<=h||i)v.type=dh,v.desc="every 12 hour",v.count=u/12,v.interval=Xp.every(12),v.formatter=r.minute.formatter,v.offset=e=>Xp.offset(e,-12),v.floor=Xp.floor;else if(c<=g)v.type=fh,v.desc="day",v.count=c,v.interval=Zp.every(1),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-1),v.floor=Zp.floor;else if(c/2<=g)v.type=fh,v.desc="every 2 day",v.count=c/2,v.interval=Zp.every(2),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-2),v.floor=Zp.floor;else if(c/3<=g)v.type=fh,v.desc="every 3 day",v.count=c/3,v.interval=Zp.every(3),v.formatter=r.date.formatter,v.offset=e=>Zp.offset(e,-3),v.floor=Zp.floor;else if(d<=g)v.type=fh,v.desc="week",v.count=d,v.interval=eh.every(1),v.formatter=r.date.formatter,v.offset=e=>eh.offset(e,-1),v.floor=Zp.floor;else if(d/2<=g)v.type=fh,v.desc="every 2 week",v.count=d/2,v.interval=eh.every(2),v.formatter=r.date.formatter,v.offset=e=>eh.offset(e,-2),v.floor=Zp.floor;else if(f<=g)v.type=mh,v.desc="month",v.count=f,v.interval=sh.every(1),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-1),v.floor=Zp.floor;else if(f/3<=g)v.type=mh,v.desc="quarter",v.count=f/3,v.interval=sh.every(3),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-3),v.floor=Zp.floor;else if(f/6<=g)v.type=mh,v.desc="half year",v.count=f/6,v.interval=sh.every(6),v.formatter=r.date.formatter,v.offset=e=>sh.offset(e,-6),v.floor=Zp.floor;else if(m<=y)v.type=ph,v.desc="year",v.count=m,v.interval=lh.every(1),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-1),v.floor=lh.floor;else if(m/2<=y)v.type=ph,v.desc="every 2 year",v.count=m/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-2),v.floor=lh.floor;else if(m/5<=y)v.type=ph,v.desc="every 5 year",v.count=m/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-5),v.floor=lh.floor;else if(m/10<=y)v.type=ph,v.desc="every 10 year",v.count=m/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>lh.offset(e,-10),v.floor=lh.floor;else{const e=Math.floor(m/y);v.type=ph,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>lh.offset(t,-e),v.floor=lh.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const f=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let m=[];if(!o&&c.type<=dh){const n=t.getFormat("date"),r=e.ticks(Zp.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Zp.offset(r[0],-1)),m=(r.length?r:[Zp.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:f,outer:m}}const gh={};function yh(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function vh(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=function(){return Ot.apply(yo(Xr,Jr,Vr,Br,zr,Hr,Er,Lr,ni).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}().domain([Op(l),Op(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let f;f="d3"===d.type?(e,i)=>hh({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Op(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(gh[[t,n,r,r,o]])return gh[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Op(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,f=t/(i-r),m=f/1440,p=f/86400,h=366*f,g=3*f*30,y=a.second.width/p,v=a.minute.width/m,b=a.date.width/g,x=a.year.width/h;let q,M,S,D=0,C=0,w=null,L=null,E=null,T=null,k=null,N=null;const A={outer:[],inner:[]};for(y<1?(w=1,C=1/86400):y<2?(w=2,C=1/86400*2):y<5?(w=5,C=1/86400*5):y<10?(w=10,C=1/86400*10):y<30?(w=30,C=1/86400*30):v<1?(L=1,C=1/1440):v<2?(L=2,C=1/1440*2):v<5?(L=5,C=1/1440*5):v<10?(L=10,C=1/1440*10):v<30?(L=30,C=1/1440*30):v<60?(E=1,C=1/24):v<120?(E=2,C=2/24):v<360?(E=6,C=.25):v<720?(E=12,C=.5):b<1/90?(C=1,T=1):b<2/90?(C=2,T=2):b<7/90?(C=7,T=7):b<31/90?(k=1,C=31):b<1?(k=3,C=90):x<1?(N=1,C=366):x<2?(N=2,C=732):x<5?(N=5,C=1826.25):(N=10,C=3652.5),M=Math.floor((d+n%1)/C);D<i;){S=M+1,q=N?yh("year",[l+M*N,0,1],[l+S*N,0,1],a.year.formatter):k?yh("month",[l,u+M*k,1],[l,u+S*k,1],a.date.formatter):T?yh("day",[l,u,c+M*T],[l,u,c+S*T],a.date.formatter):E?yh("hour",[l,u,c,0+M*E],[l,u,c,0+S*E],a.minute.formatter):L?yh("minute",[l,u,c,0,0+M*L],[l,u,c,0,0+S*L],a.minute.formatter):yh("second",[l,u,c,0,0,0+M*w],[l,u,c,0,0,0+S*w],a.second.formatter),D=Pp(q.start),A.inner.push(q);const e=Math.floor(D);if(!(o||N||k||T)){const t={type:"day",start:Op(e),end:Op(e+1),formatter:a.date.formatter,qStart:e};A.outer[A.outer.length-1]&&A.outer[A.outer.length-1].qStart===t.qStart||A.outer.push(t)}M++}return A.min=r,A.max=i,gh[[t,n,r,r,o]]=A,A}(n,e,d.min,l,u,"T"===s.qType);const m={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>f(t,n)[a].map((t=>{let n;return n="start"===i?Pp(t.start):"end"===i?Pp(t.end):(Pp(t.start)+Pp(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Pp(t.start),end:Pp(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return m}const bh=/t+/i;const xh={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function qh(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Mh="continuousPan";var Sh={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=vp,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=up,snapshotFetcherFactory:u=dp,cacheFetcherFactory:c=cp,cache:d={initial:{},merged:{}}}=s,f=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),m=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,r;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,r=v,Math.max(1e-6,2.3841857910156157e-7*(r-n)))),g=t.meta.isSnapshot?m:f,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=m.getSnapshotData()),o.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),e},initialFetch(){return g.fetch(y,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=pp(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>hp(y,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>g.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=pp(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>hp(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>hp(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return G({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return G({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>yp(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=mu(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return pu(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),f=Math.abs(d-c),m=f-(r>0?.7071067811865475:1.4142135623730951)*f,p=c+m*u,h=d-m*(1-u),g=p<a?a-p:0,y=h>s?h-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(h+g,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Mh,pointers:1,threshold:10,enable(r,i){return this.started===Mh||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{continuousPanstart(n){n.preventDefault(),this.started=Mh;const{min:i,max:o}=r.get("zoom");this[Mh]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},continuousPanmove(e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[Mh],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},continuousPanend(e){e.preventDefault(),this.started=!1},continuousPancancel(e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:bp,timeAxis:Dp},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=G(!0,{},t[i],o)})),r}(t,xh,n),{qAxis:i}=r,o=Sr(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const f=function(e){return Number.isNaN(+e)?NaN:o(e)};f.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},f.invert=e=>o.invert(e),f.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),f.range=e=>Array.isArray(e)?o.range(e):o.range(),f.norm=e=>(qh(a,f),a.instance(e)),f.normInvert=e=>(qh(a,f),a.instance.invert(e)),f.copy=()=>e(t,n),f.clamp=(e=!0)=>(o.clamp(e),o.clamp()),f.min=()=>Math.min(s,l),f.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const m=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return i&&bh.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(41000.2343433)).width+16)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=Op(t[0].data.start),i=Op(t[n-1].data.start);return Zp.count(r,i)/n>=1?o.date:Xp.count(r,i)/n>0?o.minute:Jp.count(r,i)/n>0?o.second:o.date},t}(r);return c=vh(o.copy(),r,m),u=Ap({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*m.getFormat("minute").width,cache:r.cache,scale:f}),f.data=()=>({fields:[{formatter:f.formatter,id:()=>"qHyperCube/"+r.field,key:()=>r.field,raw:uu(n,"fields.0.raw",(()=>({})))}]}),f.formatter=()=>m.getFormatFromTicks(d).formatter,f}}};const Dh={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Ch={OPTIONS:Dh,DEFAULT:Dh.MINI_CHART};function wh({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Lh({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Eh=e=>({miniChart:e===Ch.OPTIONS.MINI_CHART.value,bar:e===Ch.OPTIONS.BAR.value,none:e===Ch.OPTIONS.NONE.value});function Th({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Eh(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Eh(Ch.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Eh(!n&&(r||!r&&i)?Ch.OPTIONS.NONE.value:Ch.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Ch.OPTIONS.MINI_CHART.value,n.bar=t.value===Ch.OPTIONS.BAR.value,n.none=t.value===Ch.OPTIONS.NONE.value),n}function kh({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Th({layoutService:e,override:l});if(d.none)return!1;const{orientation:f}=t.meta.major,m={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===f?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:f,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Lh({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(m.settings.style="slim",m.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(m.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(m.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(m.settings.injections=()=>[wh({layoutService:e,discrete:n})]),m}function Nh({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),f="horizontal"===o.meta.major.orientation,m=f?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=f?d.rect.computedInner.width:d.rect.computedInner.height,h=f&&a?p-m:m,g=Math.max(0,Math.min(h/p,1)),[y,v]=Lh({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,q=!b&&!x;return{pixel:h,relative:g,thumb:q?h-y*p:0,beforeThumb:b,afterThumb:x,onThumb:q}}}function Ah({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,f]=Lh({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(f-d)*c}}}function Oh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}function Ih({e:e}){return(e.srcEvent||e).srcElement.getAttribute("data-scrollbar-handle")||""}const Ph="scrollbarResize";function Rh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:"event:scrollbarResize",options:{event:Ph,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[Ph]=this[Ph]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&Ih({e:t})&&(this[Ph].panningEvent=t.srcEvent),!!this[Ph].panningEvent))}},events:{scrollbarResizestart(n){n.preventDefault(),this[Ph]=this[Ph]||{},this[Ph].panningEvent&&t.component(e).emit("dragStart",this[Ph].panningEvent)},scrollbarResizemove(n){if(n.preventDefault(),this[Ph]=this[Ph]||{},!this[Ph].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=Ih({e:this[Ph].panningEvent});let f="start"===d?Math.min(c,o.max):o.min,m="end"===d?Math.max(c,o.min):o.max;f===m&&(f-="start"===d?u:0,m+="end"===d?u:0),r.set("zoom",{min:f,max:m}),t.component(e).emit("render")},scrollbarResizeend(n){n.preventDefault(),this[Ph]=this[Ph]||{},delete this[Ph].panningEvent,t.component(e).emit("dragEnd")},scrollbarResizecancel(n){n.preventDefault(),this[Ph]=this[Ph]||{},delete this[Ph].panningEvent,t.component(e).emit("dragEnd")}}}}const Fh="scrollbarPan";function jh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Nh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:"event:scrollbarPan",options:{event:Fh,threshold:0,enable(r,i){return this[Fh]=this[Fh]||{},!(i&&!this[Fh].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{scrollbarPanstart(n){n.preventDefault();const a=u(n);if(this[Fh]=this[Fh]||{},this[Fh].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[Fh].relative=a.relative,this[Fh].zoom=r.get("zoom"),this[Fh].zoom.span=this[Fh].zoom.max-this[Fh].zoom.min,this[Fh].zoom.fullSpan=o-n}else if(a.onThumb)this[Fh].offset=a.thumb;else{const e=c();this[Fh].offset=a.beforeThumb?0:e.thumbSize}},scrollbarPanmove(n){n.preventDefault();const a=u(n);if(this[Fh]=this[Fh]||{},o.meta.isContinuous){const e=a.relative-this[Fh].relative,{fullSpan:t,span:n,min:o,max:s}=this[Fh].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[Fh].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},scrollbarPanend(n){n.preventDefault(),this[Fh]=this[Fh]||{},this[Fh].isPanning=!1,t.component(e).emit("unlockState")},scrollbarPancancel(n){n.preventDefault(),this[Fh]=this[Fh]||{},this[Fh].isPanning=!1,t.component(e).emit("unlockState")}}}}function Hh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Oh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),Rh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),jh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function zh({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function Bh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...Hh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:zh({componentKey:e,chart:t,actions:n,layoutService:o})}}const _h={background:"rgba(0, 0, 0, 0.1)"},Vh={top:-1,bottom:-1,width:6},Uh={width:2,background:"#595959"};var Wh={before:_h,after:_h,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Vh,endHandle:Vh,startHandleBorder:Uh,endHandleBorder:Uh};const $h={background:"rgba(0, 0, 0, 0.1)"},Kh={top:-1,bottom:-1,width:6},Gh={width:2,background:"#595959"};var Yh={before:$h,after:$h,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Kh,endHandle:Kh,startHandleBorder:Gh,endHandleBorder:Gh};const Jh={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Xh={pointerEvents:"initial"},Zh={pointerEvents:"none"};const Qh="ew-resize",eg="default";function tg(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function ng(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Qh:eg}function rg(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function ig(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function og(){const{size:e,start:t,end:n}=tg.call(this);this.renderer.render(this.elements(this.h,rg.call(this,e,t,n)))}function ag(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?Yh:Wh;return{container:{...Jh},before:{...Jh,...n.before,...t.before},after:{...Jh,...n.after,...t.after},thumb:{...Jh,...n.thumb,...t.thumb},startHandle:{...Jh,...Xh,...n.startHandle},endHandle:{...Jh,...Xh,...n.endHandle},startHandleBorder:{...Jh,...Zh,...n.startHandleBorder},endHandleBorder:{...Jh,...Zh,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var sg={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){og.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!ig.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Ih({e:e});t&&(this.state.hover[t]=!0),ng.call(this),og.call(this)},leave(){this.state.locked||(this.state.hover.reset(),ng.call(this),og.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Ih({e:e});t&&(this.state.drag[t]=!0),ng.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),ng.call(this),og.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=tg.call(this);return this.elements(e,rg.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},f={[i.start]:r},m={left:-3},p={left:1},h={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?f:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:f},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:m},class:"scrollbar--start-handle","data-scrollbar-handle":"start"},o?e("div",{style:{...s.startHandleBorder,...u?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?m:h},class:"scrollbar--end-handle","data-scrollbar-handle":"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:ag.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};const lg={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function ug({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=G({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const f=o?n:t,m=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:f}),p=(c-m)/2,h=p+d.major+m/2;return{item:d,boxCenter:h,boxWidth:m,boxPadding:p,rendWidth:t,rendHeight:n}}function cg({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=G(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const f=i.minor||{};let m;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{start:{scale:f.scale,ref:"start"},end:{scale:f.scale,ref:"end"},min:{scale:f.scale,ref:"min"},max:{scale:f.scale,ref:"max"},med:{scale:f.scale,ref:"med"}},f)})};for(let n=0,r=e.length;n<r;n++)m=e[n],p[m]=s.resolve({data:t,defaults:l[m],settings:i[m],scaled:u});return p}const dg=["oob"];const fg={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=cg({keys:dg,data:i,defaultSettings:{oob:lg.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l;return function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=ug}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:f,rendWidth:m,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,g=[];if(d.oob.show){g.push(lg.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:m,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:g};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:dg,symbol:s,dockValue:n})}},mg={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},pg=["hat"];function hg(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function gg({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let f=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const m=G({},e.hat,{type:"path",d:hg(f)});f=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[m,G({},e.hat,{type:"path",d:hg(f)})]}const yg={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=cg({keys:pg,data:r,defaultSettings:mg,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a;return function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=ug}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...gg({item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(g)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:pg})}};function vg(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:vg(i,t,n)},i}function bg(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),vg(i,a,l,e.invert)}))}const xg={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function qg(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const Mg={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function Sg(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var f;if(a=e.session.options||(null===(f=e.enigmaModel)||void 0===f?void 0:f.session.sessionConfig),!a){var m;a=null===(m=e.session)||void 0===m?void 0:m.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?":"+a.port:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c+="/"),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await Mg.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function Dg(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,f=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!f)return[];const[m]=f,p=m.size||"small",h=m.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===m.cId){g=e;break}const y=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==g&&y[g]&&(v=y[g]),"media"===h&&null!==(l=m.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return Sg(m,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&qg(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:n,width:i,imageError:s}=await Mg.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await Mg.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,m,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(qg(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:r,width:o,imageError:a}=await Mg.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],p,v)}return[]}const Cg={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(Dg(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},wg={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Cg.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Cg.checkIfPromisesExist({customTooltipModel:e})};const Lg=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:xg.CHART.CHART_PARENT_TYPE,qId:xg.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},Eg=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:xg.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const Tg={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=xg.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:xg.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Tg.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=xg.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=xg.CHART.STATE,a=Lg(t,o),s=await e.createSessionObject(a),l=Eg(t);if(s.id!==xg.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,f,m,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(f=n[0].data)||void 0===f?void 0:f.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,g;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var y;const t=null==e||null===(y=e.source)||void 0===y?void 0:y.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(xg.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(m=u.miniChartToken.model)||void 0===m?void 0:m.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await Tg.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(Tg.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(xg.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=xg.CHART.STATE;await e.removeSessionAlternateState(r),n.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function kg(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Ng(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=xg.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Ag(e){const t=Ng();return e.filter((e=>t[e.id]))}const Og={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Og.getAttrExprData(a);o.length||n.length?wg.handlePromises({customTooltipModel:i,nodes:Og.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&Tg.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>wg.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[xg.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[xg.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[xg.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(Ag(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[xg.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[xg.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=kg(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Ag(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=kg(e)||[];[...i,t].forEach((e=>{const t=Ag(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Ng(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Me.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Me.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function Ig(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case xg.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case xg.CUSTOM.TITLE:case xg.CUSTOM.DESCRIPTION:case xg.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const Pg={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>Ig(t,e,r,n)}}};const Rg={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[xg.CUSTOM.TITLE]:!0,[xg.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Og.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===xg.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===xg.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>Se.getMeasure(e,t))),e,o)}};function Fg({nodes:e,layout:t,dataset:n}){return function(e,t,n){const r=[];return e.forEach((e=>{r.push(Rg.getCustomAttrExps(n,e,t))})),r}(e,t,n).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function jg(e){const t=xg.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function Hg(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}var zg={attrExpr:{migrateProperties(e){var t,n,r,i;const o=G(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=Hg(o);return s=function(e,t){return t.concat(e.map((e=>jg(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1;return function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=jg(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Hg(e),o,a)},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}))}}},Bg=7005;const _g=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg},Vg=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&ae(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Ug=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ae(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ae(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Wg=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},$g=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then((e=>e.getLayout())).then((t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Ug(e,n)}return r})):t.getField(r.qDef.qFieldDefs[0]).then((t=>t.getCardinal().then((t=>(Ug(e,t),r)))),(()=>r))}return Vg(e),Promise.resolve()};function Kg(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?cu(e,"color.persistent",!0):"byDimension"===r&&n.length>1?cu(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?cu(e,"color.mode","primary"):0===t.length&&n.length>0&&(cu(e,"color.byMeasureDef",void 0),cu(e,"color.byDimDef",void 0),1===n.length&&cu(e,"color.mode","primary"))}const Gg=(e,t)=>{Kg(t),Dt(e),Og.addCallbackCustomTooltip(t)},Yg=e=>{Kg(e)};function Jg({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=null!=i&&i.layout?i.layout.qHyperCube.qDimensionInfo.filter((e=>_g(e))).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),null!=n&&n.app?$g(t,n.app).then((()=>(Gg(e,t),e))):(Wg(t),Gg(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter((e=>_g(e))).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Vg(t),Kg(t),Og.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Kg(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),Og.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Og.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>null!=n&&n.app?$g(t,n.app).then((()=>(e.qSortBy.qSortByNumeric=-1,Yg(t),e))):(Wg(t),Yg(t),e),move(e,t){Vg(t),Kg(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Kg(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Xg(e){return{properties:{version:"1.31.3",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[{path:"/qHyperCubeDef",...Jg(e)}]}}}var Zg={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function Qg({env:e}){var t,n;const{flags:r}=e,i=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.isUnsupportedFeature,o=g();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Zg).forEach((t=>{e.add(Zg[t])}))}}(e.translator);const a=y(),s=v(),[l,u]=b(),c=x(),d=q(),{qLocaleInfo:f}=d;return M((()=>{u({translator:o,theme:s,embed:a,deviceType:c,localeInfo:f,isUnsupportedFeature:i,flags:r})}),[f,i,o.language(),s.name(),c]),l}function ey(){const[e]=b((()=>du())),[t]=b((()=>function(e){var t=Ma({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0})));return{viewCache:e,viewState:t}}const ty=()=>{},ny=2,ry=20,iy=200;var oy={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-10<=t.qTop,i=n.qLeft+n.qWidth+10>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+10>=t.qTop+t.qHeight,a=n.qLeft-10<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var ay={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-10<=t.qTop,i=n.qTop+n.qHeight+10>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var sy={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const ly="pages";function uy({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:"discretePan",pointers:1,threshold:10,enable(r,i){return"discretePan"===this.started||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{discretePanstart(e){e.preventDefault(),this.started="discretePan";const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},discretePanmove(e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},discretePanend(e){e.preventDefault(),this.started=!1},discretePancancel(e){e.preventDefault(),this.started=!1}}}}function cy({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function dy({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(iy,n));return{width:e,height:Math.max(ry,Math.min(n*ny,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function fy(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject("REJECTED"),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject("REJECTED"),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject("REJECTED"),n=null)},i}const my={command:{update:()=>{}}};function py({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=my,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:dy({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:fy(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=pu(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if("REJECTED"!==e)throw e}))}),50);return function(e,{onProcessing:t=ty,onDataPage:n=ty}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var hy={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var gy={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function yy(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function vy(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function by(e){return vy(e.qMatrix,(e=>e[0].qElemNumber))-1}var xy={inTotal:function({layoutService:e}){const t=yy(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=yy(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=yy(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=by(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const qy=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function My(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return qy(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:qy(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return qy(e,n);return vy(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var Sy={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=My(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=My(t).area(e(),l,a.qArea),d=by(a),f=a.qArea.qHeight+d,m=u===o?(r.inView-f)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[m,r.inView>=r.inTotal?m+1:m+f/r.inView]}};function Dy({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:m}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=f;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);case"auto":default:return u?v/m:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return f>o;const m=(90-d)*(Math.PI/180);return f>Math.cos(m)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function Cy({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:f}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?hy:n?r?xy:Sy:gy}({layoutService:r}),m=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?m()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:Dy({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/m()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,o+e/i]}({viewSize:m(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=f({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:m(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function wy({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:f,rtl:m}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=Cy({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:m}),h=()=>{const e=p.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},y=e=>{const t=Date.now(),r=h(),a=g({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=g({pixelOffset:u,items:a});f.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),f.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;y(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(r)}}}function Ly({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:f,renderer:m,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const g=du(),y=function({qMode:e}){switch(e){case"S":default:return oy;case"K":return ay;case"T":return sy}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(ly,[]),{add:t=>{const n=e.get(ly);n.length=0,n.push(t)},getCurrent:()=>e.get(ly)[0],getAll:()=>e.get(ly),contains:n=>t(e.get(ly)[0],n)}}({state:g,contains:y.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:y});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=py({dataStore:v,composition:y,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),q=wy({chart:e,componentKey:n,state:g,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:m,areaBuffer:b,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(n){const r=uu(n,""+e.refs.dataPages);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v});return{interactions:function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[uy({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:cy({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:q}),query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var Ey="AVERAGE",Ty="LINEAR",ky="POLYNOMIAL2",Ny="POLYNOMIAL3",Ay="POLYNOMIAL4",Oy="EXPONENTIAL",Iy="LOG",Py="POWER";function Ry({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){default:case ky:return o;case Ny:return o.y+=i[3]*t**3,o;case Ay:return o.y+=i[4]*t**4+i[3]*t**3,o}}var Fy={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Ry,polynomial3:Ry,polynomial4:Ry,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function jy(e,t){const n=Fy[t.qType.toLowerCase()],r=Math.max(1,e/500);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}function Hy(e){return Fy[e.qType.toLowerCase()]}function zy(e,t){return e.meta.isContinuous?function(e,t){return{generate:(e,n,r)=>{const i=[],o=Hy(e),{min:a,max:s}=t.get("zoom"),l=(s-a)/100;if(l>0){const t=t=>{const a=o({dimValue:t,value:t,qTrendLine:e});a.layerId=n,a.measureIndex=r,a.dimValue=t,i.push(a)};let u=a;for(let e=a;e<=s;e+=l)t(e),u=e;u!==s&&t(s)}return i},calculate:(e,t)=>Hy(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map((({y:e})=>e));return{min:Math.min(...n),max:Math.max(...n)}}}}(0,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],u=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=r,u.dimValue=o.qText,i.push(u)}return i},findMinMax:jy}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,c=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},calculate:(e,t,n)=>(0,Fy[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:jy}}(e)}var By={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},_y={color:"#f93f17",index:9};const{isDark:Vy}=St,Uy={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Wy=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=(()=>!1)})=>{const{translator:s}=i,l=[Uy],u=[],c=[],d=zy(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach(((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map((()=>t))))}));return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:fu((e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=r.scale(o)(t);return Vy(n)?function(e){const t=ht(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=ht(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(_y)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"})),getLineDash:e=>{const{style:t}=u[e]||{};return t.lineDash},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(By.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach((r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)})),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=u[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,u.forEach(((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)}))}}}};var $y={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Ky=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Gy=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];return[(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=Ky(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:$y,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:2,stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:uf.nonUpdatingNode.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=Ky(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:$y,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r})]};function Yy(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Jy(e,{h:t,style:n}){return e.map((e=>{const r={style:{direction:"string"==typeof e.content?Me.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map((t=>e("span",{style:t.style,direction:Me.detectTextDirection(t.content)},t.content)))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",r,i)}))}function Xy(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter((e=>e.title===o)),s=[function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:Me.detectTextDirection(t)},t);return e("tr",{},n)}(n,o)];if(a.slice(0,2).forEach((e=>{s.push(n("tr",{},Jy(e.row,{h:n,style:i})))})),r.length>2){const i=r.length-2;s.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=Me.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return s}}function Zy(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=ve({key:e.tooltip,rtl:i});return G(!0,o,{settings:{extract:Yy(e,t),content:Xy(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function Qy(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function ev(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Qy(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=Qy(r,t),u=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(u.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),c=(null!=s&&s.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);u.forEach((e=>{e.data.dimValue.value=r,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,r).y}))}return u}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some((t=>t.key===e.tooltipOverlay)))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const tv=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},nv=e=>{tv(e),e.qMultiDimMode="Sum",e.qXColIx=0};function rv(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!de.dimensionless(n)&&!de.groupedByDimension(n)&&(r||!de.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:By.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(By.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:By.ADD_BUTTON,add:nv,globalChange:e=>{const t=uu(e,"qHyperCubeDef.qMeasures",[]).reduce(((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e)),[]),r=(e=>!uu(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach((e=>{e.qContinuousXAxis=r})),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:By.TYPE,options:[{value:Ey,translation:By.TYPES.AVERAGE},{value:Ty,translation:By.TYPES.LINEAR},{value:ky,translation:By.TYPES.POLYNOMIAL2},{value:Ny,translation:By.TYPES.POLYNOMIAL3},{value:Ay,translation:By.TYPES.POLYNOMIAL4},{value:Oy,translation:By.TYPES.EXPONENTIAL},{value:Iy,translation:By.TYPES.LOG},{value:Py,translation:By.TYPES.POWER}],defaultValue:Ey},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:_y,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:By.STYLE.DASHED,type:"boolean",defaultValue:!0,change:tv}}}}var iv={};function ov(){ov.init.call(this)}iv.isObject=function(e){return"object"==typeof e&&null!==e},iv.isNumber=function(e){return"number"==typeof e},iv.isUndefined=function(e){return void 0===e},iv.isFunction=function(e){return"function"==typeof e};var av=ov;ov.EventEmitter=ov,ov.prototype._events=void 0,ov.prototype._maxListeners=void 0,ov.defaultMaxListeners=10,ov.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},ov.prototype.setMaxListeners=function(e){if(!iv.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},ov.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],iv.isUndefined(n))return!1;if(iv.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(iv.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},ov.prototype.addListener=function(e,t){var n;if(!iv.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,iv.isFunction(t.listener)?t.listener:t),this._events[e]?iv.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,iv.isObject(this._events[e])&&!this._events[e].warned)&&((n=iv.isUndefined(this._maxListeners)?ov.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,iv.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),iv.isFunction(console.trace)&&console.trace()));return this},ov.prototype.on=ov.prototype.addListener,ov.prototype.once=function(e,t){if(!iv.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},ov.prototype.removeListener=function(e,t){var n,r,i,o;if(!iv.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||iv.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(iv.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},ov.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],iv.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},ov.prototype.listeners=function(e){return this._events&&this._events[e]?iv.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},ov.listenerCount=function(e,t){return e._events&&e._events[t]?iv.isFunction(e._events[t])?1:e._events[t].length:0};const sv={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function lv(){const[e]=b({}),[t]=b({}),n=function(){var e,t,n,r;const i=C(),o=g(),a=!(null==i||null===(e=i.qSelectionInfo)||void 0===e||!e.qInSelections),s=!(null==i||null===(t=i.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qIsOneAndOnlyOne),[l,u]=b(!1),[c,d]=b(!1),[f,m]=b({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),p=e=>{d("boolean"==typeof e?e:!c)};return w((()=>(m({key:"lasso",action:p,enabled:()=>l,active:()=>c}),{key:"lasso",label:o.get(c?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:sv,hidden:!l||!a||s,active:c,action:p})),[a,s,c,l,o.language()]),{get:()=>f,setAllows:e=>{u(!!e)}}}(),[r,i]=b();return M((()=>{const r={};r.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:r}=e;return t.allowScroll&&((null==n?void 0:n.meta.isContinuous)||(null==r?void 0:r.query.getCanScroll()))}},r.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},r.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},r.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},r.lasso=n.get(),Object.keys(r).forEach((e=>{return t=r[e],Object.keys(av.prototype).forEach((e=>{t[e]=av.prototype[e]})),av.init(t),t;var t})),i(r)}),[]),M((()=>{r&&n&&(r.lasso={...r.lasso,...n.get()})}),[n]),{get:()=>r,setAllows:e=>{Object.assign(t,e),n.setAllows(null==e?void 0:e.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(r).forEach((e=>r[e].removeAllListeners()))}}}var uv={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},cv={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",MAJOR_NUM:"majorNum",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",STACK:"stack",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"},STYLING:{AXIS:"axis"}};function dv({layout:e}){const t=ie.canBeContinuous(e),n=de.continuous(e),r=de.dimensionless(e);return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:ie.isTime(n,e),isDimensionless:r,isSimple:de.simple(e),isGrouped:de.grouped(e),isGroupedByMeasure:de.groupedByMeasure(e),isGroupedByDimension:de.groupedByDimension(e),isStacked:de.stacked(e),isStackedByDimension:de.stackedByDimension(e),isStackedByMeasure:de.stackedByMeasure(e),isSnapshot:de.snapshot(e)}}const fv={extractDimsAndNode(e){const t=[];let n;return e.forEach((e=>{if(e.key===cv.COMPONENT.BAR){n=e;const r=uu(e,"data.selectionDimension",!1);r&&(t.push(r.label),r.label!==e.data.label&&t.push(e.data.label))}})),{nodeDims:t,node:n}}};function mv(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(me).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize")}}}))}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function pv({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=mv(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var r;u.should(e)&&u(e),c.mode=G(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map(((e,t)=>"qMeasureInfo/"+t)):n.fields.minor},c.scales={major:cv.SCALE.REDUCED.MAJOR,minor:cv.SCALE.REDUCED.MINOR},c.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=G(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then((e=>e))},setSnapshotData(e){e.reducedHyperCube=c.cube}}}function hv({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}function gv({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function yv({picasso:e,chart:t,environment:n,viewState:r,viewCache:i}){const o=L(),a=E(),s=T(),l=k(),u=N(),c=D(),[d,f]=b(),[m,p]=b(),[h,g]=b(),y=A(),v=lv();return M((()=>{if(!t)return()=>{};const e=v.get(),n=function({chart:e,actions:t,selections:n}){const r=e.scale(cv.SCALE.MAIN.MAJOR);return Vd({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{clear:hv},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}({chart:t,actions:e,selections:u});return p(e),g(n),()=>{n.destroy(),v.destroy()}}),[t]),M((()=>{if(!y)return;const e={allowScroll:!y.active,allowInteract:!y.active,allowTooltip:!y.passive,allowSelect:!y.select&&!y.active};v.setAllows(e)}),[y]),M((()=>{if(!h||!n)return;const{theme:u,translator:d,localeInfo:p,flags:g,embed:y}=n,{direction:b="ltr"}=c,x=bu({source:o,metaAdditionsFn:dv,experimental:{filter:g.isEnabled("IM_1579_HIDE_DIM_MEA")}});h.setFilteredFields(x.meta.filteredFields);const q=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(x.getLayout())?bu({source:x.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:o,options:c}),S=function({layoutService:e,viewCache:t,flags:n,options:r}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map(((e,t)=>"qDimensionInfo/"+t)),minor:e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>"qMeasureInfo/"+t))};return n.majorNumeric=(t.isStackedByDimension?n.majorStack:n.major)+":numeric",n}(e),i.selectionDimensionIdx=(e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}})(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==r.chartAnimations&&!!n.isEnabled("IM_1355_ANIMATIONS_BAR")&&!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!uf.propertiesHaveChanged({viewCache:t,layout:e.getLayout()}),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:x,viewCache:i,flags:g,options:c}),D=lu({chart:t,layoutService:x,config:{logicalSize:M,rtl:"rtl"===b},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),C=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:Jd(a),styles:void 0};return d.styles=Zd({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=Zd({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:u,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]]}}),w=function({layoutService:e,themeService:t,flags:n}){const r=t.getStyles(),i=t=>n.isEnabled("CLIENT_IM_747")?(e.getLayoutValue("components",[])||[]).find((e=>e.key===t)):void 0;return{axis:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fontFamily:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.axis.title.fontFamily,fontSize:null!==(a=null===(s=i("axis"))||void 0===s||null===(l=s.axis)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.axis.title.fontSize,color:null!==(c=null===(d=i("axis"))||void 0===d||null===(f=d.axis)||void 0===f||null===(m=f.title)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p,h,g,y;return{fill:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.label)||void 0===o||null===(a=o.name)||void 0===a||null===(s=a.color)||void 0===s?void 0:s.color)&&void 0!==e?e:r.axis.label.name.color,fontSize:null!==(l=null===(u=i("axis"))||void 0===u||null===(c=u.axis)||void 0===c||null===(d=c.label)||void 0===d||null===(f=d.name)||void 0===f?void 0:f.fontSize)&&void 0!==l?l:r.axis.label.name.fontSize,fontFamily:null!==(m=null===(p=i("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.name)||void 0===y?void 0:y.fontFamily)&&void 0!==m?m:r.axis.label.name.fontFamily}}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fill:null!==(e=null===(t=i("label"))||void 0===t||null===(n=t.label)||void 0===n||null===(o=n.value)||void 0===o||null===(a=o.color)||void 0===a?void 0:a.color)&&void 0!==e?e:r.label.value.color,fontSize:null!==(s=null===(l=i("label"))||void 0===l||null===(u=l.label)||void 0===u||null===(c=u.value)||void 0===c?void 0:c.fontSize)&&void 0!==s?s:r.label.value.fontSize,fontFamily:null!==(d=null===(f=i("label"))||void 0===f||null===(m=f.label)||void 0===m||null===(p=m.value)||void 0===p?void 0:p.fontFamily)&&void 0!==d?d:r.label.value.fontFamily}}}}}({layoutService:x,themeService:C,flags:g}),L=Sh.model({model:a,layoutService:x,viewCache:i,viewState:r}),E=pv({enigma:a,layoutService:x,viewModel:S});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:x,viewState:r,viewStateOptions:null==c?void 0:c.viewState});const T=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,f={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const m=[],{isReduced:p}=u.model().mode,h=c||p||d,g=!c&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return f.main=Zl({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:gv,key:cv.SCALE.MAIN.COLOR},createConfig:()=>({hc:h?g||s.getHyperCube():u.model().cube,source:h?y:"miniCube",theme:o})}),m.push(f.main.initialize()),c&&(f.mini=Zl({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:gv,key:cv.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),m.push(f.mini.initialize())),Promise.all(m)},getMain:()=>f.main,getMini:()=>f.mini}}({picasso:e,model:a,app:s,translator:d,localeInfo:p,theme:u,continuousDataModel:L,layoutService:x,legendLayoutService:q,reducedDataModel:E}),k=Wy({layoutService:x,viewState:r,colorModel:{settings:()=>T.getMain().getSettings(),resolveUIColor:e=>T.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:cv.SCALE.MAIN.COLOR},isEnabled:()=>!x.meta.isGroupedByDimension&&(!x.meta.isStackedByDimension||g.isEnabled("TRENDLINES_STACKED_DIM"))&&!x.meta.isDimensionless});zg.attrExpr.updateProperties(a,o);const N=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Og,miniChartToken:{},embed:s}}({layout:o,app:s,model:a,picasso:e,chart:t,translator:d,localeInfo:p,embed:y,extractDimsAndNode:fv.extractDimsAndNode});let A;x.meta.isDiscrete&&(A=Ly({chart:t,actions:m,componentKey:cv.COMPONENT.BAR,enigmaModel:a,layoutService:x,dockService:D,trendLineModel:k,itemWidths:uv,viewState:r,rtl:"rtl"===b,options:{axisKey:cv.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const O=yf({layoutService:x,discreteModel:A}),I=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:cv.SCALE.MAIN.MINOR,MAJOR:cv.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:cv.COMPONENT.BAR,BAR_AXIS:cv.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:cv.COLLECTION.MAIN}}}}(x),P=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return wa(Sa().mark((function e(){var r,a,s,l;return Sa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=wa(Sa().mark((function e(n){var r;return Sa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(Ma({},i));case 4:if("object"===Da(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(Ma({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,ka(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Ta(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=Ba(!0,{},n.brush);Ba(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Da(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=xu({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=xu({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:l||[],pluginArgs:I});v.setContext({discrete:A,layoutService:x}),f({discrete:A,continuous:Sh,legendLayoutService:q,layoutService:x,viewModel:S,dockService:D,themeService:C,styleService:w,continuousDataModel:L,reducedDataModel:E,colorService:T,trendLineModel:k,refLineModel:O,pluginService:P,customTooltipModel:N,selectionService:h,logicalSize:M})}),[h,c,n,o]),d}function vv(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function bv(e){return e.some(vv)}function xv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{bv(e)||e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))}))})),{min:n,max:r}}function qv(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function Mv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{if(!bv(e)){let i=0,o=0;e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)})),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}})),{min:n,max:r}}function Sv(e,t){const n={};e.forEach((e=>{if(!bv(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)}))}}));let r=NaN,i=NaN;return Object.keys(n).forEach((e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)})),{min:r,max:i}}function Dv(e){return"number"==typeof e&&!Number.isNaN(e)}function Cv(e){const t=e.getHyperCubeValue("qMeasureInfo");return{min:Math.min(...t.filter((e=>Dv(e.qMin))).map((e=>e.qMin))),max:Math.max(...t.filter((e=>Dv(e.qMax))).map((e=>e.qMax)))}}function wv(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function Lv(e){return!Number.isNaN(+e.qNum)}function Ev(e){return e.qNum}function Tv(e){return!Number.isNaN(+e.qNum)}function kv(e){return e.qNum}function Nv(e,t){return e.push(...t),e}const{getValueWithOffset:Av,isNumber:Ov}=Ro;function Iv(e,t){return Math.abs(e/t)<5||0===t}function Pv({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=Mv,stackedByDimensionExtractor:i=Sv,straightExtractor:o=xv,measureInfoExtractor:a=Cv,explicitExtractor:s=qv}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),u=this.extractExplicit(),c=[0,o,a].filter((e=>Ov(e)));let d=Math.min(...c),f=Math.max(...c);d=Iv(s,d)?Math.min(d,s):d,f=Iv(l,f)?Math.max(f,l):f;const m=[u.explicitMin,u.explicitMax,d,f].filter((e=>Ov(e)));return o=Number.isNaN(u.explicitMin)?Math.min(...m):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...m):u.explicitMax,o===a&&(Number.isNaN(u.explicitMin)?o=Av(o,-.2):Number.isNaN(u.explicitMax)&&(a=Av(a,.2))),{min:o,max:a,implicitMin:d,implicitMax:f,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.map((e=>e.qMinNeg))),max:Math.max(...n[0].qSubNodes.map((e=>e.qMaxPos)))}:{min:0,max:0};var n},extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=wv(uu(e,"0.qData.0.qSubNodes",[]),vv,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=uu(e,"0.qMatrix",[]).filter(bv).reduce(Nv,[]).filter(Tv).map(kv);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=wv(uu(e,"0.qMatrix",[]),bv,[]).filter(Lv).map(Ev);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Rv(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then((t=>({qDataPages:t,count:e})))}const u=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then((e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}}))}}}(e),n=Pv(e);return t.resolve().then((e=>n.extract(e)))}const Fv=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:"event:"+e,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:"lasso",enable(e,n){if("lasso"===this.started||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),"lasso"!==this.started&&(i.actions.select.emit("start","lasso"),this.chart.component(e).emit("lassoStart",t),this.started="lasso")},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end","lasso"),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const jv=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),f=this.chart.component("tooltip"),m="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else m&&f.emit("hide")}}}};const Hv=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const zv=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:"event:"+t,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key)));return 0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(t+"-"))}(i,t)?(this.started=e,!0):a.length>0}},events:{[e+"start"](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(a+"Start",n),this.started=e},[e+"move"](e){e.preventDefault(),this.chart.component(t).emit(a+"Move",e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[e+"end"](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(a+"End",n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function Bv(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>"@"+e)).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=zv(e,t,"range");return{interactions:[e.onEdited?Hv(e,t):null,r].filter(Boolean),components:[n]}}const _v={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}};const Vv={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){var t;const n=null==e||null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal,{qLocked:r=0,qOption:i=0,qSelected:o=0}=(null==e?void 0:e.qStateCounts)||{};return[void 0,0].includes(n)?r+i+o:n}},Uv={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=Vv.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach((e=>{n=Math.max(n,e.qFallbackTitle.length)}));return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?uu(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Uv.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=Uv.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return ge.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Uv.getAxisData(e),n=Vv.getMaxGlyphCount(e,0);return ge.getAdjustedMaxGlyphCount(n,t,0)}};var Wv=3,$v=13;function Kv(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,f=_v[t.dockService.meta.major.orientation+"DimensionAxis"].minimumLayoutMode,m={type:"grid-line",x:{},layout:{minimumLayoutMode:_v.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.lines.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isTime:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isTime:!0})}};c.push(G(!0,{},d,{key:"inner-time-axis",scale:cv.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:G(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),c.push(G(!0,{},d,{key:"outer-time-axis",scale:cv.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:cv.SCALE.MAIN.MAJOR,layout:{dock:"@outer-time-axis",minimumLayoutMode:f}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:cv.SCALE.MAIN.MAJOR_INNER,layout:{dock:"@inner-time-axis",minimumLayoutMode:f}}),c.push(p)}return c.push(G(!0,{},m,{key:"inner-time-grid",x:{scale:cv.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(G(!0,{},m,{key:"outer-time-grid",x:{scale:cv.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,scale:cv.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:cv.SCALE.MAIN.MAJOR,layout:{dock:"@"+e,minimumLayoutMode:f}}),c.push(p)),c.push(G(!0,{},m,{key:"continuous-grid",x:{scale:cv.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,f=t.styleService.axis.label.getStyle(),m={type:"axis",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:_v[t.dockService.meta.major.orientation+"DimensionAxis"].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...f},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(G(!0,{},m,{key:"group-axis",scale:cv.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":m.settings.labels.mode,maxGlyphCount:Uv.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&m.settings.line.show}}}));const p=Uv.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(G(!0,{},m,{key:cv.COMPONENT.BAR_AXIS,scale:cv.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>Wv&&p<$v?1:void 0},line:{show:!(u&&l)&&m.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",formatter:cv.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:_v.measureAxis.minimumLayoutMode},scale:cv.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:uf.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:uf.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var Gv={BAR:{WIDTH:.7,STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function Yv({layoutService:e,discrete:t,componentKey:n}){var r;const{isContinuous:i,isGrouped:o}=e.meta;if(i)return 1;const a=(e.getLayoutValue("components",[])||[]).filter((e=>e.key===n))[0];if(null!=a&&null!==(r=a.style)&&void 0!==r&&r.width){const{style:e}=a;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=Gv.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return o?.9:.7}const Jv={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Xv(e,t,n={}){return({data:r})=>{const i=e.chart.component(t).rect;if(!r.items.length||!i)return 2;const{min:o,max:a}=e.viewState.get("zoom");if(n[[o,a]])return n[[o,a]];const s=Jv[ee.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-o),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=function(e,t,n){return e*(1-n)+t*n}(2,s,1-Math.min(l/u/.2,1));return n[[o,a]]=Math.max(2,Math.min(s,c)),n[[o,a]]}}function Zv(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function Qv(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function eb(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function tb(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const nb="max",rb="min",ib={min:"Min",max:"Max"};function ob(e,t,n){return void 0===n?Zv(e,t)||Qv(e,t):n===nb?Zv(e,t):Qv(e,t)}function ab({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e["hasExplicit"+ib[t]]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===nb?e.implicitMax:e.implicitMin;return!ob(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function sb(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===nb?s.implicitMax:s.implicitMin;if(!ob(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===nb?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===nb?"sumOfPositives":"sumOfNegatives");const f=a.getStyles();return{type:"box-out-of-bounds",key:"bar-oob-"+n,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:pe.getDockValue(c),oob:G({},t.settings.box,{fill:f.outOfRange.color,alignment:1,opacity:1,show:function(e){var t;return!0!==(null===(t=e.datum.null)||void 0===t?void 0:t.value)&&((!r||0!==e.datum[d].value)&&ob(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:uf.barOobs.compensateForLayoutChanges}}}function lb(e){return Math.min(Math.max(0,e),1)}const ub=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!ab({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${cv.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:cv.SCALE.MAIN.MAJOR,fn:d},minor:{scale:cv.SCALE.MAIN.MINOR,start(e){var n,r;return lb(t.scale(cv.SCALE.MAIN.MINOR)((null==e||null===(n=e.datum)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.value)||0))},end(e){const r=t.scale(cv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return lb(r(o))}},box:{width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:r}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(cv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function cb(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.fill!==n.color||e.onBackground?o.fill:function(e){return function(t){return St.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n),s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function db(e){return{placements:e.simplifiedPlacements.map((t=>cb(t,e))),label:e.label}}function fb(e,t){if(t){if(function(e,t){return Zv(e,t)}(e,t))return-1;if(function(e,t){return Qv(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function mb(e,t,n,r){const i=fb(e,r);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function pb(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function hb(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function gb(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function yb({layout:e,component:t,minorScale:n},r,i){if(!pb(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=r,{meta:d}=l,f=s.get("minorMinMax"),m=c.getStyles(),p=r.styleService.label.getStyle();let h;!d.isStacked&&(h=d.isStacked?1:0);const g=0===h?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,q=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>q?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:x,simplifiedPlacements:gb(h,g,y,d.isContinuous),style:m.label.value},S=[db(G(r,M))],D={key:"bar-labels",type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>mb(e.data.end.value,u.meta.minor.orientation,i,f),labels:S,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:uf.labels.linkData}}}]},animations:{enabled:r.viewModel.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(D.beforeRender=()=>{q=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),D}const vb={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let r;return t.isStackedByDimension?r=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(r=n.group?n.group.label:void 0),void 0!==r?`${n.label}, ${r}`:n.label},getMeasure(e,t,n,r,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const o=t.data,a=n.isStacked?r.viewModel.fields.minor[n.isStackedByDimension?0:o.measureIndex.value]:void 0,s=n.isStacked?{source:{key:o.source.key,field:a},label:!0===(null===(l=o.null)||void 0===l?void 0:l.value)?"":n.isStackedByDimension&&i?i(o.segment.value):o.segment.label}:o.end;var l;return Se.getMeasure(e,s)},getMeasures(e,t,n,r,i){const o=e.resources.dataset;return t.map((e=>vb.getMeasure(o,e,n,r,i))).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const r=e.resources.dataset;return Fg({nodes:t,layout:n.layoutService.getLayout(),dataset:r})},extractBarTooltipData(e,t,n,r,i){const o={title:vb.getTitle(t,n),color:Se.getColor(e,t,r),measures:vb.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,r,i)};if(vb.useCustomTooltip(r)){var a,s,l,u;const n=vb.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],r);o.customMeasures=n.customTooltipAttrExpsArr,o.customTitle=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===xg.CUSTOM.TITLE)),o.customDescription=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===xg.CUSTOM.DESCRIPTION));let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach((e=>{var t;(null===(t=e.data.customTooltipImages)||void 0===t?void 0:t.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)})),i.length>0&&(o.customImages=i);const p=r.layoutService.getLayout();var c,d,f,m;if(null!==(a=p.tooltip)&&void 0!==a&&null!==(s=a.chart)&&void 0!==s&&null!==(l=s.object)&&void 0!==l&&l.refId&&r.app&&r.customTooltipModel.embed&&"function"==typeof(null===(u=r.customTooltipModel.model)||void 0===u?void 0:u.getEffectiveProperties))if(null!==(c=(d=r.app).isInModalSelection)&&void 0!==c&&c.call(d)){if((null==p||null===(f=p.qHyperCube)||void 0===f||null===(m=f.qDimensionInfo)||void 0===m?void 0:m.length)>0){Tg.destroyVisualization({customTooltipModel:r.customTooltipModel});const e=r.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");o.customLimitation=e}}else{const t=Tg.createContainer({ctx:e,layout:p});o.customChart=t}}return o},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData:(e,t,n)=>({title:e.data.label,measures:[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter((e=>0!==e)).map((e=>({label:""+vb.getTotalStackTitle(e,t),value:n?n(e):e})))}),extractTooltipData(e,t){const n=t.chart.formatter(cv.FORMATTER.MINOR),{meta:r}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],o=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map((e=>vb.extractStackTotalBarTooltipData(e,t.translator,n))):[];return{barTooltipData:i.map((i=>vb.extractBarTooltipData(e,i,r,t,n))),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:o}},extractBarNodeData(e,t,n,r,i,o,a){let s=!i&&Se.getTitleRow(t,r);const l=Se.hideColorRow(t,n),u=!o&&!l&&Se.getColorRow(e,t,r),c=t.measures.map((i=>!a&&Se.getMeasureRow(i,e,t,r,l&&i.field===n.coloring.field))).filter((e=>!vb.isSameMeasureAndColorRow(e,u,r)));if(vb.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map((n=>Se.getMeasureRow(n,e,t,r,!1))),o=!(!t.customTitle[0]||i)&&Se.getTitleRow(t.customTitle[0],r),a=!(!t.customDescription[0]||i)&&Se.getDescriptionRow(t.customDescription[0],r);s=!vb.shouldIgnoreTitleRowForCtt(o,a,c,n)&&s;const l=[o,a,s,u,...c,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(Og.getFooterRow(t.customLimitation,r)),t.customImages){const n=t.customImages.map((t=>Og.getImageRow(t,e)));l.push(...n)}return l.filter(Boolean)}return[s,u,...c].filter(Boolean)},extractStackTotalBarNodeData:(e,t,n)=>[!!t.measures.length&&Se.getTitleRow(t,n),...t.measures.map((r=>Se.getMeasureRow(r,e,t,n,!1)))].filter(Boolean),useCustomTooltip:e=>uu(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,r)=>!1===n[0]&&0===r.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some((e=>e.field===n.coloring.field)),shouldIgnoreDefaultRows:(e,t)=>vb.useCustomTooltip(t)&&uu(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,r){const{meta:i}=t.layoutService,o=t.layoutService.getLayout(),a=r.length;let s,l,u=[];const c=vb.shouldIgnoreDefaultRows(o,t);for(s=0;s<a;s++){l=r[s];const o=vb.shouldIgnoreTitleRow(i,s),d=c||vb.shouldIgnoreColorRow(i,s),f=c||vb.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(vb.extractBarNodeData(e,l,t,n,o,d,f)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let r=[];return n.some((e=>e.measures.length))&&n.forEach((n=>{r=r.concat(vb.extractStackTotalBarNodeData(e,n,t))})),r},extractData(e,t,n){const{barTooltipData:r,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:o}=vb.extractTooltipData(e,t),a=vb.extractStackTotalBarsData(e,n,o);a.length&&a.push(Se.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=vb.extractBarsData(e,t,n,r),u=a.concat(s),c=i+l;return c&&u.push(Se.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter((e=>{const t=e.bounds;return t.width>0&&t.height>0})),n=t.length?t:e;return vf.combineBounds(n.map((e=>e.bounds)))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:r,data:i,groupProp:o}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,f;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===r&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,f=n===r&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[o]?i[o].value:void 0,d=u(n===r&&void 0!==c?[c,e]:e),f=n===r&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const m=(d+f/2)*a[l],p={width:0,height:0};return"horizontal"===s?(p.x=m,p.y=a.height):(p.y=m,p.x=0),p},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:r,barAxisKey:i,majorScale:o,majorInnerScale:a,groupProp:s}){const l=n.filter((e=>e.children&&e.children.length));let u;return u=l.length?vb.calculateBoundsFromBars(l):vb.calculateBoundsFromScale({opts:e,barKey:r,scale:t[0].key===i?o:a,majorScale:o,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter((e=>e.data&&t.indexOf(e.key)>-1)),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels:(e,t,n,r)=>e.filter((e=>t.some((t=>n(e,t,r))))),findBarsFromGroupLabelsInGroupedByDim(e,t,n){const r=vb.isBarMatchingLabelOnProp;return vb.findBarsMatchingLabels(e,t,r,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter((e=>t.some((t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)))),findBarsFromLabelsInSingleDim(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,r){const i=t.filter((e=>e.key===n)),o=t.filter((e=>e.key!==n)),a=vb.findBarsFromBarLabelsInGroupedByDim(e,i,r),s=vb.findBarsFromGroupLabelsInGroupedByDim(e,o,r);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=vb.isBarMatchingLabel;return vb.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const r=vb.isBarMatchingLabelOnProp;return vb.findBarsMatchingLabels(e,t,r,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>vb.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:r,groupProp:i,stackProp:o}){const{meta:a}=t.layoutService,s=vb.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?vb.findBarsFromLabelsInStackedByDim(s,e,o):a.isStackedByMeasure?vb.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?vb.findBarsFromLabelsInGroupedByDim(s,e,r,i):vb.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:r}=t.layoutService;if(r.isStacked){const i=vb.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return r.isStackedByDimension?vb.findStackTotalBarsFromLabelsInStackedByDim(i,e):vb.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:f}=t.layoutService;if(e.length){let m=vb.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(m=m.filter(d)),vb.isSingleBarMode(f,m))return[m[0]];if(m.length){let f=vb.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,o,a],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});d&&(f=f.filter(d));const p=vb.calculateTotalBounds({opts:t,labels:e,bars:f,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),h=vb.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:r});return[{key:n,bounds:p,childrenNodes:m,data:m.map((e=>e.data)),stackTotalBarNodes:h}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,groupAxisKey:o,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let f=vb.filterNodesOnKeys(e,[i,o]),m=f&&f.length?[f[0]]:[];const p=vb.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(p&&p.length)return p;const{meta:h}=t.layoutService;if(h.isStackedByMeasure){f=vb.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>vb.filterNodesForOob(e,n,a),p=vb.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}if(h.isStackedByDimension){f=vb.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>vb.filterNodesForOob(e,n,a),p=vb.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}const g=vb.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function bb(e,t={},n){let r=[];const i=ve({key:cv.COMPONENT.BASE_TOOLTIP,rtl:n});return G(!0,i,{scale:cv.SCALE.MAIN.COLOR,settings:{filter:e=>vb.filterNodes({nodes:e,opts:t,barKey:cv.COMPONENT.BAR,stackTotalBarKey:cv.COMPONENT.STACK_TOTAL_BAR,barAxisKey:cv.COMPONENT.BAR_AXIS,groupAxisKey:cv.COMPONENT.GROUP_AXIS,barOobMaxKey:cv.COMPONENT.BAR_OOB_MAX,barOobMinKey:cv.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(r=e.node.childrenNodes?e.node.childrenNodes:[e.node],vb.extractData(e,t,n)),placement:"bounds",afterShow:()=>{var e;const{app:i,properties:o,customTooltipModel:a}=t;i&&(null===(e=i.isInModalSelection)||void 0===e||!e.call(i))&&a.useCustomTooltip&&a.embed&&Tg.show({app:i,properties:o,selectedNodes:r,customTooltipModel:a,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const xb={extractData:(e,t)=>[Se.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter((e=>e.data&&e.key===t));return n.length?[n[0]]:[]}};function qb(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const r=ve({key:cv.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return G(!0,r,{scale:cv.SCALE.MAIN.COLOR,settings:{filter:e=>xb.filterNodes(e,cv.COMPONENT.LEGEND_COLOR_CAT),extract:e=>xb.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function Mb(e){return"NaN"===e.qMin&&"NaN"===e.qMax}function Sb({layout:e},t,n){const r=function(e,t){if(e.qHyperCube.qSize.qcx*e.qHyperCube.qSize.qcy==0)return"NoDataExist";if(e.qHyperCube.qMeasureInfo.every(Mb))return"OnlyNanData";let n=!1;if(t.layoutService.meta.isContinuous&&2===e.qHyperCube.qDimensionInfo.length){const t=e.qHyperCube.qDimensionInfo[1];n=Vv.getDimensionSize(t)>ie.maxNumberOfLines}return!!n&&"LimitedData"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:X[e].alignment},settings:{label:i.get("Object.Disclaimer."+e),rtl:o},style:r}}(r,t,{rtl:n},{fontFamily:i})}function Db(e,{fill:t}){return{[cv.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[cv.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const Cb=1,wb=3;function Lb(e){return e.getLayoutValue("gridLine.auto")}function Eb(e){return!Lb(e)&&e.getLayoutValue("gridLine.spacing")===Cb}function Tb(e){return!Lb(e)&&e.getLayoutValue("gridLine.spacing")===wb}const kb=e=>({enabled:e.animations.enabled,trackBy:uf.lines.trackBy,compensateForLayoutChanges:uf.lines.compensateForLayoutChanges}),Nb=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!Lb(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:_v.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!Eb(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:Tb(n),stroke:o.line.minor.color},animations:kb(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=cv.SCALE.MAIN.MINOR,a};function Ab(e,t){const n=[Nb(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:cv.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:cv.SCALE.MAIN.MINOR,lines:a,animations:kb(r)}})(t)),n}const Ob=e=>({type:"Pan",key:"panorama",options:{event:"areaPan",pointers:1,threshold:10,enable(t,n){return"areaPan"===this.started||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===cv.COMPONENT.BAR))}},events:{areaPanstart(t){t.preventDefault(),this.started="areaPan";const n=e.viewState.get("zoom");this.areaPan={min:n.min,max:n.max,size:e.chart.component(cv.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this.areaPan,a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Ib(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=Sh.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:cv.COMPONENT.BAR}),s={last:0,diff:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===cv.COMPONENT.BAR))},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Pb({chart:e},t,n){const r=e.component(cv.COMPONENT.BASE_TOOLTIP);var i;r&&r.show&&(r.emit("hide"),null!=n&&null!==(i=n.customTooltipModel)&&void 0!==i&&i.useCustomTooltip&&t&&t({},r,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const o=e.component(cv.COMPONENT.LEGEND_CAT_TOOLTIP);o&&o.show&&o.emit("hide");const a=e.component(cv.COMPONENT.TREND_LINES_TOOLTIP);a&&a.show&&a.emit("hide")}function Rb(e,t){const{viewCache:n,viewState:r,chart:i,trendLineModel:o,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?Sh.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:s,threshold:50,targetKey:cv.COMPONENT.BAR}):void 0,u=ev({majorInnerScale:cv.SCALE.MAIN.MAJOR_INNER,tooltip:cv.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:cv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:r,trendLineModel:o,layoutService:a,rtl:s}),c=[cv.COMPONENT.BAR,cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS,cv.COMPONENT.BAR_OOB_MAX,cv.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,f=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter((e=>e.key===cv.COMPONENT.BAR)),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT)),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault(),Pb(e,f,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),r=this.chart.component(cv.COMPONENT.BASE_TOOLTIP);if(r&&r.show)if(n.some((e=>c.indexOf(e.key)>-1))){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);f(t,r,{nodes:i,opts:e,customTooltipModel:n})}else r.emit("show",t)}else r.emit("hide");const i=this.chart.component(cv.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT))?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&Pb(this,f,e)},mouseleave(){Pb(this,f,e)}}}}const Fb=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Bh({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Ob(e,t.rtl),Ib(e,t)]]});function jb(e,t){const{actions:n}=e;if(!n.interact.enabled())return[];const r=[Fb(e,t),Rb(e,t),Bh({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&r.push(e.discrete.interactions.native),r}const Hb=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges});const zb=(e,t,{collectionKey:n})=>{if(!Th({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:r,viewModel:i},{collectionKey:o}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:o},settings:{box:G(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:G(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Hb(i)}}(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Hb(t.viewModel)}},{measureText:Bb}=e.renderer("svg")();function _b(e,t,n){return{reducedMinor:function(e){const t=G(!0,{},e);return delete t.data,t}(t.minor),reducedMajor:function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map(((e,t)=>({field:e,value:t}))):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=G(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=G(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n)}}const Vb=50,Ub=100,Wb=200;function $b(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Vb;case 1:return Ub;case 2:return Wb;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function Kb(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function Gb(e,t,n){return 0===t||0===e||t===n.length-1}function Yb(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function Jb(e,t,n,r,i){e.domain([t,n]),e.nice(10);const[o,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}(s),c=u?Gb:Kb;s=s.filter(c),l&&!u&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(cv.FORMATTER.MINOR):void 0;return Yb(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function Xb(e,t,n,r,i,o,a,s){const l=o.formatter(cv.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Bb({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[f,m]=e.domain(),p=e.ticks(r);function h(){const e=p.map(l);return!Yb(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!h();i--)e.domain([t,n]),e.nice(i),[f,m]=e.domain(),p=e.ticks(i);return{roundedMin:f,roundedMax:m,ticks:p}}const Zb=(e,t)=>e.value-t.value,Qb=e=>({value:e,isMinor:!1}),ex=e=>({value:e,isMinor:!0});function tx(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter((e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e))).length<=r}function nx({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i}){const{explicitMin:o,explicitMax:a,hasExplicitMin:s,hasExplicitMax:l}=t.get("minorMinMax"),{min:u,max:c}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),d=fu((()=>{const d=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(cv.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),f=$b(d,r),m=function(e,t,n){const r=Sr().domain([e,t]);return r.nice(n),r}(u,c,f);let p,h,g=[];"SPARK"===n.meta.chart.mode?({roundedMin:p,roundedMax:h}=function(e,t){return{roundedMin:e,roundedMax:t}}(u,c)):(({roundedMin:p,roundedMax:h,ticks:g}=Xb(m,u,c,f,d,e,n,i)),tx(g,o,a)&&({roundedMin:p,roundedMax:h,ticks:g}=Jb(m,u,c,s||l,e)));const y=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(g,1);g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.unshift(t),n.filter((e=>e>=t))):n}(s,o,g),g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.push(t),n.filter((e=>e<=t))):n}(l,a,g);return{roundedMin:p,roundedMax:h,ticks:function(e,t){return[...e.map(Qb),...t.map(ex)].sort(Zb)}(g,y)}}),(()=>t.get("isPreRender")));return{values:()=>d().ticks,min:()=>s?o:d().roundedMin,max:()=>l?a:d().roundedMax}}function rx(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d},{localeInfo:f,rtl:m}){const{meta:p}=r,{fields:h}=o,g=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},y=!("none"===r.getLayoutValue("measureAxis.show"))?(v=i.meta.minor.orientation,b=i.meta.minor.dock,"vertical"===v?"near"===b||"left"===b?0:1:"near"===b||"bottom"===b?1:0):.5;var v,b;const x={},q="vertical"===i.meta.minor.orientation&&m,M=l.getMain().getScales(),S=l.getMini().getScales();if(Object.assign(x,M,{reducedFill:S.reducedFill}),x[cv.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,layoutService:i,themeService:o},{rtl:a}){const s=nx({chart:e,dockService:n,viewCache:r,layoutService:i,themeService:o}),l={invert:"vertical"===n.meta.minor.orientation||a,ticks:{values:s.values},minorTicks:{count:1},min:s.min,max:s.max};return i.meta.isStacked||(l.data={source:"qHyperCube",fields:t.minor}),l}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:u},{rtl:m}),p.isGroupedByDimension)[cv.SCALE.MAIN.MAJOR_INNER,cv.SCALE.MAIN.MAJOR].forEach(((e,t)=>{x[e]={invert:q,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:h.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:g,align:y}})),o.isDimensionLocked(0)||(x[cv.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)x[cv.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:q,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:g,align:y};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=o.formatter("q-time"),d=l.getStyles(),f=e=>Bb({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const m={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=u().map((e=>e.qName));return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:m},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:m}}}({picasso:t,localeInfo:f,viewState:c,viewModel:o,viewCache:a,themeService:u,layoutService:r},m);x[cv.SCALE.MAIN.MAJOR_INNER]=e,x[cv.SCALE.MAIN.MAJOR]=n}else p.isContinuous?x[cv.SCALE.MAIN.MAJOR]={type:"linear",invert:q,data:{extract:{key:"qHyperCube",field:h.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:x[cv.SCALE.MAIN.MAJOR]={invert:q,data:{extract:p.isDimensionless?h.minor.map(((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n}))):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:g,align:y};const{reducedMinor:D,reducedMajor:C}=_b(s,{major:x[cv.SCALE.MAIN.MAJOR],minor:x[cv.SCALE.MAIN.MINOR]},{majorScaleInvert:q,maxPxStep:g,align:y,getProp:a.get});return p.isDiscrete&&(x[cv.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(x[cv.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),x[s.scales.major]=C,x[s.scales.minor]=D,x}function ix(e,t,n){const{layoutService:r,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[jv(e,t)],components:[]}}({targets:[r.meta.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?cv.COMPONENT.STACK_TOTAL_BAR:cv.COMPONENT.BAR,cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",cv.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return cv.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[cv.COMPONENT.BAR_AXIS,cv.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]}},{...e,isLocked:n=>n.some((e=>e.key===cv.COMPONENT.LEGEND_COLOR_CAT))?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function ox(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[Fv(n,t)],components:[r]}}({key:"lasso",componentTargetKey:cv.COMPONENT.BAR,components:[t?{key:cv.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:cv.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function ax(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>"@"+e)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[zv(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:cv.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",cv.COMPONENT.BAR_AXIS,cv.COMPONENT.BAR],fillTargets:["group-axis",cv.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function sx(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=ix(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=ox(e),u=function(e,t){return e.layoutService.meta.isStacked||null!=t&&t("rangeSelections")?{components:[],interactions:[]}:Bv({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",cv.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:cv.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?Bv({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",cv.COMPONENT.BAR]:["continuous-axis",cv.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?cv.SCALE.MAIN.MAJOR_INNER:cv.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:r}){const i=e.layoutService.meta.isTime?r.formatter():e.chart.formatter(cv.FORMATTER.MINOR),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=ax(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}function lx({layoutService:e,viewModel:t,dockService:n}){var r;const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,a=e.getLayoutValue("components",null),s=a?a.filter((e=>"bar"===e.key))[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMaxPos)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMaxPos.toFixed(13))}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMinNeg)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMinNeg.toFixed(13))}}}]},settings:{major:{scale:cv.SCALE.MAIN.MAJOR},minor:{scale:cv.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:null!=s&&null!==(r=s.style)&&void 0!==r&&r.width&&s.style.width>0?s.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:uf.shadowBars.trackBy,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges}}}const ux={min:"Min",max:"Max"};function cx(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?eb(e,t)||tb(e,t):n===nb?eb(e,t):tb(e,t)}(Number(r.toFixed(13)),e,t)}function dx(e,{barComponent:t,type:n,isStacked:r}){var i,o,a,s;const{viewCache:l,layoutService:u,dockService:c}=e,d=l.get("minorMinMax"),f=n===nb;if(function(e,t){return!e["hasOther"+ux[t]]}(d,n)){if(function(e,t){return!e["hasExplicit"+ux[t]]}(d,n))return!1;if(cx(d,n,f))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e["hasExplicit"+ux[t]]&&r(e["explicit"+ux[t]])}(d,n,f))return!1;let m="end";r&&(m=f?"sumOfPositives":"sumOfNegatives");const p=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.chart.scale(cv.SCALE.MAIN.MINOR)[n]())),h=f?e=>e.datum[m].value>p():e=>e.datum[m].value<p(),g=cv.COMPONENT.BAR,y=e.layoutService.getLayoutValue("components",[]),v=y?y.filter((e=>e.key===g))[0]:null;return{type:"box-sliced-hat",key:"sliced-hat-"+n,layout:{dock:f?c.meta.minor.end:c.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:G({},t.settings.box,{fill:u.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:h,width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:g}),strokeWidth:null!=v&&null!==(i=v.style)&&void 0!==i&&i.strokeWidth?Gv.BAR.STROKE.WIDTH[v.style.strokeWidth.toUpperCase()]:Gv.BAR.STROKE.WIDTH.NONE,stroke:null!==(o=null==v||null===(a=v.style)||void 0===a||null===(s=a.strokeColor)||void 0===s?void 0:s.color)&&void 0!==o?o:Gv.BAR.STROKE.COLOR})}}}function fx(e,t){var n;let r;return r=e.isContinuous?1:.7,!e.isContinuous&&null!=t&&null!==(n=t.style)&&void 0!==n&&n.width&&t.style.width>0?t.style.width:r}function mx(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum",a=e=>"NaN"===e[o]?0:e[o];function s(t){const n=e.ds.field(t).raw(),r=e.ds.field(t).formatter(),i=!n.isCustomFormatted&&(n.qIsAutoFormat||"U"===n.qNumFormat.qType);return{field:t,reduceLabel:"none",value:a,label:e=>i?(e=>"NaN"===e[o]?"-":r(e[o]))(e):e.qText}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map(((t,o)=>{const a=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),c=a[Object.keys(a)[0]],d=null==c?void 0:c.field,f=d?{field:d,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,m={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:r.isStacked?s(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:f,...a,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?Pg.getNode(e.layoutService.getLayout(),r):void 0}};var p;return r.isDimensionless&&(m.value=o),void 0!==n&&(m.source=n),se(m.props),m}))}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}function px({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},null:{fields:t.minor.map((e=>({field:e}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>Number(e.qMaxPos.toFixed(13))},sumOfNegatives:{value:e=>Number(e.qMinNeg.toFixed(13))},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every((e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue))}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t>0?e+t:e),0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t<0?e+t:e),0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const hx="main-collection",gx="stack-total-collection";const yx="mini-collection",vx="mini-stack-collection",bx="mini-continuous-collection",xx="miniCube",qx=(e,t)=>{const n=(e=>{const t=[mx(e,{collectionKey:hx})];return e.layoutService.meta.isStacked&&t.push(px(e,{collectionKey:gx})),t})(t),r=((e,t)=>{const n=[];return Th({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(mx(t,{collectionKey:bx},xx)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}})),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:vx})):n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o=i.isReduced?{}:n.getMain().getDatumProps(t),a={end:{field:e},start:0,group:{field:r.majorGroup},measureIndex:t,...o},s={source:"miniCube",field:i.isDimensionless?e:r.major,props:a};return i.isDimensionless&&(s.value=t),s}))}}}(t,{collectionKey:yx}))),n})(0,t);return n.concat(r)};function Mx(e,t,n){const r=[{position:e,onBackground:!0,justify:0,overflow:n}];return t&&r.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:{fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}}}),r}function Sx({layout:e,component:t},n,r){if(!hb(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!pb(e,n),f=l.getStyles(),m=u.label.getStyle();function p(e){const t=o.formatter(cv.FORMATTER.MINOR);return t?t(e):e}const h={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:Mx("outside",d,c.isContinuous),style:f.label.value},g={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:Mx("opposite",d,c.isContinuous),style:f.label.value};return{key:"stack-total-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>mb(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:[db(G(n,h)),db(G(n,g))],fontSize:parseInt(m.fontSize,10),fontFamily:m.fontFamily,linkData:uf.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}}}function Dx(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function Cx({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!pb(e,n)||l&&!hb(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===nb&&0===u.max||t===rb&&0===u.min)return!1;if(!ob(t===nb?u.implicitMax:u.implicitMin,u,t))return!1;const c=o.getStyles(),d=a.label.getStyle();let f=e=>e.data.end.label;s.isStacked&&(f=t===nb?function(e){if(ob(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(cv.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(ob(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(cv.FORMATTER.MINOR);return r?r(t):t}return""});const m={label:f,simplifiedPlacements:Dx("outside",true,s.isContinuous),styles:c},p={label:f,simplifiedPlacements:Dx("opposite",true,s.isContinuous),styles:c},h=[db(G(n,m)),db(G(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y={component:`${cv.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:h,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:uf.labels.linkData}}};return{key:"bar-oob-labels-"+t,type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[y]},animations:{enabled:n.viewModel.animations.enabled,trackBy:uf.labels.trackBy,compensateForLayoutChanges:uf.labels.compensateForLayoutChanges}}}function wx(e){return"all"===e||"title"===e}function Lx(e,t,n){if(!wx(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const{actions:r,properties:i}=t,o={hyperCube:e.qHyperCube,hyperCubeDef:i&&i.qHyperCubeDef,isDimension:!0,disabled:()=>{var e;return!(null!=r&&null!==(e=r.interact)&&void 0!==e&&e.enabled())},model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},a=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleDimensions&&(o.padding="0",o.minWidth="auto"),{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:_v[t.dockService.meta.major.orientation+"DimensionAxisTitle"].minimumLayoutMode,dock:t.dockService.meta.major.dock},settings:o,style:a}}function Ex(e,t,n){if(!wx(e.measureAxis.show))return!1;const{layoutService:r,actions:i}=t,o=t.properties,a=r.getLayoutValue("qUndoExclude")?"qUndoExclude.qHyperCubeDef":"qHyperCubeDef",s={hyperCube:r.getHyperCube(),hyperCubeDef:uu(o,a),isDimension:!1,disabled:()=>!i.interact.enabled(),model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},l=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleMeasures&&(s.padding="0",s.minWidth="auto"),{key:"measure-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},settings:s,style:l}}function Tx({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},f=a.getStyles(),m=s.animations.enabled;return[pf({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:cv.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:cv.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:_v.refLines.minimumLayoutMode}),pf({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:cv.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:cv.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:cv.COMPONENT.BAR,minimumLayoutMode:_v.refLines.minimumLayoutMode}),...gf({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.minor.opposite,scale:cv.SCALE.MAIN.MINOR,style:f,formatter:cv.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:cv.COMPONENT.MEASURE_REF_LINE_LABEL}),...gf({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.major.opposite,scale:cv.SCALE.MAIN.MAJOR,style:f,theme:u,localeInfo:c,rtl:t,key:cv.COMPONENT.DIMENSION_REF_LINE_LABEL})]}const kx=(e,t,n)=>{var r;const{layoutService:i,dockService:o,colorService:a,chart:s,actions:l,discrete:u,continuousDataModel:c,reducedDataModel:d,viewModel:f,viewState:m,viewCache:p,themeService:h,refLineModel:g,pluginService:y,rtl:v,logicalSize:b,trendLineModel:x}=t,{localeInfo:q}=n,M=Sb({layout:e},t,v);if(M&&"center"===M.layout.dock)return{components:[M]};const S=rx(e,t,{localeInfo:q,rtl:v}),D=!(null!=l&&null!==(r=l.interact)&&void 0!==r&&r.enabled()),C=a.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:s,styleReference:"object.barChart",rtl:v,settings:{item:{shape:{size:10}}}},{actions:l,navigationDisabled:D}),w=C.components[0];if(w){const{dock:e}=w.layout;if(S.fillRange&&(["right","left"].includes(e)||v)&&(S.fillRange.invert=!0),"legend-seq"===w.type&&void 0!==f.selectionDimensionIdx&&S.fillRange&&S.fillRange.min<S.fillRange.max){const e=Bv({eventName:"legendRange",key:"legendRangeBrush",targets:[w.key],fillTargets:[w.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:w.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{l.select.emit("end","legendRange")}},t);C.components.push(...e.components),C.interactions.unshift(...e.interactions)}}else S.fillRange&&v&&(S.fillRange.invert=!0);const L=((e,{componentKey:t,collectionKey:n})=>{var r,i,o,a;const{meta:s}=e.layoutService;let l,u;s.isGroupedByDimension?l=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:s.isGroupedByMeasure&&(l=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let c=2;s.isContinuous?(u={start:"timeStart",end:"timeEnd"},c=Xv(e,t)):s.isStacked&&(u="stack");const d=s.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,f=e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)},m=e.layoutService.getLayoutValue("components",null),p=m?m.filter((e=>e.key===t))[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:s.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:s.isContinuous||d?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:cv.SCALE.MAIN.MAJOR,fn:l,ref:u},minor:{scale:cv.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:Yv({layoutService:e.layoutService,discrete:e.discrete,componentKey:t}),minWidthPx:c,fill:e.colorService.getMain().getColor(),opacity:e=>f(e)?0:void 0,minHeightPx:function(e){return s.isStacked?.1:f(e)?.01:.3},strokeWidth:null!=p&&null!==(r=p.style)&&void 0!==r&&r.strokeWidth?Gv.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:Gv.BAR.STROKE.WIDTH.NONE,stroke:null!==(i=null==p||null===(o=p.style)||void 0===o||null===(a=o.strokeColor)||void 0===a?void 0:a.color)&&void 0!==i?i:Gv.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:uf.bars.trackBy,compensateForLayoutChanges:uf.bars.compensateForLayoutChanges}}})(t,{componentKey:cv.COMPONENT.BAR,collectionKey:cv.COLLECTION.MAIN}),E=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=Xv(e,t));const o=e.layoutService.getLayoutValue("components",null),a=o?o.filter((e=>e.key===t))[0]:null,s={key:t,type:"box",data:{collection:n},settings:{major:{scale:cv.SCALE.MAIN.MAJOR},minor:{scale:cv.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:fx(r,a),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1}},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:.3}}}}]}};return r.isContinuous&&(s.settings.major.ref={start:"timeStart",end:"timeEnd"}),s})(t,{componentKey:cv.COMPONENT.STACK_TOTAL_BAR,collectionKey:cv.COLLECTION.STACK_TOTAL}),T=sx(t,n,f.selectionDimensionIdx),{isStacked:k}=i.meta;let N;N=d.mode.isContinuous?cv.COLLECTION.MINI_CONTINUOUS:k?cv.COLLECTION.MINI_STACK:cv.COLLECTION.MINI;const A=k?E:L,O=Ab(0,t),I=[...O,dx(t,{barComponent:A,type:"max",isStacked:k}),dx(t,{barComponent:A,type:"min",isStacked:k}),sb(t,{barComponent:A,type:"max",isStacked:k}),sb(t,{barComponent:A,type:"min",isStacked:k}),ub(t,{chart:s,barComponent:A,type:"max",scales:S,collectionKey:k?cv.COLLECTION.STACK_TOTAL:cv.COLLECTION.MAIN}),ub(t,{chart:s,barComponent:A,type:"min",scales:S,collectionKey:k?cv.COLLECTION.STACK_TOTAL:cv.COLLECTION.MAIN}),...Kv(e,t,v,!!O[0]),L,E,lx({layoutService:i,viewModel:f,layout:e,dockService:o}),Lx(e,t,v),Ex(e,t,v),...Tx({environment:n,rtl:v,refLineModel:g,layoutService:i,colorService:a,dockService:o,themeService:h,viewModel:f,chart:s}),qo({viewState:m,viewCache:p,layoutService:i,dockService:o,rtl:v}),zb(L,t,{collectionKey:N}),kh({layoutService:i,dockService:o,discrete:u,continuousDataModel:c,viewState:m,viewCache:p,themeService:h,rtl:v,deviceType:n.deviceType}),...Gy({majorScale:cv.SCALE.MAIN.MAJOR,minorScale:cv.SCALE.MAIN.MINOR,tooltipOverlay:cv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:x,dockService:o,animationsEnabled:f.animations.enabled}),...C.components,yb({layout:e,component:cv.COMPONENT.BAR,minorScale:S.minor},t,v),Sx({layout:e,component:cv.COMPONENT.STACK_TOTAL_BAR},t,v),Cx({layout:e,component:"bar-oob-max",type:"max"},t),Cx({layout:e,component:"bar-oob-min",type:"min"},t),...T.components,bb(0,{...t,coloring:a.getMain().getSettings()},v),qb(0,{...t,coloring:a.getMain().getSettings()},v),(!1!==e.showDisclaimer||!t.flags.isEnabled("SHOW_DISCLAIMER"))&&M,Zy({tooltip:cv.COMPONENT.TREND_LINES_TOOLTIP,formatter:cv.FORMATTER.MINOR,majorScale:cv.SCALE.MAIN.MAJOR},t,{rtl:v})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(I);return{interactions:jb(t,{rtl:v,hammer:{gestures:[...C.interactions,...T.gestures].sort(((e,t)=>(t.prio||0)-(e.prio||0)))}}),scales:S,palettes:a.getMain().getPalettes(),components:y.extendComponents(I),strategy:te(0,{logicalSize:b,minCenterRatio:0}),formatters:Db(t,S),collections:qx(0,t)}};function Nx({picasso:e,chart:t,services:n,environment:r,viewState:i,viewCache:o,bootstrapped:a}){const{width:s,height:l}=O(),u=E(),c=N(),d=D(),[f,m]=b(),[p,h]=b(),[g,y]=b(),[v,x]=b(),q=T();function S(){if(!t.layoutComponents)return Promise.resolve();const{discrete:a,layoutService:s,viewModel:l}=n;o.set("isPreRender",!0);const m=function(a={}){const{selectionService:s,refLineModel:l,discrete:m,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,pluginService:y,colorService:v,viewModel:b,dockService:x,themeService:M,customTooltipModel:S,layoutService:D,logicalSize:C,styleService:w}=n,L=s.custom.getActions(),E=e.data("q")(f.prepPicassoDataSet()),T={picasso:e,ds:E,rtl:"rtl"===(null==d?void 0:d.direction),model:u,app:q,chart:t,actions:L,localeInfo:r.localeInfo,logicalSize:C,flags:r.flags,translator:r.translator,selections:c,isLocked:s.getIsSelectionLocked,viewCache:o,viewState:i,layoutService:D,dockService:x,viewModel:b,colorService:v,selectionService:s,themeService:M,trendLineModel:g,discrete:m,continuousDataModel:h,reducedDataModel:p.model(),customTooltipModel:S,debouncer:mu,refLineModel:l,pluginService:y,styleService:w,...a};return kx(D.getLayout(),T,r)}(p);f.extractDataPages(),t.layoutComponents({settings:m,data:g}),o.set("isPreRender",!1),f.insertDataPages(),l.animations.hasSlicedHats=m.components.filter((e=>"box-sliced-hat"===e.type)).length>0;const h=[];return 1!==m.components.length&&s.meta.isDiscrete&&h.push(a.command.initialize()),Promise.all(h)}const[[C,w]=[]]=I((()=>{var s;if(!(e&&t&&n&&r&&i&&o&&a))return Promise.resolve();const{layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:f,reducedDataModel:m,continuousDataModel:p,trendLineModel:h,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b}=n;if(null==u||null===(s=u.custom)||void 0===s||!s.getActions())return Promise.resolve();const q=()=>{x(Date.now()),b.animations.isPartialUpdating=!0};i.onChanged("scrollOffset",(()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),q()})),i.onChanged("legendScrollOffset",q),i.intercept("zoom",f.event.onZoomIntercept({viewCache:o})),i.onChanged("zoom",f.event.onZoomChange({layoutService:l,continuousDataModel:p},q)),u.setLayout(l.getLayout());const M=[];l.meta.isContinuous&&(p.update(l.getLayout()),M.push(p.initialFetch())),h.command.update(),M.push(m.fetch().then((({reducedCube:e})=>{m.update(e)}))),M.push(Promise.resolve({properties:a.properties}));return Promise.all(M).then((e=>Promise.all([v.initialize(),y.initialize(),Rv({reducedDataModel:m,layoutService:l,continuousDataModel:p,trendLineModel:h})]).then((t=>[e,t.pop()]))))}),[a]);M((()=>{var e;if(null==n||null===(e=n.colorService)||void 0===e||!e.getMain()||!w)return;const{layoutService:t,selectionService:i,reducedDataModel:a,continuousDataModel:s,trendLineModel:l,legendLayoutService:u,colorService:c,viewModel:d}=n;o.set("minorMinMax",w);const f=t.getHyperCube(),p=t.meta.isContinuous?s.getInitialCube():a.model().cube,{field:g}=c.getMain().getSettings(),y=!t.meta.isContinuous&&(a.model().mode.isReduced||t.meta.isStacked)&&u,v=y?u.getHyperCube():void 0;i.setBrushAliases({colorField:g,useLegendCube:y,legendAlias:"legendCube/"+g});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:c}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:c}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:f,miniCube:p,legendCube:v,localeInfo:r.localeInfo,layoutService:t,viewModel:d,trendLineModel:l}),x=C[C.length-1];h({localeInfo:r.localeInfo,...x}),m(b)}),[w]),M((()=>{if(!n||!p||!f)return;const e=n.colorService.getMain();if(!e)return;f.prepPicassoDataSet();const t=f.prepPicassoData(e.getData());y(t)}),[p]),M((()=>{var e;null!=n&&null!==(e=n.colorService)&&void 0!==e&&e.getMain()&&t.update&&f&&g&&S().then((()=>{const{layoutService:e,discrete:r,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([r.query.getCurrentDataPage()])}t.update(),uf.cacheProperties({viewCache:o,layout:e.getLayout()})}))}),[g]),M((()=>{if(!(s&&l&&f&&null!=t&&t.update&&null!=n&&n.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:o}=n;i.update({width:s,height:l}),o.setTheme(r.theme),S().then((()=>{t.update&&t.update()}))}),[s,l]),M((()=>{if(null==t||!t.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1}),[v])}function Ax({env:e,services:t}){const n=T(),r=E(),i=F(),[o,a]=I((async()=>{if(!e||!t)return Promise.resolve();const{flags:o}=e,{layoutService:a}=t,{isSnapshot:s,isStacked:l,isContinuous:u}=a.meta,c=[];return s||c.push(r.getEffectiveProperties()),Promise.all(c).then((async e=>{const t=e[0]||void 0;if(o.isEnabled("IM_1579_HIDE_DIM_MEA")&&null!=t&&t.qHyperCubeDef){const e=a.getLayout(),o=G(!0,{},t);if((({properties:e,layout:t,isStacked:n,isContinuous:r,model:i})=>{var o,a;const s=t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),l=t.qHyperCube.qMeasureInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),u=G(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&(n.color.mode="primary"))})(s,l,e),s.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),s.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),null===(o=i.colorSupport)||void 0===o||null===(a=o.colorByUpdater)||void 0===a||a.call(o,e,"qHyperCubeDef.",t),JSON.stringify(u)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)})({properties:t,layout:e,isStacked:l,isContinuous:u,model:r}))return i.pending(),(e=>{var t;return!(!e||e.qHasSoftPatches||e.qExtendsId||!(((null===(t=e.qMeta)||void 0===t?void 0:t.privileges)||[]).indexOf("update")>-1))})(e)?r.setProperties(t).then((()=>{n.clearUndoBuffer()})):void await((e,t,n)=>{if(!e)return Promise.resolve();let r=Lo.generate(t,n);return G(!0,t,n),r&&r.length?(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0)):Promise.resolve()})(r,o,t);i.restore()}return{properties:t}}))}),[e,t]);if(a&&!a.isHandled)throw a;return o}var Ox={exports:{}};window;var Ix=H(Ox.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},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)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).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 h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),f=c(r[1],i),m=p(0),h=p(1),g=y(d,m),v=y(f,h);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var q={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(m(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};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 S=i.a.bind(null,!0),D={},C=Array.isArray;function w(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function L(e){return void 0===e}function E(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=L(e[n||t])?o:e[t],e=e[n||t]}})),e}function k(e,t){var n=!0;if(w(e)&&w(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){k(e[r],t[r])||(n=!1)})),n);if(C(e)&&C(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||E(t,i)||(L(a)?r.push({op:"add",path:s,value:o}):w(o)&&w(a)?r=r.concat(D.generate(a,o,s)):C(o)&&C(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&L(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(k(t,i))return r;if(!L(t[0])&&L(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){L(t[i])&&!E(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},D.apply=function(e,t){t.forEach((function(t){var n,r=T(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(C(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(C(o)&&C(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(w(o)&&w(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!E(n,e)&&delete n[e]})),S(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 u=T(e,t.from);C(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(C(r)?r.splice(+i,1):delete r[i])}))},D.clone=function(e){return S({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):S(e,t)};var N=D,A=function(e,t,n){if(!e)return Promise.resolve();var r=N.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()},O="accumulation";function I(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===O)return n[r]}function P(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===O)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var R={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},F={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=q.getNumStepComp(n,l),f=q.getAboveComp(n,l,c,d),m=q.getRangeComp("RangeSum",f);if(q.needDimension({modifier:n,properties:r,layout:i})){var p=q.getDimComp(u,1),h=q.getDimComp(u,0),g=q.getAggrComp(m,p,h);m=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return m},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,R)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(P(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(P(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(P(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(P(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=I(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=I(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(P(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(O))return!1;var o=I(t,e);return o&&!o.disabled}}}},j="movingAverage";function H(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},_={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=q.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),m=q.getNumStepComp(r,u),p=q.getAboveComp(r,u,f,m);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",p);else{var h=q.getRangeComp("RangeSum",p),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(q.needDimension({modifier:r,properties:i,layout:o})){var v=q.getDimComp(c,1),b=q.getDimComp(c,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return q.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=H(t,e);return o&&!o.disabled}}}},V="difference";function U(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function W(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},K={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=q.getAboveComp(n,l,c),f="".concat(c," - ").concat(d);if(q.needDimension({modifier:n,properties:r,layout:i})){var m=q.getDimComp(u,1),p=q.getDimComp(u,0),h=q.getAggrComp(f,m,p);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!q.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 q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=U(t,e);return o&&!o.disabled}}}},G={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},Y={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},J="normalization";function X(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}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:Y.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:Y.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:Y.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}(X(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:G.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:G.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:G.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}(X(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:Y.DISREGARD_ALL_DIMENSIONS,selectionScope:G.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(q.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(q.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,d,n.field,n.value,f,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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!q.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:G.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 X(t,e).selectionScope===G.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 X(t,e).selectionScope===G.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:Y.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(X(t,e).dimensionalScope||0)===Y.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.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=X(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe={accumulation:F,movingAverage:_,difference:K,normalization:se},me=(t.default={modifiers:fe,apply:pe,applyModifiers:he,cleanUpMeasure:ge,destroy:function(e){e&&me[e.id]&&me[e.id].masterItemSubscriber&&(me[e.id].masterItemSubscriber&&me[e.id].masterItemSubscriber.unsubscribe(),delete me[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return fe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return fe[e]&&fe[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=qe(e);Ee({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Oe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;me[t.id]=me[t.id]||{isFirstTime:!0};var l=me[t.id].isFirstTime;if(me[t.id].isFirstTime=!1,n&&"object"===de(n))return he({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),f=me[t.id].lastReloadTime;if(me[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:d,layout:u})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Le({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,lastReloadTime:f});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ee({modifiers:qe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Se(n);var r=Ie(n);return Te({model:t}).then((function(i){return ke({libraryIds:r,model:t}).then((function(r){return m&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Le({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(fe[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=fe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ce(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),he({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ie(n);return Pe({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ae({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function he(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Se(r);var f=Ie(r);return Pe({model:t,libraryIds:f,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ie(n);return Te({model:r,dimensionAndFieldList:s}).then((function(e){return ke({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ee({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");fe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=fe[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof fe[n.type].updateModifier&&fe[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=fe[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Ae({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=qe(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!fe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,De(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ee({modifiers:qe(e),properties:n,layout:r})}))}function ve(e){var t=qe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(fe[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||fe[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function qe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Se(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:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function De(e){var t=qe(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!fe[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ce(e){return e.base||e.qDef&&e.qDef.base}function we(e){var t=Ce(e);return e.qLibraryId||t&&t.qLibraryId}function Le(e){var t=e.measure,n=e.properties,r=e.layout;return!we(t)&&Ee({modifiers:qe(t),properties:n,layout:r})}function Ee(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!fe[e.type])&&(void 0===i[e.type]&&(i[e.type]=fe[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Te(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ne(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ae(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Ne)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Ne)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ne)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ne);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):A(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Oe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&fe[e.type]&&fe[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ie(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=qe(t);if(Ee({modifiers:r,properties:e})){var o=we(t);o&&n.push(o),i=i||Oe({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Pe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(me[t.id].masterItemSubscriber=me[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(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 c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),me[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(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)?u(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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},f=n(1),m=n.n(f),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(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 a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){m.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function h(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function M(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return 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}var w={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,q),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,q),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=M(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=D(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&m.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function L(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var E={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.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:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(h(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(h(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(h(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,f=void 0===d||d,m=e.isHCModifierSupported,p=void 0===m||m,h={qChildren:[]},g=w.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=w.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,M=b.maxMeasures,S=b.minMeasures,D=l.defaultDimension,C=void 0===D?w.getDefaultDimension():D,E=l.defaultMeasure,T=void 0===E?w.getDefaultMeasure():E;v.qDimensions.length=0,v.qMeasures.length=0,w.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S})&&w.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S,newHyperCubeDef:v}),w.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:C}),w.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:S,newHyperCubeDef:v,defaultMeasure:T}),w.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),w.copyPropertyIfExist("qMaxStackedCells",y,v),w.copyPropertyIfExist("qNoOfLeftDims",y,v),w.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),w.copyPropertyOrSetDefault("qMode",y,v,"S"),w.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),w.copyPropertyOrSetDefault("qSortbyYValue",y,v),w.copyPropertyOrSetDefault("qIndentMode",y,v),w.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),w.importCommonProperties(g,t,r),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return w.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:k}),f&&L(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&L(h.qProperty,"dynamicScript"),h}},T={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function k(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function N(e,t){return e.length!==t}var A={create:function(e,t){if(!e||!T[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(k(a,t,r,i),N(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},O={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}},I={colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>0&&O.getNumMeasures(e)<=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>0},expression:function(e){return O.getNumMeasures(e)>=1}}},P={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},R={scatterplot:P,"sn-scatter-plot":P,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)<=1},expression:function(e){return O.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>=1},expression:function(e){return O.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 O.getNumDimensions(e)>=1}}}};function F(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=A.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)})),t.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)}))}function H(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var m=A.create(A.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:m,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:m,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(m.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(m)):l.qAttributeExpressions.push(m)}}}function B(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:m.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return m.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var _={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=O.getItemLabel(t);switch(H(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||O.wrapFieldName(t.name),key:O.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&_.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=A.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,B("dimension",!!a,a||r)),!!a}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"),[]),a=o.getValue(e,"color.byDimDef");if(a&&H(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=B("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&U(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&H(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=B("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=A.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,B("measure",!!s,s||r[0])),!!s}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var K={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=(R[t]||I).colorModeOptions||I.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=E.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=A.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return A.moveByIdFromGroup(a,[],"qAttributeDimensions",u),A.moveByIdFromGroup(a,[],"qAttributeExpressions",u),A.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=E.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,f=o.getValue(d,"visualization"),m=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),g=K.getCanColorBy(d,f),y=K.shouldUpdateColorBy({canColorBy:g,autoColor:h,colorMode:p,dimensions:m});return g[p]?K.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:d})&&K.addColorByExpression(d):K.switchToAutoColor(d),y&&K.updateColorBy(d,"qHyperCubeDef."),K.shouldSwitchToColorPersistent(d)&&K.changeProperty(d,"color.persistent",!0),K.deleteTotalMode(m),c}},Y=["bar","marker","line"],J={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?L(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):L(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var 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}}),Y.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(h(s,"measureAxis.min","supportedAutoMinMax"),h(s,"measureAxis.max","supportedAutoMinMax")):(h(s,"measureAxis.min","unsupportedAutoMinMax"),h(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return J.handleAutoMinMax({initialProperties:n,properties:d}),J.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),J.setInterColumnSortOrder(d.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:E,colorChart:G,axisChart:X,quarantineProperty:h,unquarantineProperty:L,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}]));function Px(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,r=t.layout.qHyperCube.qDimensionInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const Rx=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Fx=(e,t)=>{var n,r,i,o,a;const s=null===(n=t.qHyperCube)||void 0===n||null===(r=n.qMeasureInfo)||void 0===r?void 0:r.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,l=null===(i=t.qHyperCube)||void 0===i||null===(o=i.qDimensionInfo)||void 0===o?void 0:o.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg})).length,u="grouped"===(null===(a=e.barGrouping)||void 0===a?void 0:a.grouping)&&l>0&&s+l>2;return de.continuous(t)?1:u?.9:.7},jx=(e,t,n)=>{const r=e+".fontFamily",i=e+".fontSize";return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:e+".color",defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function Hx(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach((function(e){for(var r=e.split("."),i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=af({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var l=function(e){for(var t=e.split("."),n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==t?void 0:t.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(Rx).map((e=>Rx[e])),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return de.continuous(r)?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:jx("axis.title",r,e)}}}:void 0,axisLabelSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:jx("axis.label.name",r,e)}}}:void 0,labelSection:null!=t&&t.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:jx("label.value",r,e)}}}:void 0}}}function zx(e=!1,t,n,r){return e?function(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(Rx).map((e=>Rx[e])),schemaIgnore:!0,defaultValue:Rx[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>Fx(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(Ch.OPTIONS).map((e=>Ch.OPTIONS[e])),schemaIgnore:!0,defaultValue:Ch.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}(n):Hx(t,n,r)}const Bx={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"bar",ref:"components",defaultValues:(e,t)=>({key:"bar",style:{width:Fx(e,t.layout),strokeColor:{index:-1,color:"#205891"},strokeWidth:"none"}}),items:{bar:{components:"items",type:"items",uses:"styling.box",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},width:{show:(e,t,n)=>!de.continuous(n.layout),component:"slider",min:.01,max:1,step:.01,defaultValue:.7}}}}},_x=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg},Vx=(e,t)=>e.qHyperCube[t].filter((e=>_x(e))),Ux=e=>({get:(t,n,r)=>de.continuous(r.layout)?e:t(n.type),set(e,t,n){const r=he(n.type,n);t(n.type,e,r)}}),Wx=e=>{const t=G(!0,{},e);return t.qHyperCube.qMeasureInfo=Vx(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=Vx(e,"qDimensionInfo"),t&&!de.continuous(t)&&de.stacked(t)},$x=({translator:e,flags:t,anything:n})=>{var r,i,o;const a=null==n||null===(r=n.sense)||void 0===r||null===(i=r.isUnsupportedFeature)||void 0===i?void 0:i.call(r,"continuousData"),s={items:{labels:{items:{header:{show:(e,t,n)=>Vx(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!Wx(t.layout)&&Vx(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>Wx(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>Wx(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>Vx(n.layout,"qDimensionInfo").length&&Vx(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>Vx(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},l=null==n||null===(o=n.sense)||void 0===o?void 0:o.theme,u={uses:"settings",items:{simpleStyling:zx(!0,l,t,e),simpleLabels:s,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_BARCHART")?zx(!1,l,t,e):Bx,grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=Vx(t.layout,"qMeasureInfo").length,r=Vx(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},change(e,t){Vx(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:Ux("stacked")},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:Ux("vertical")},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(Ch.OPTIONS).map((e=>Ch.OPTIONS[e])),defaultValue:Ch.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!de.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(Wx(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Wx(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Wx(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,n,r)=>t&&t.isEnabled("BC_XAXIS_MODE")&&!de.continuous(r.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=Vx(n.layout,"qMeasureInfo").length,i=Vx(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:Px,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!a}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};return null!=t&&t.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(u.items.dimensionAxis.items.othersGroup={items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}),u},Kx={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){Dt(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Gx={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"}}},Yx=({translator:e,flags:t,anything:n})=>{var r,i;return{uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,r){var i,o;if(null!=n&&null!==(i=n.sense)&&void 0!==i&&null!==(o=i.isUnsupportedFeature)&&void 0!==o&&o.call(i,"includeZeroValues"))return!1;const a=((e,t)=>{var n,r,i,o,a,s;const l=null===(n=t.layout)||void 0===n||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.findIndex((e=>_x(e)));return(null===(o=t.properties)||void 0===o||null===(a=o.qHyperCubeDef)||void 0===a||null===(s=a.qDimensions)||void 0===s?void 0:s[l])===e})(e,t),s=de.continuous(r.layout);return!(a&&s)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")},trendLines:null!=n&&null!==(r=n.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"trendlines")?void 0:rv({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}}};function Jx({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Yx({translator:e,flags:t,anything:n}),sorting:Kx,addons:Gx,settings:$x({translator:e,flags:t,anything:n})}}}const Xx=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Bg};function Zx(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter((e=>Xx(e))).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){return t.qHyperCube.qMeasureInfo.filter((e=>Xx(e))).length+t.qHyperCube.qDimensionInfo.filter((e=>Xx(e))).length>2&&!de.continuous(t)&&!((null==(n=t)||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.filter((e=>Xx(e))).length)>1&&(null==n||null===(o=n.qHyperCube)||void 0===o?void 0:o.isHCEnabled));var n,r,i,o},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!de.continuous(t)}}},color:{uses:"color"}}}}function Qx(e){const t={},n=uu(e,"components"),r=uu(e,"dimensionAxis.axisDisplayMode"),i=uu(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter((e=>"bar"===e.key))[0]:void 0,a=uu(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach((e=>{t["chart_style_"+e]=o.style[e]})),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=uu(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const eq=e=>!!(e&&e.qHyperCube.qSize.qcy>0),tq={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function nq(){const e=[];return Object.keys(tq).forEach((t=>{e.push(tq[t])})),e}function rq(e){const{flags:t}=e;return{definition:Jx(e),softDefinition:Zx(),support:{snapshot:eq,export:eq,exportData:!0,sharing:eq,viewData:!0,effects:!0,modifiers:nq()},importProperties:(n,r,i,o)=>{const a={layout:{templateId:r.templateId}};i.mapProperties(a);const s={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},l=Ix.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:Jg(e),defaultPropertyValues:s,hypercubePath:o,extension:i}),u=l.qProperty;return u.qHyperCubeDef.qDimensions.length>1&&"stacked"===u.barGrouping.grouping&&(u.qHyperCubeDef.qMode="K",u.qHyperCubeDef.qAlwaysFullyExpanded=!0),t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Ix.conditionalShow.unquarantine(u),Ix.conditionalShow.unquarantineAlternative(u)),l},exportProperties:(e,n,r)=>{t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Ix.conditionalShow.quarantine(e.qProperty),Ix.conditionalShow.quarantineAlternative(e.qProperty));return Ix.axisChart.exportProperties({propertyTree:e,hyperCubePath:n,viewDataMode:r})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(Dt)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=Ch.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Qx}}function iq(i){const o=function(){const i=e();return i.use(t),i.use(n(r)),i.use(Xm()),i.use(bg),i.component("box-sliced-hat",yg),i.component("box-out-of-bounds",fg),i.component("scrollbar",sg),i.component("scroll-hint",xo),i.component("reference-line-labels",xa),i.component("axis-overlay",Sh.picassoComponents.axisOverlay),i.component("time-axis",Sh.picassoComponents.timeAxis),i.scale("q-time-axis",Sh.picassoScales.time),i}();return{qae:Xg(i),ext:rq(i),component(){const e=Qg({env:i}),{viewState:t,viewCache:n}=ey(),r=function({picasso:e}){const t=S(),n=D(),[r,i]=b();return M((()=>{if(!e)return()=>{};t.style.overflow="hidden";const r=e({renderer:{prio:[(null==n?void 0:n.renderer)||"canvas"]}}).chart({element:t,data:[],settings:{}});i(r);const{destroy:o}=r;return()=>{o()}}),[n.renderer]),r}({picasso:o}),a=yv({picasso:o,chart:r,environment:e,viewState:t,viewCache:n}),s=Ax({env:i,services:a});Nx({picasso:o,chart:r,services:a,environment:e,viewState:t,viewCache:n,bootstrapped:s}),(({services:e,chart:t,viewState:n})=>{P((r=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discrete:s,continuousDataModel:l,reducedDataModel:u}=e,{width:c,height:d}=o.meta.chart.size;return r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(r.snapshotData.content.chartData={scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:fe(t,cv.COMPONENT.LEGEND_COLOR_CAT)},i.meta.isDiscrete?(s.command.setSnapshotData(r),u.setSnapshotData(r)):l.setSnapshotData(r),a.getMain().getSnapshotData().then((e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}})).catch((()=>{})))})),R((()=>({getViewState(){if(n&&t)return{scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:fe(t,cv.COMPONENT.LEGEND_COLOR_CAT)}}})),[n,t])})({services:a,chart:r,viewState:t})}}}export{iq as default};