@nebula.js/sn-combo-chart 1.8.9 → 1.8.13

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,12 +1,12 @@
1
1
  /*
2
- * @nebula.js/sn-combo-chart v1.8.9
3
- * Copyright (c) 2021 QlikTech International AB
2
+ * @nebula.js/sn-combo-chart v1.8.13
3
+ * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import{useElement as e,useState as t,useEffect as r,useRect as n,usePromise as i,useStaleLayout as o,useModel as a,useApp as s,useAppLayout as l,usePlugins as u,useOptions as c,useTranslator as d,useEmbed as m,useTheme as f,useDeviceType as p,useConstraints as h,useLayout as y,useAction as g,useSelections as v,onTakeSnapshot as b,useImperativeHandle as x}from"@nebula.js/stardust";import M from"hammerjs";import S from"picasso.js";import E from"picasso-plugin-q";import C from"picasso-plugin-hammer";import q from"react";import{Button as O,Popover as A,List as D,ListItem as N,ListItemIcon as I,ListItemText as T}from"@material-ui/core";import w from"react-dom";import{createGenerateClassName as L,StylesProvider as R,ThemeProvider as k}from"@material-ui/styles";function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Object.prototype.hasOwnProperty,F=Object.prototype.toString,V=Object.defineProperty,_=Object.getOwnPropertyDescriptor,z=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===F.call(e)},H=function(e){if(!e||"[object Object]"!==F.call(e))return!1;var t,r=j.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&j.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||j.call(e,t)},$=function(e,t){V&&"__proto__"===t.name?V(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},B=function(e,t){if("__proto__"===t){if(!j.call(e,t))return;if(_)return _(e,t).value}return e[t]},U=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=B(s,r),s!==(i=B(t,r))&&(c&&i&&(H(i)||(o=z(i)))?(o?(o=!1,a=n&&z(n)?n:[]):a=n&&H(n)?n:{},$(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&$(s,{name:r,newValue:i}));return s};const Y="center",W="bottom";var G={NoDataExist:{label:"NoDataExist",alignment:Y,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:Y,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:Y,default:!1},LimitedData:{label:"LimitedData",alignment:W,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:W,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:W,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:W,default:!1}};const K=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],X={};K.forEach((([e,{width:t,height:r}])=>{X[e]={width:t,height:r}}));const J={getLayoutModes:()=>X,getLayoutMode(e,t){let r;for(r=0;r<K.length;++r)if(e>=K[r][1].width&&t>=K[r][1].height)return K[r][0];return"SPARK"}};const Z=["$date","$timestamp","$time"],Q=["D","TS","T"],ee={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>Z.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&Q.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(ee.hasTimeTag(t)&&ee.hasUnknownFormat(t)||ee.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&ee.isTimeDimension(e,t.qHyperCube.qDimensionInfo[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some((e=>"$numeric"===e)))},canBeContinuous:e=>!(!(e&&e.qHyperCube&&e.qHyperCube.qDimensionInfo)||e.qHyperCube.qDimensionInfo.length<1)&&ee.canBeContinuousDimension(e.qHyperCube.qDimensionInfo[0]),maxNumberOfLines:12},te=(e,t,r)=>{const n=t.split(".");let i,o=e;if(void 0===o)return r;for(i=0;i<n.length;++i){if(void 0===o[n[i]])return r;o=o[n[i]]}return o},re=e=>te(e,"qHyperCube.qDimensionInfo",[]),ne=e=>te(e,"qHyperCube.qMeasureInfo",[]),ie=e=>te(e,"barGrouping.grouping"),oe={continuous:(e,t=!1)=>!!ee.canBeContinuous(e)&&(te(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!re(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===ie(e)&&(re(e).length>1||ne(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&re(e).length>1&&1===ne(e).length},groupedByMeasure(e){return this.grouped(e)&&1===re(e).length&&ne(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==ie(e)||this.continuous(e))&&(re(e).length>1||ne(e).length>1)},stackedByDimension(e){return this.stacked(e)&&re(e).length>1&&1===ne(e).length},stackedByMeasure(e){return this.stacked(e)&&1===re(e).length&&ne(e).length>1},simple:e=>0===re(e).length||1===re(e).length&&1===ne(e).length,snapshot:e=>!!te(e,"snapshotData")};function ae(e,t){const r=e.component(t);return r&&r._DO_NOT_USE_getInfo&&r._DO_NOT_USE_getInfo().offset}const se=e=>{throw e.isHandled=!0,e};const le={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":return"far";case"far":return"near";default:return"far"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,r)=>"vertical"===e||"y"===e?le.getVerticalDock(t):r?le.getOppositeDock(le.getHorizontalDock(t)):le.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment(e,t){switch(e){case"vertical":return"near"===t||"bottom"===t?1:0;default:return"near"===t||"left"===t?0:1}},getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:r})=>"vertical"===e?t:r},ue={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),r=e.match(/[\u3040-\u309F]/g),n=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,r=r?r.length:0,n=n?n.length:0;const i=t+r+n;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,r="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const n={latin:0,cjk:0};let i;void 0===t?e.forEach((e=>{i=ue.getCharacterRatios(e[r]),n.latin+=i.latin,n.cjk+=i.cjk})):e.forEach((e=>{i=ue.getCharacterRatios(e[t][r]),n.latin+=i.latin,n.cjk+=i.cjk}));const o=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/o,n.cjkRatio=n.cjk/o,n},getAdjustedMaxGlyphCount(e,t,r,n="qText"){const i=ue.getTotalCharacterRatios(t,r,n),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(ue.stringWidthOverMWidth(o)+1.0909090909090908*a)}};function ce(){if(!document.querySelector("#la-vie-tooltip")){const e=document.createElement("div");e.id="la-vie-tooltip",e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function de({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ce()},beforeUpdate(){ce()},destroyed(){!function(){const e=document.querySelector("#la-vie-tooltip");e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector("#la-vie-tooltip"),content:({h:e,data:t,style:r})=>t[0].map((t=>e("tr",{},function(e,{h:t,style:r}){return e.map((e=>{const n={style:{...r.cell||{},...e.style||{}},class:e.class};return e.colspan&&(n.colspan=e.colspan),t("td",n,e.content)}))}(t,{h:e,style:r})))),direction:t?"rtl":"ltr"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"QlikView Sans, sans-serif","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const me=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),fe=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),pe=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),he={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>me.test(e),isRtlChar:e=>fe.test(e)||pe.test(e),detectTextDirection(e){const t=e?e.length:0;let r,n;for(r=0;r<t;r++){if(n=e[r],he.isLtrChar(n))return"ltr";if(he.isRtlChar(n))return"rtl"}return"ltr"}},ye={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,r){const n=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(r.coloring.label&&(a.label=""+r.coloring.label),"color"!==r.coloring.type&&n.fillTooltip){const e=i("fill"),t="measure"===r.coloring.fieldType;if(a.value=t&&e?e(n.fillTooltip.value):n.fillTooltip.label?n.fillTooltip.label:n.fillTooltip.value,!r.coloring.label){const e=o(n.fillTooltip.source.key).field(n.fillTooltip.source.field).title();a.label=""+e}}return a.fill=void 0===n._fillColor?ye.getNodeFillColor(t):n._fillColor,a},getMeasure:(e,t)=>({label:""+e(t.source.key).field(t.source.field).title(),value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const r=he.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:r},colspan:2},{}]},getDescriptionRow(e,t){const r=he.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:r},colspan:2},{}]},getNMoreRow(e,t,r){const n=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:n,style:{"font-weight":"bold","text-align":r?"right":"left",direction:he.detectTextDirection(n)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",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:2},{}],getColorRow(e,t,r){const n=he.detectTextDirection(t.color.label),i=r?[":",t.color.label]:[t.color.label,":"],o=he.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":r?"right":"left",direction:n}},{content:r?[t.color.value,ye.getColorSymbol(e,t)]:[ye.getColorSymbol(e,t),t.color.value],style:{"text-align":r?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,r,n,i=!1){const o=he.detectTextDirection(e.label),a=n?[":",e.label]:[e.label,":"],s=he.detectTextDirection(e.value);let l;return l=i?n?[e.value,ye.getColorSymbol(t,r)]:[ye.getColorSymbol(t,r),e.value]:[e.value],[{content:a,style:{"text-align":n?"right":"left",direction:o}},{content:l,style:{"text-align":n?"left":"right",direction:s,"vertical-align":"middle"}}]}};function ge(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ve(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function be(){}var xe=1/.7,Me="\\s*([+-]?\\d+)\\s*",Se="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ce=/^#([0-9a-f]{3,8})$/,qe=new RegExp("^rgb\\("+[Me,Me,Me]+"\\)$"),Oe=new RegExp("^rgb\\("+[Ee,Ee,Ee]+"\\)$"),Ae=new RegExp("^rgba\\("+[Me,Me,Me,Se]+"\\)$"),De=new RegExp("^rgba\\("+[Ee,Ee,Ee,Se]+"\\)$"),Ne=new RegExp("^hsl\\("+[Se,Ee,Ee]+"\\)$"),Ie=new RegExp("^hsla\\("+[Se,Ee,Ee,Se]+"\\)$"),Te={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function we(){return this.rgb().formatHex()}function Le(){return this.rgb().formatRgb()}function Re(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ce.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?ke(t):3===r?new Ve(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Pe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Pe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=qe.exec(e))?new Ve(t[1],t[2],t[3],1):(t=Oe.exec(e))?new Ve(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ae.exec(e))?Pe(t[1],t[2],t[3],t[4]):(t=De.exec(e))?Pe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ne.exec(e))?$e(t[1],t[2]/100,t[3]/100,1):(t=Ie.exec(e))?$e(t[1],t[2]/100,t[3]/100,t[4]):Te.hasOwnProperty(e)?ke(Te[e]):"transparent"===e?new Ve(NaN,NaN,NaN,0):null}function ke(e){return new Ve(e>>16&255,e>>8&255,255&e,1)}function Pe(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ve(e,t,r,n)}function je(e){return e instanceof be||(e=Re(e)),e?new Ve((e=e.rgb()).r,e.g,e.b,e.opacity):new Ve}function Fe(e,t,r,n){return 1===arguments.length?je(e):new Ve(e,t,r,null==n?1:n)}function Ve(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function _e(){return"#"+He(this.r)+He(this.g)+He(this.b)}function ze(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function He(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function $e(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,r,n)}function Be(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof be||(e=Re(e)),!e)return new Ue;if(e instanceof Ue)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ue(a,s,l,e.opacity)}function Ue(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Ye(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}ge(be,Re,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:we,formatHex:we,formatHsl:function(){return Be(this).formatHsl()},formatRgb:Le,toString:Le}),ge(Ve,Fe,ve(be,{brighter:function(e){return e=null==e?xe:Math.pow(xe,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_e,formatHex:_e,formatRgb:ze,toString:ze})),ge(Ue,(function(e,t,r,n){return 1===arguments.length?Be(e):new Ue(e,t,r,null==n?1:n)}),ve(be,{brighter:function(e){return e=null==e?xe:Math.pow(xe,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ve(Ye(e>=240?e-240:e+120,i,n),Ye(e,i,n),Ye(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var We=Math.PI/180,Ge=180/Math.PI,Ke=4/29,Xe=6/29,Je=3*Xe*Xe;function Ze(e){if(e instanceof Qe)return new Qe(e.l,e.a,e.b,e.opacity);if(e instanceof at)return st(e);e instanceof Ve||(e=je(e));var t,r,n=nt(e.r),i=nt(e.g),o=nt(e.b),a=et((.2225045*n+.7168786*i+.0606169*o)/1);return n===i&&i===o?t=r=a:(t=et((.4360747*n+.3850649*i+.1430804*o)/.96422),r=et((.0139322*n+.0971045*i+.7141733*o)/.82521)),new Qe(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Qe(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function et(e){return e>.008856451679035631?Math.pow(e,1/3):e/Je+Ke}function tt(e){return e>Xe?e*e*e:Je*(e-Ke)}function rt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function it(e){if(e instanceof at)return new at(e.h,e.c,e.l,e.opacity);if(e instanceof Qe||(e=Ze(e)),0===e.a&&0===e.b)return new at(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ge;return new at(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ot(e,t,r,n){return 1===arguments.length?it(e):new at(e,t,r,null==n?1:n)}function at(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function st(e){if(isNaN(e.h))return new Qe(e.l,0,0,e.opacity);var t=e.h*We;return new Qe(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ge(Qe,(function(e,t,r,n){return 1===arguments.length?Ze(e):new Qe(e,t,r,null==n?1:n)}),ve(be,{brighter:function(e){return new Qe(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Qe(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Ve(rt(3.1338561*(t=.96422*tt(t))-1.6168667*(e=1*tt(e))-.4906146*(r=.82521*tt(r))),rt(-.9787684*t+1.9161415*e+.033454*r),rt(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),ge(at,ot,ve(be,{brighter:function(e){return new at(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new at(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return st(this).rgb()}}));var lt={isDark:function(e){return ot(e).l<70}};function ut(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ct(e){return 1===e.length&&(e=function(e){return function(t,r){return ut(e(t),r)}}(e)),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)<0?n=o+1:i=o}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)>0?i=o:n=o+1}return n}}}var dt=ct(ut).right,mt=Math.sqrt(50),ft=Math.sqrt(10),pt=Math.sqrt(2);function ht(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,i);return i>=0?(o>=mt?10:o>=ft?5:o>=pt?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=mt?10:o>=ft?5:o>=pt?2:1)}function yt(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=mt?i*=10:o>=ft?i*=5:o>=pt&&(i*=2),t<e?-i:i}function gt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function vt(){}function bt(e,t){var r=new vt;if(e instanceof vt)e.each((function(e,t){r.set(t,e)}));else if(Array.isArray(e)){var n,i=-1,o=e.length;if(null==t)for(;++i<o;)r.set(i,e[i]);else for(;++i<o;)r.set(t(n=e[i],i,e),n)}else if(e)for(var a in e)r.set(a,e[a]);return r}function xt(){}vt.prototype=bt.prototype={constructor:vt,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var Mt=bt.prototype;xt.prototype={constructor:xt,has:Mt.has,add:function(e){return this["$"+(e+="")]=e,this},remove:Mt.remove,clear:Mt.clear,values:Mt.keys,size:Mt.size,empty:Mt.empty,each:Mt.each};var St=Array.prototype,Et=St.map,Ct=St.slice;function qt(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ot(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function At(){}var Dt=1/.7,Nt="\\s*([+-]?\\d+)\\s*",It="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wt=/^#([0-9a-f]{3})$/,Lt=/^#([0-9a-f]{6})$/,Rt=new RegExp("^rgb\\("+[Nt,Nt,Nt]+"\\)$"),kt=new RegExp("^rgb\\("+[Tt,Tt,Tt]+"\\)$"),Pt=new RegExp("^rgba\\("+[Nt,Nt,Nt,It]+"\\)$"),jt=new RegExp("^rgba\\("+[Tt,Tt,Tt,It]+"\\)$"),Ft=new RegExp("^hsl\\("+[It,Tt,Tt]+"\\)$"),Vt=new RegExp("^hsla\\("+[It,Tt,Tt,It]+"\\)$"),_t={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function zt(e){var t;return e=(e+"").trim().toLowerCase(),(t=wt.exec(e))?new Yt((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Lt.exec(e))?Ht(parseInt(t[1],16)):(t=Rt.exec(e))?new Yt(t[1],t[2],t[3],1):(t=kt.exec(e))?new Yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Pt.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=jt.exec(e))?$t(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ft.exec(e))?Gt(t[1],t[2]/100,t[3]/100,1):(t=Vt.exec(e))?Gt(t[1],t[2]/100,t[3]/100,t[4]):_t.hasOwnProperty(e)?Ht(_t[e]):"transparent"===e?new Yt(NaN,NaN,NaN,0):null}function Ht(e){return new Yt(e>>16&255,e>>8&255,255&e,1)}function $t(e,t,r,n){return n<=0&&(e=t=r=NaN),new Yt(e,t,r,n)}function Bt(e){return e instanceof At||(e=zt(e)),e?new Yt((e=e.rgb()).r,e.g,e.b,e.opacity):new Yt}function Ut(e,t,r,n){return 1===arguments.length?Bt(e):new Yt(e,t,r,null==n?1:n)}function Yt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Wt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Gt(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xt(e,t,r,n)}function Kt(e){if(e instanceof Xt)return new Xt(e.h,e.s,e.l,e.opacity);if(e instanceof At||(e=zt(e)),!e)return new Xt;if(e instanceof Xt)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Xt(a,s,l,e.opacity)}function Xt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Jt(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}qt(At,zt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),qt(Yt,Ut,Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+Wt(this.r)+Wt(this.g)+Wt(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),qt(Xt,(function(e,t,r,n){return 1===arguments.length?Kt(e):new Xt(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new Xt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Xt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Yt(Jt(e>=240?e-240:e+120,i,n),Jt(e,i,n),Jt(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Zt=Math.PI/180,Qt=180/Math.PI,er=4/29,tr=6/29,rr=3*tr*tr;function nr(e){if(e instanceof ir)return new ir(e.l,e.a,e.b,e.opacity);if(e instanceof cr){if(isNaN(e.h))return new ir(e.l,0,0,e.opacity);var t=e.h*Zt;return new ir(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof Yt||(e=Bt(e));var r,n,i=lr(e.r),o=lr(e.g),a=lr(e.b),s=or((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?r=n=s:(r=or((.4360747*i+.3850649*o+.1430804*a)/.96422),n=or((.0139322*i+.0971045*o+.7141733*a)/.82521)),new ir(116*s-16,500*(r-s),200*(s-n),e.opacity)}function ir(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function or(e){return e>.008856451679035631?Math.pow(e,1/3):e/rr+er}function ar(e){return e>tr?e*e*e:rr*(e-er)}function sr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function lr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ur(e){if(e instanceof cr)return new cr(e.h,e.c,e.l,e.opacity);if(e instanceof ir||(e=nr(e)),0===e.a&&0===e.b)return new cr(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Qt;return new cr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function cr(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}qt(ir,(function(e,t,r,n){return 1===arguments.length?nr(e):new ir(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return new ir(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new ir(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Yt(sr(3.1338561*(t=.96422*ar(t))-1.6168667*(e=1*ar(e))-.4906146*(r=.82521*ar(r))),sr(-.9787684*t+1.9161415*e+.033454*r),sr(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),qt(cr,(function(e,t,r,n){return 1===arguments.length?ur(e):new cr(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return new cr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new cr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return nr(this).rgb()}}));var dr=-.29227,mr=-.90649,fr=1.97294,pr=fr*mr,hr=1.78277*fr,yr=-.6557636667999999;function gr(e){if(e instanceof vr)return new vr(e.h,e.s,e.l,e.opacity);e instanceof Yt||(e=Bt(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(yr*n+pr*t-hr*r)/(yr+pr-hr),o=n-i,a=(fr*(r-i)-dr*o)/mr,s=Math.sqrt(a*a+o*o)/(fr*i*(1-i)),l=s?Math.atan2(a,o)*Qt-120:NaN;return new vr(l<0?l+360:l,s,i,e.opacity)}function vr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function br(e){return function(){return e}}function xr(e){return 1==(e=+e)?Mr:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):br(isNaN(t)?r:t)}}function Mr(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):br(isNaN(e)?t:e)}qt(vr,(function(e,t,r,n){return 1===arguments.length?gr(e):new vr(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new vr(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new vr(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*Zt,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new Yt(255*(t+r*(-.14861*n+1.78277*i)),255*(t+r*(dr*n+mr*i)),255*(t+r*(fr*n)),this.opacity)}}));var Sr=function e(t){var r=xr(t);function n(e,t){var n=r((e=Ut(e)).r,(t=Ut(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=Mr(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function Er(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,o=new Array(i),a=new Array(n);for(r=0;r<i;++r)o[r]=Ir(e[r],t[r]);for(;r<n;++r)a[r]=t[r];return function(e){for(r=0;r<i;++r)a[r]=o[r](e);return a}}function Cr(e,t){var r=new Date;return t-=e=+e,function(n){return r.setTime(e+t*n),r}}function qr(e,t){return t-=e=+e,function(r){return e+t*r}}function Or(e,t){var r,n={},i={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Ir(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}var Ar=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dr=new RegExp(Ar.source,"g");function Nr(e,t){var r,n,i,o=Ar.lastIndex=Dr.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(r=Ar.exec(e))&&(n=Dr.exec(t));)(i=n.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:qr(r,n)})),o=Dr.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}function Ir(e,t){var r,n=typeof t;return null==t||"boolean"===n?br(t):("number"===n?qr:"string"===n?(r=zt(t))?(t=r,Sr):Nr:t instanceof zt?Sr:t instanceof Date?Cr:Array.isArray(t)?Er:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Or:qr)(e,t)}function Tr(e,t){return t-=e=+e,function(r){return Math.round(e+t*r)}}function wr(e){return+e}var Lr=[0,1];function Rr(e){return e}function kr(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Pr(e){var t,r=e[0],n=e[e.length-1];return r>n&&(t=r,r=n,n=t),function(e){return Math.max(r,Math.min(n,e))}}function jr(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=kr(i,n),o=r(a,o)):(n=kr(n,i),o=r(o,a)),function(e){return o(n(e))}}function Fr(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=kr(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(t){var r=dt(e,t,1,n)-1;return o[r](i[r](t))}}function Vr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _r(e,t){return function(){var e,t,r,n,i,o,a=Lr,s=Lr,l=Ir,u=Rr;function c(){return n=Math.min(a.length,s.length)>2?Fr:jr,i=o=null,d}function d(t){return isNaN(t=+t)?r:(i||(i=n(a.map(e),s,l)))(e(u(t)))}return d.invert=function(r){return u(t((o||(o=n(s,a.map(e),qr)))(r)))},d.domain=function(e){return arguments.length?(a=Et.call(e,wr),u===Rr||(u=Pr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Ct.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Ct.call(e),l=Tr,c()},d.clamp=function(e){return arguments.length?(u=e?Pr(a):Rr,d):u!==Rr},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,c()}}()(e,t)}function zr(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Hr(e){return(e=zr(Math.abs(e)))?e[1]:NaN}var $r,Br=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ur(e){return new Yr(e)}function Yr(e){if(!(t=Br.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function Wr(e,t){var r=zr(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}Ur.prototype=Yr.prototype,Yr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gr={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Wr(100*e,t)},r:Wr,s:function(e,t){var r=zr(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-($r=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+zr(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function Kr(e){return e}var Xr,Jr,Zr,Qr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function en(e){var t,r,n=e.grouping&&e.thousands?(t=e.grouping,r=e.thousands,function(e,n){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[a=(a+1)%t.length];return o.reverse().join(r)}):Kr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):Kr,s=e.percent||"%";function l(e){var t=(e=Ur(e)).fill,r=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,m=e.comma,f=e.precision,p=e.trim,h=e.type;"n"===h?(m=!0,h="g"):Gr[h]||(null==f&&(f=12),p=!0,h="g"),(c||"0"===t&&"="===r)&&(c=!0,t="0",r="=");var y="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",g="$"===u?i[1]:/[%p]/.test(h)?s:"",v=Gr[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=y,M=g;if("c"===h)M=v(e)+M,e="";else{var S=(e=+e)<0;if(e=v(Math.abs(e),f),p&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(i>0){if(!+e[n])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&(S=!1),x=(S?"("===l?l:"-":"-"===l||"("===l?"":l)+x,M=("s"===h?Qr[8+$r/3]:"")+M+(S&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){M=(46===u?o+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}m&&!c&&(e=n(e,1/0));var E=x.length+e.length+M.length,C=E<d?new Array(d-E+1).join(t):"";switch(m&&c&&(e=n(C+e,C.length?d-M.length:1/0),C=""),r){case"<":e=x+e+M+C;break;case"=":e=x+C+e+M;break;case"^":e=C.slice(0,E=C.length>>1)+x+e+M+C.slice(E);break;default:e=C+x+e+M}return a(e)}return f=null==f?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var r=l(((e=Ur(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(Hr(t)/3))),i=Math.pow(10,-n),o=Qr[8+n/3];return function(e){return r(i*e)+o}}}}function tn(e,t,r,n){var i,o=yt(e,t,r);switch((n=Ur(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Hr(t)/3)))-Hr(Math.abs(e)))}(o,a))||(n.precision=i),Zr(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hr(t)-Hr(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(e){return Math.max(0,-Hr(Math.abs(e)))}(o))||(n.precision=i-2*("%"===n.type))}return Jr(n)}function rn(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,i,o,a,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t<e)&&(i=e,e=t,t=i),0===(a=ht(e,t,r))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return n&&o.reverse(),o}(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return tn(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(n=s,s=l,l=n,n=o,o=a,a=n),(n=ht(s,l,r))>0?n=ht(s=Math.floor(s/n)*n,l=Math.ceil(l/n)*n,r):n<0&&(n=ht(s=Math.ceil(s*n)/n,l=Math.floor(l*n)/n,r)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(l/n)*n,t(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(l*n)/n,t(i)),e},e}function nn(){var e=_r(Rr,Rr);return e.copy=function(){return Vr(e,nn())},gt.apply(e,arguments),rn(e)}Xr=en({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Jr=Xr.format,Zr=Xr.formatPrefix;var on=new Date,an=new Date;function sn(e,t,r,n){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},i.round=function(e){var t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=function(e,r){return t(e=new Date(+e),null==r?1:Math.floor(r)),e},i.range=function(r,n,o){var a,s=[];if(r=i.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return s;do{s.push(a=new Date(+r)),t(r,o),e(r)}while(a<r&&r<n);return s},i.filter=function(r){return sn((function(t){if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(i.count=function(t,n){return on.setTime(+t),an.setTime(+n),e(on),e(an),Math.floor(r(on,an))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(n?function(t){return n(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var ln=sn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));ln.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?sn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):ln:null};var un=sn((function(e){e.setTime(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}));sn((function(e){e.setTime(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),sn((function(e){var t=6e4*e.getTimezoneOffset()%36e5;t<0&&(t+=36e5),e.setTime(36e5*Math.floor((+e-t)/36e5)+t)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}));var cn=sn((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}));function dn(e){return sn((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}))}var mn=dn(0),fn=dn(1);dn(2),dn(3);var pn=dn(4);dn(5),dn(6),sn((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()}));var hn=sn((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()}));hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var yn=sn((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()})),gn=sn((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()})),vn=sn((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 bn(e){return sn((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}))}var xn=bn(0),Mn=bn(1);bn(2),bn(3);var Sn=bn(4);bn(5),bn(6);var En=sn((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()})),Cn=sn((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()}));function qn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function On(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function An(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}Cn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var Dn,Nn,In,Tn={"-":"",_:" ",0:"0"},wn=/^\s*\d+/,Ln=/^%/,Rn=/[\\^$*+?|[\]().{}]/g;function kn(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(t)+i:i)}function Pn(e){return e.replace(Rn,"\\$&")}function jn(e){return new RegExp("^(?:"+e.map(Pn).join("|")+")","i")}function Fn(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function Vn(e,t,r){var n=wn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function _n(e,t,r){var n=wn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function zn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Hn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function $n(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Bn(e,t,r){var n=wn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Un(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Yn(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Wn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Gn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Kn(e,t,r){var n=wn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Xn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Jn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Zn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Qn(e,t,r){var n=wn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ei(e,t,r){var n=wn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ti(e,t,r){var n=Ln.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function ri(e,t,r){var n=wn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function ni(e,t,r){var n=wn.exec(t.slice(r));return n?(e.Q=1e3*+n[0],r+n[0].length):-1}function ii(e,t){return kn(e.getDate(),t,2)}function oi(e,t){return kn(e.getHours(),t,2)}function ai(e,t){return kn(e.getHours()%12||12,t,2)}function si(e,t){return kn(1+cn.count(hn(e),e),t,3)}function li(e,t){return kn(e.getMilliseconds(),t,3)}function ui(e,t){return li(e,t)+"000"}function ci(e,t){return kn(e.getMonth()+1,t,2)}function di(e,t){return kn(e.getMinutes(),t,2)}function mi(e,t){return kn(e.getSeconds(),t,2)}function fi(e){var t=e.getDay();return 0===t?7:t}function pi(e,t){return kn(mn.count(hn(e),e),t,2)}function hi(e,t){var r=e.getDay();return e=r>=4||0===r?pn(e):pn.ceil(e),kn(pn.count(hn(e),e)+(4===hn(e).getDay()),t,2)}function yi(e){return e.getDay()}function gi(e,t){return kn(fn.count(hn(e),e),t,2)}function vi(e,t){return kn(e.getFullYear()%100,t,2)}function bi(e,t){return kn(e.getFullYear()%1e4,t,4)}function xi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kn(t/60|0,"0",2)+kn(t%60,"0",2)}function Mi(e,t){return kn(e.getUTCDate(),t,2)}function Si(e,t){return kn(e.getUTCHours(),t,2)}function Ei(e,t){return kn(e.getUTCHours()%12||12,t,2)}function Ci(e,t){return kn(1+vn.count(Cn(e),e),t,3)}function qi(e,t){return kn(e.getUTCMilliseconds(),t,3)}function Oi(e,t){return qi(e,t)+"000"}function Ai(e,t){return kn(e.getUTCMonth()+1,t,2)}function Di(e,t){return kn(e.getUTCMinutes(),t,2)}function Ni(e,t){return kn(e.getUTCSeconds(),t,2)}function Ii(e){var t=e.getUTCDay();return 0===t?7:t}function Ti(e,t){return kn(xn.count(Cn(e),e),t,2)}function wi(e,t){var r=e.getUTCDay();return e=r>=4||0===r?Sn(e):Sn.ceil(e),kn(Sn.count(Cn(e),e)+(4===Cn(e).getUTCDay()),t,2)}function Li(e){return e.getUTCDay()}function Ri(e,t){return kn(Mn.count(Cn(e),e),t,2)}function ki(e,t){return kn(e.getUTCFullYear()%100,t,2)}function Pi(e,t){return kn(e.getUTCFullYear()%1e4,t,4)}function ji(){return"+0000"}function Fi(){return"%"}function Vi(e){return+e}function _i(e){return Math.floor(+e/1e3)}!function(e){Dn=function(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=jn(i),c=Fn(i),d=jn(o),m=Fn(o),f=jn(a),p=Fn(a),h=jn(s),y=Fn(s),g=jn(l),v=Fn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:ii,e:ii,f:ui,H:oi,I:ai,j:si,L:li,m:ci,M:di,p:function(e){return i[+(e.getHours()>=12)]},Q:Vi,s:_i,S:mi,u:fi,U:pi,V:hi,w:yi,W:gi,x:null,X:null,y:vi,Y:bi,Z:xi,"%":Fi},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Mi,e:Mi,f:Oi,H:Si,I:Ei,j:Ci,L:qi,m:Ai,M:Di,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:Vi,s:_i,S:Ni,u:Ii,U:Ti,V:wi,w:Li,W:Ri,x:null,X:null,y:ki,Y:Pi,Z:ji,"%":Fi},M={a:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=p[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=d.exec(t.slice(r));return n?(e.w=m[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=g.exec(t.slice(r));return n?(e.m=v[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=h.exec(t.slice(r));return n?(e.m=y[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return C(e,t,r,n)},d:Gn,e:Gn,f:ei,H:Xn,I:Xn,j:Kn,L:Qn,m:Wn,M:Jn,p:function(e,t,r){var n=u.exec(t.slice(r));return n?(e.p=c[n[0].toLowerCase()],r+n[0].length):-1},Q:ri,s:ni,S:Zn,u:_n,U:zn,V:Hn,w:Vn,W:$n,x:function(e,t,n){return C(e,r,t,n)},X:function(e,t,r){return C(e,n,t,r)},y:Un,Y:Bn,Z:Yn,"%":ti};function S(e,t){return function(r){var n,i,o,a=[],s=-1,l=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Tn[n=e.charAt(++s)])?n=e.charAt(++s):i="e"===n?" ":"0",(o=t[n])&&(n=o(r,i)),a.push(n),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(r){var n,i,o=An(1900);if(C(o,e,r+="",0)!=r.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(n=On(An(o.y))).getUTCDay(),n=i>4||0===i?Mn.ceil(n):Mn(n),n=vn.offset(n,7*(o.V-1)),o.y=n.getUTCFullYear(),o.m=n.getUTCMonth(),o.d=n.getUTCDate()+(o.w+6)%7):(i=(n=t(An(o.y))).getDay(),n=i>4||0===i?fn.ceil(n):fn(n),n=cn.offset(n,7*(o.V-1)),o.y=n.getFullYear(),o.m=n.getMonth(),o.d=n.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?On(An(o.y)).getUTCDay():t(An(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,On(o)):t(o)}}function C(e,t,r,n){for(var i,o,a=0,s=t.length,l=r.length;a<s;){if(n>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=M[i in Tn?t.charAt(a++):i])||(n=o(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return b.x=S(r,b),b.X=S(n,b),b.c=S(t,b),x.x=S(r,x),x.X=S(n,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",qn);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e,On);return t.toString=function(){return e},t}}}(e),Nn=Dn.utcFormat,In=Dn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||Nn("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||In("%Y-%m-%dT%H:%M:%S.%LZ");function zi(e){return new Date(e)}function Hi(e){return e instanceof Date?+e:+new Date(+e)}function $i(e,t,r,n,i,o,a,s,l){var u=_r(Rr,Rr),c=u.invert,d=u.domain,m=l(".%L"),f=l(":%S"),p=l("%I:%M"),h=l("%I %p"),y=l("%a %d"),g=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function M(s){return(a(s)<s?m:o(s)<s?f:i(s)<s?p:n(s)<s?h:t(s)<s?r(s)<s?y:g:e(s)<s?v:b)(s)}function S(t,r,n,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(n-r)/t,a=ct((function(e){return e[2]})).right(x,o);a===x.length?(i=yt(r/31536e6,n/31536e6,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(yt(r,n,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(Et.call(e,Hi)):d().map(zi)},u.ticks=function(e,t){var r,n=d(),i=n[0],o=n[n.length-1],a=o<i;return a&&(r=i,i=o,o=r),r=(r=S(e,i,o,t))?r.range(i,o+1):[],a?r.reverse():r},u.tickFormat=function(e,t){return null==t?M:l(t)},u.nice=function(e,t){var r=d();return(e=S(e,r[0],r[r.length-1],t))?d(function(e,t){var r,n=0,i=(e=e.slice()).length-1,o=e[n],a=e[i];return a<o&&(r=n,n=i,i=r,r=o,o=a,a=r),e[n]=t.floor(o),e[i]=t.ceil(a),e}(r,e)):u},u.copy=function(){return Vr(u,$i(e,t,r,n,i,o,a,s,l))},u}const Bi={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Ui=e=>e+" 12px -12px inset rgba(0, 0, 0, 0.0625)";var Yi={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:r,rtl:n}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=Bi[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Ui(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Ui(t.shadow.endOffset)}}})(r),u="horizontal"===r&&n,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function Wi({viewState:e,viewCache:t,layoutService:r,dockService:n,rtl:i}){return!r.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:n.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:r}){return e.meta.isContinuous?function(e,t){const r=e.get("zoom"),n=t.get("continuousMin"),i=t.get("continuousMax");return[(r.min-n)/(i-n),(r.max-n)/(i-n)]}(t,r):function(e){return e.get("viewRange")}(t)}({layoutService:r,viewState:e,viewCache:t})}}}let Gi;function Ki(){Gi=Gi||document.createElement("canvas").getContext("2d")}const Xi={measureTextWidth(e){Ki();const{width:t}=Gi.measureText(e);return t},lineWrap(e,t,r,n){let i,o;Ki();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof n&&a.length>=n)return a.slice(0,n);for(r&&(Gi.font=r),o=0;o<a.length;o++){for(d=a[o]||"",m=d.split(/\s+/),[f]=m,c="",i=1;i<m.length;i++)if(l=`${f} ${m[i]}`,u=Xi.measureTextWidth(l),u>t&&("number"!=typeof n||n>s.length)?(s.push(f),f=m[i]):f=l,"number"==typeof n&&s.length>=n){c=m.slice(i+1).join(" ");break}"number"!=typeof n||s.length<n?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${f} ${c}`}return s},wordWrap(e,t,r,n,i){if(Ki(),!e||!e.length)return[];r&&(Gi.font=r);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||Xi.measureTextWidth(u)<=t?o.push(u):(s=Xi.splitWord(u,t,void 0,n-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?Xi.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=n?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,r)=>{r[t]=e?e.trim():e})),o.length>n?(o=o.splice(0,n),o[o.length-1]=Xi.truncate(o[o.length-1],t,r,i).text):(u=o[o.length-1],u&&u.length>1&&Xi.measureTextWidth(u)>t&&(o[o.length-1]=Xi.truncate(u,t,r,i).text)),o},truncate(e,t,r,n="…"){Ki();let i,o,a,s,l=e;const u=Xi.measureTextWidth("i"),c=Math.ceil(t/u);if(r&&(Gi.font=r),e&&t){if(Xi.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+n,Xi.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,r,n){let i;Ki();let o,a=e,s="",l=[];if(Xi.isNumber(r)&&r<=1)return[e];const u=Math.ceil(t/n);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Xi.measureTextWidth(a)<=t));i--);return(!i&&!a||Xi.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Xi.measureTextWidth(s)>t?(s=Xi.explodeWord(s,t,r-1,n),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,r,n)=>(Ki(),e&&t?(r&&(Gi.font=r),Xi.explodeWord(e,t,n,Math.max(1,Xi.measureTextWidth("i")))):[]),wrapText(e,t,r,n,i){let o;return Number.isNaN(t)?[e]:(o=n>1?Xi.lineWrap(e,t,r,n):[e],o=Xi.wordWrap(o,t,r,n,i),o)},getFontHeight:e=>(Ki(),e&&(Gi.font=e),1.5*Xi.measureTextWidth("m")),tokenize(e,t,r,n,i,o,a=1){Ki(),t&&(Gi.font=t);const s=Xi.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const m=o?Math.max(1,Math.floor(o/l)):n||1;return Array.isArray(n)?(n.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),n.forEach((e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)}))):u=[Number.isNaN(n)||n<=0?m:Math.min(m,n)],Array.isArray(e)?e.forEach(((e,r)=>{d.length<m&&(d=d.concat(Xi.wrapText(e,i,t,u[r])))})):d=Xi.wrapText(e,i,t,u[0],r),d}},Ji={getDefaultSettings:({size:e=10,fill:t="#999",alignment:r}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:r}),createOob({oob:e,dockValue:t,boxCenter:r,rendWidth:n,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=n,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=n,d=t<.5?180:0),a(U({},e,{[s]:r*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},Zi=U.bind(null,!0),Qi={},{isArray:eo}=Array;function to(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function ro(e){return void 0===e}function no(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function io(e,t){const r=t.substring(1).split("/").slice(0,-1);let n;return r.forEach(((t,i)=>{if(i===r.length)return;n=+t;const o=isNaN(n)?{}:[];e[n||t]=ro(e[n||t])?o:e[t],e=e[n||t]})),e}function oo(e,t){let r=!0;if(to(e)&&to(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((n=>{oo(e[n],t[n])||(r=!1)})),r);if(eo(e)&&eo(t)){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r+=1)if(!oo(e[r],t[r]))return!1;return!0}return e===t}Qi.generate=function(e,t,r){r=r||"";let n=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?Zi({},{val:e}).val:e}(t[i]),a=e[i],s=`${r}/${i}`;oo(o,a)||no(t,i)||(ro(a)?n.push({op:"add",path:s,value:o}):to(o)&&to(a)?n=n.concat(Qi.generate(a,o,s)):eo(o)&&eo(a)?n=n.concat(function(e,t,r){let n=[];const i=e.slice();let o=-1;function a(e,t,r){if(e[r]&&ro(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(let r=0,n=e.length;r<n;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(oo(t,i))return n;if(!ro(t[0])&&ro(t[0].qInfo)||0===t.length)return n.push({op:"replace",path:r,value:t}),n;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(n.push({op:"remove",path:`${r}/${e}`}),i.splice(e,1)):n=n.concat(Qi.generate(i[e],t[o],`${r}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(n.push({op:"add",path:`${r}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(n.push({op:"move",path:`${r}/${e}`,from:`${r}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return n}(a,o,s)):n.push({op:"replace",path:`${r}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{ro(t[i])&&!no(e,i)&&n.push({op:"remove",path:`${r}/${i}`})})),n},Qi.apply=function(e,t){t.forEach((t=>{let r=io(e,t.path),n=t.path.split("/").splice(-1)[0],i=n&&isNaN(+n)?r[n]:r[+n]||r;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,i=e),"add"===t.op||"replace"===t.op)if(eo(r))"-"===n&&(n=r.length),r.splice(+n,"add"===t.op?0:1,t.value);else if(eo(i)&&eo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(to(i)&&to(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!no(a,e)&&delete a[e]})),Zi(i,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[n]=t.value}else if("move"===t.op){const i=io(e,t.from);eo(r)?r.splice(+n,0,i.splice(+o,1)[0]):(r[n]=i[o],delete i[o])}else"remove"===t.op&&(eo(r)?r.splice(+n,1):delete r[n]);var a}))},Qi.clone=function(e){return Zi({},e)},Qi.createPatch=function(e,t,r){const n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},Qi.updateObject=function(e,t){Object.keys(e).length?Qi.apply(e,Qi.generate(e,t)):Zi(e,t)};const ao=[[2,4,6],[2,4],[3]],so=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function lo(e,t,r){const n=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<n;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==r&&(o=Math.min(o,r/e[n-1])),e.splice(0,0,o)}function uo(e,t,r){let n;const i=e?e.length:0;for(n=0;n<i;n++)lo(e[n],t,r)}!function(){let e,t;for(uo(ao,1,10),e=0;e<so.length;e++)if(so[e])for(t=0;t<so[e].length;t++)Array.isArray(so[e][t])&&uo(so[e][t])}();const co={isInside(e,t,r,n){if(!n)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=r},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const r=e.position<t.position?e:t,n=e.position<t.position?t:e;return n.position-n.radius-(r.position+r.radius)},findSegmentPositionMeetMax(e,t){const r=Math.max(0,e.max-t);return e.center-r},findSegmentPositionMeetMin(e,t){const r=Math.max(0,t-e.min);return e.center+r},findSegmentPositionMeetMinThenMax(e,t,r){const n=co.findSegmentPositionMeetMin(e,t);return co.findSegmentPositionMeetMax({center:n,max:n+e.radius},r)},findSegmentPositionMeetMaxThenMin(e,t,r){const n=co.findSegmentPositionMeetMax(e,r);return co.findSegmentPositionMeetMin({center:n,min:n-e.radius},t)},layoutPositionFromMin(e,t,r,n=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=co.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-n)/2),s=o.position+o.radius+n/2;a.position=co.findSegmentPositionMeetMaxThenMin(a,s,r)},adjustPositionFromMax(e,t,r,n=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-r);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,co.getGap(s,a)-n),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,r,n=0){const i=e.length-1;if(!(i<0))if(0!==i)co.layoutPositionFromMin(e,t,r,n),co.adjustPositionFromMax(e,t,r,n);else{const n=e[0];n.position=co.findSegmentPositionMeetMaxThenMin(n,t,r)}}},mo=(e,t,r,n=1)=>{const i=e.bandwidth();return r?"start"===t?i:"end"===t?i*(1-n):i*(2-n)/2:"start"===t?0:"end"===t?i*n:i*n/2},fo=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,po=e=>e.filter(fo),ho=(e,t)=>po(te(e,t,[])),yo=e=>fo(e)&&(!1!==e.showValue||!1!==e.showLabel),go=e=>e.filter(yo),vo=(e,t)=>go(te(e,t,[])),bo=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,xo=(e,t,r)=>{const{dimensionRefLineInfo:n}=t;if(n[e])return n[e][r]},Mo=({label:e,dataPages:t})=>{const{qArea:r={}}=t||{},{qTop:n,qHeight:i}=r;return void 0!==n&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<n},So=({label:e,dataPages:t})=>{const{qArea:r={}}=t||{},{qTop:n,qHeight:i}=r;return void 0!==n&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=n+i},Eo=({value:e,qMin:t})=>"NaN"!==t&&e<t,Co=({value:e,qMax:t})=>"NaN"!==t&&e>t,qo={isRefLineVisible:fo,getVisibleRefLines:po,getRefLines:ho,getMeasureRefLines:e=>ho(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:ho(e,"refLine.dimRefLines"),isRefLineLabelVisible:yo,getVisibleRefLineLabels:go,getRefLineLabels:vo,getMeasureRefLineLabels:e=>vo(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:vo(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:r,valueInfo:n,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=mo(s,i,o,a.meta.measureCount),s([r,0])+l;if(a.meta.isGroupedByDimension){if(!n)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=n;let u;return l=mo(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:r,invert:n,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:n});for(let n=0;n<r.length;n++){const{id:a,order:s}=r[n],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:r,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(r):u)+l}return l=mo(s,i,o),s(r)+l}return e(r)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:r,layoutService:n})=>{const{isGroupedByDimension:i}=n.meta,o={},a=te(e,"qHyperCube"),s="K"===a.qMode,l=r?r.query.getCurrentDataPage():te(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=te(l,s?"qData.0.qSubNodes":"qMatrix",[]),c=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),d=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<u.length;e++){const t=u[e],r=e+d,n=t[c];o[n]||(o[n]={id:t.qElemNo,qText:t.qText,minOrder:r,maxOrder:r})}})():i?(()=>{let e;for(let t=0;t<u.length;t++){const r=u[t][0],n=u[t][1],i=t+d,a=r[c];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:n.qElemNumber,order:i}):o[a]={id:r.qElemNumber,qText:r.qText,minOrder:i,maxOrder:i,innerValues:[{id:n.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<u.length;e++){const t=u[e][0],r=e+d,n=t[c];o[n]||(o[n]={id:t.qElemNumber,qText:t.qText,minOrder:r,maxOrder:r})}})(),o},getInputValue:bo,extractInfoFromInputValue:xo,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const n=bo({refLineLayout:e,layoutService:r});return xo(n,t,"id")},isDiscreteMinOutOfBounds:Mo,isDiscreteMaxOutOfBounds:So,isContinuousMinOutOfBounds:Eo,isContinuousMaxOutOfBounds:Co,isOutOfRange:({value:e,qMin:t,qMax:r})=>Eo({value:e,qMin:t})||Co({value:e,qMax:r}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&So({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&Mo({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:r})=>"horizontal"===e?t:r};function Oo(e,t,r=70){for(let n=0;n<e.length;n++){const i=e[n];i.lines=Xi.tokenize(i.title,t,"… "+i.valueString,3,r),i.maxNumLines=i.lines.length}}function Ao({title:e,font:t,ellipsis:r,maxNumLines:n=5,maxWidth:i=200}){const o=Xi.tokenize(e,t,r,n,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function Do({oobs:e,font:t,ellipsis:r,maxNumLines:n=5,maxWidth:i=200}){const o=e.map((e=>Ao({title:e.title,font:t,ellipsis:`${r} ${e.valueString}`,maxNumLines:n,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function No(e,t="value"){e.sort(((e,r)=>e[t]-r[t]))}const Io=3,To=2;function wo({inputValue:e,inputValueLabel:t,localeInfo:r}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!r)return!0;const n=`+-${r.qDecimalSep||""}${r.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${n}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const Lo=({label:e,dataPages:t,qMin:r,qMax:n})=>{if(void 0!==r&&void 0!==n){const{inputValue:t}=e;if(qo.isContinuousMaxOutOfBounds({value:t,qMax:n}))return 1;if(qo.isContinuousMinOutOfBounds({value:t,qMin:r}))return-1}return qo.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:qo.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Ro={hasEngineFormat:wo,calculateLabelPositions({labels:e,scale:t,size:r,layoutService:n,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=qo.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===n.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=n.getHyperCubeValue(u),{canBeContinuous:d}=n.meta;let m,f;if(s&&d){const e=n.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,f=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=Lo({label:o,dataPages:c,qMin:m,qMax:f});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:qo.getScaledPosition({scale:t,size:r,value:s,valueInfo:d,align:u,invert:l,layoutService:n,isContinuous:a}),o.center=o.scaledValue*r}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:r,canBeContinuous:n,localeInfo:i}){let o;if(r)for(let r=0;r<e.length;r++){const n=e[r],{value:a,inputValue:s,inputValueLabel:l}=n;o=wo({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,n.valueString=`${he.lrm}(${o})${he.lrm}`,n.title=Ro.getTitle(n)}else if(n)for(let t=0;t<e.length;t++){const r=e[t],{valueText:n,inputValue:a,inputValueLabel:s}=r;o=wo({inputValue:a,inputValueLabel:s,localeInfo:i})?s:n,r.valueString=`${he.lrm}(${o})${he.lrm}`,r.title=Ro.getTitle(r)}else for(let t=0;t<e.length;t++){const r=e[t];o=r.valueText,r.valueString=`${he.lrm}(${o})${he.lrm}`,r.title=Ro.getTitle(r)}},measureLabelsWidth(e,t){for(let r=0;r<e.length;r++){const n=e[r];n.totalWidth=t(n.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,r,n=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-n)/2,a.cMin=o.cMax+n;a.cMax=r}else o.cMax=r},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,r){const n=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(r,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=n},reduceTotalMaxNumLines(e,t,r){const n=Math.floor(r/t);let i=3;do{const t=Ro.getTotalNumLines(e)-n;if(t<=0)return;Ro.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,r=0){for(let n=0;n<e.length;n++){const i=e[n];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+r)/t)))}},addLabelsSize(e,t,r=15,n){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Ro.measureLabelMaxLineWidth(o,n)),o.height=o.lines.length*r}},addLabelSegments(e,t){for(let r=0;r<e.length;r++){const n=e[r],{center:i}=n,o=n[t],a=o/2;n.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:r,lowerLimit:n,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:f,isContinuous:p,isDimension:h}){const y=e.map((e=>e)),g=r;Ro.calculateLabelPositions({labels:e,scale:t,size:g,layoutService:f,orientation:c,rtl:m,isContinuous:p,isDimension:h}),No(e,"center"),Ro.addLabelsNeighborInfo(e,n,i,o),Oo(e,a,s),Ro.reduceTotalMaxNumLines(y,l,i-(y.length-1)*o),"vertical"===c&&(Ro.reduceMaxNumLines(e,l,.05*o),function(e,t,r=70){for(let n=0;n<e.length;n++){const i=e[n];i.lines.length>i.maxNumLines&&(i.lines=Xi.tokenize(i.title,t,"… "+i.valueString,i.maxNumLines,r))}}(e,a,s)),Ro.addLabelsSize(e,s,l,d),Ro.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:r,areaProps:n,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l}=n,{minorCenter:u}=i,{fontSize:c,fontFamily:d,background:m}=t;let f=[];return e.forEach((e=>{const{lines:t}=e,n=t.length,i=t.map(((t,i)=>{const m={type:"text",text:t,title:Ao({title:e.title,font:a,ellipsis:"… "+e.valueString}),dx:0,dy:0,maxWidth:r,width:r,fontSize:c,fontFamily:d,fill:e.fill,baseline:"central",anchor:"middle"};return m[l]=u,m[s]=e.segment.position,m.y+=(i-(n-1)/2)*o,m}));e.background&&f.push(function({minorCenter:e,majorAxis:t,minorAxis:r,label:n,lineHeight:i,background:o}){const{lines:a}=n,{borderRadius:s=Io,padding:l={}}=o,{top:u=To,bottom:c=To,left:d=To,right:m=To}=l,f=a.length,p={type:"rect",rx:s,ry:s,fill:n.background.fill,width:n.width+(d+m),height:n.height+(u+c)};return p[r]=e,p[t]=n.segment.position,p.x-=n.width/2+d,p.y-=f*i/2+u,p}({minorCenter:u,majorAxis:s,minorAxis:l,label:e,lineHeight:o,background:m})),f=f.concat(i)})),f}};function ko(e,t,r){let n;const i=typeof t;if("string"===i||"object"===i)n=e.formatter(t);else if(void 0!==r&&r.data){const e=r.data()&&r.data().fields;n=e&&e[0]?e[0].formatter():null}return n}function Po(e,t,r){return"top"===e||"bottom"===e?function(e,t){const{font:r,lineHeight:n,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Ro.getMaxTextWidth(e)>a&&(Oo(e,r,a),s=Math.max(...e.map((e=>e.lines.length)))),s*n+i+o}(t,r):function(e,t){const{left:r,right:n,maxLabelWidth:i}=t;return Math.min(i,Ro.getMaxTextWidth(e))+r+n}(t,r)}function jo(e,t){return t?e.domain():[0,1]}function Fo(e,t,r,n="value"){let i=e.filter((e=>e[n]>=t));i=i.filter((e=>e[n]<=r));const o=e.filter((e=>e[n]<t)),a=e.filter((e=>e[n]>r));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function Vo(e){let t,r=0;for(let n=1;n<10;n++)t=e(n),r=Math.max(r,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[r,Math.max(r,Math.sqrt(t.width*t.width+t.height*t.height))]}function _o(e,t){return e>9?t[1]:t[0]}function zo({alignment:e,dockValue:t,oobs:r,style:n,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=r?r.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:f,minorDimension:p}=s,h=i[p],y=Ji.createOob({oob:Ji.getDefaultSettings({size:n.size,fill:n.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o}),g="c"+m,v="c"+f,b={type:"circle",r:l,stroke:"transparent",fill:n.text.background.fill,strokeWidth:0};b[v]=h/2,b[g]=a;const x={type:"text",text:c>9?"9+":c,title:Do({oobs:r,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:h,width:h,fontSize:n.text.fontSize,fontFamily:n.text.fontFamily,fill:n.text.fill,baseline:"central",anchor:"middle"};return x[f]=h/2,x[m]=a,[y,b,x]}function Ho(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:Xi.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const $o=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var Bo={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:r,isContinuous:n,localeInfo:i}=this.settings,o=!!n||r.meta.canBeContinuous,a=$o(this.settings.labels),s=ko(this.chart,this.settings.formatter,e);Ro.addLabelTitles({labels:a,formatter:s,isContinuous:n,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:r,canBeContinuous:n,layoutService:i})=>{if(r){const[n,i]=jo(t,r);return Fo(e,n,i)}if(n){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:n}=t;if("NaN"!==r&&"NaN"!==n)return Fo(e,r,n,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:n,canBeContinuous:o,layoutService:r});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Ho(t.label),{dock:r}=this.settings.layout;return Ro.measureLabelsWidth(c,this.measureText),d=Po(r,c,e),d}const m=Vo(this.measureText),f=l?_o(l,m):0,p=u?_o(u,m):0;return d=Math.max(f,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:r,layoutService:n,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||n.meta.canBeContinuous,u=$o(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=r.label,f=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,r){const n=e[t.minorDimension];return{minorSize:n,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(n-r.right-r.left)/2+r.left:(n-r.top-r.bottom)/2+r.top}}(this.rect,f,m),{orientation:h,majorDimension:y}=f,{majorSize:g}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:M}=Ho(r.label),S=ko(this.chart,this.settings.formatter,e),E=g;Ro.addLabelTitles({labels:u,formatter:S,isContinuous:o,canBeContinuous:l,localeInfo:s}),Ro.calculateLabelPositions({labels:u,scale:e,size:E,layoutService:n,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[C,q]=jo(e,o),{filteredLabels:O,lowerOobs:A,upperOobs:D,lowerCircleSize:N,upperCircleSize:I,lowerOobSpace:T,upperOobSpace:w}=function({labels:e,minValue:t,maxValue:r,orientation:n,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=Fo(e,t,r,u),f="scaledValue"!==u&&qo.getInvert({orientation:n,rtl:i,isContinuous:o}),p=function(e,t,r){return r?t:e}(d,c,f),h=function(e,t,r){return r?e:t}(d,c,f),y=p.length,g=h.length,v=Vo(l),b=_o(y,v),x=_o(g,v);return{filteredLabels:m,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:function(e,t,r,n,i){return("vertical"===n?i.top:i.left)+(e>0?t+r:0)}(y,a.oob.size,b,n,s),upperOobSpace:function(e,t,r,n,i){return("vertical"===n?i.bottom:i.right)+(e>0?t+r:0)}(g,a.oob.size,x,n,s)}}({labels:u,minValue:C,maxValue:q,orientation:h,rtl:d,isContinuous:o,style:r,padding:m,measureText:this.measureText,prop:o?"value":"scaledValue"}),L=T,R=g-w;No(A),No(D);const k=zo({alignment:0,dockValue:0,oobs:A,style:r.oob,rect:this.rect,symbol:t,position:r.oob.size+N/2,areaProps:f,radius:N/2,font:v}),P=zo({alignment:1,dockValue:1,oobs:D,style:r.oob,rect:this.rect,symbol:t,position:g-(r.oob.size+I/2),areaProps:f,radius:I/2,font:v});Ro.addLabelsInfo({labels:O,scale:e,majorSize:g,lowerLimit:L,upperLimit:R,font:v,lineHeight:b,gap:x,maxLabelWidth:M,majorDimension:y,orientation:h,measureText:this.measureText,rtl:d,layoutService:n,isContinuous:o,isDimension:a}),co.layout(O.map((e=>e.segment)),L,R,r.label.gap);const j=O.filter((e=>co.isInside(e.segment,L,R,o)));return Ro.createLabels({labels:j,style:r.label,maxLabelWidth:M,areaProps:f,area:p,lineHeight:b,font:v,theme:i}).concat([...k,...P])}};const{getInputValue:Uo,extractInfoFromInputValue:Yo,resolveValue:Wo}=qo;var Go={resolveValue:Wo,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:r})=>{if(r.meta.isGroupedByDimension){const n=Uo({refLineLayout:e,layoutService:r});return Yo(n,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:r})=>{if(r.meta.mode.K)return 0;const n=Uo({refLineLayout:e,layoutService:r});return Yo(n,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const{dimensionValuesInfo:n}=t,{canBeContinuous:i}=r.meta,o=Uo({refLineLayout:e,layoutService:r});return n[o]&&i?n[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const n=Uo({refLineLayout:e,layoutService:r}),{dimensionRefLineInfo:i}=t;return i[n]}};function Ko({isDimension:e,refLineModel:t={},layoutService:r,colorModel:n,dockService:i,chart:o,scale:a,axis:s,rtl:l,key:u,mainComponentKey:c,path:d,minimumLayoutMode:m}){const f=e?t.dimensionRefLines:d?t.query.getRefLines(d):t.measureRefLines;if(!f.length)return!1;const p={key:u,type:"ref-line",layout:{minimumLayoutMode:m},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}})},h=!(!e||"horizontal"!==i.meta.major.orientation||!l),y=!e||r.meta.isContinuous;return f.forEach((l=>{p.lines[s].push((({isDimension:e,refLineLayout:t,refLineModel:r,layoutService:n,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var m,f;const p={dir:l,line:{strokeWidth:(null==t||null===(m=t.style)||void 0===m?void 0:m.lineThickness)||2,strokeDasharray:null==t||null===(f=t.style)||void 0===f?void 0:f.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||n.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):p.value=()=>{var e;const i=qo.getScaledPosition({scale:a.scale(s),value:Go.resolveValue({refLineLayout:t,refLineModel:r,layoutService:n}),valueInfo:Go.resolveValueInfo({refLineLayout:t,refLineModel:r,layoutService:n}),size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:n,isContinuous:d});return Number.isNaN(i)?void 0:i},p})({isDimension:e,refLineLayout:l,refLineModel:t,layoutService:r,colorModel:n,dockService:i,chart:o,scale:a,axis:s,invert:h,component:c,isContinuous:y}))})),p}const Xo={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}};function Jo({isDimension:e,refLineModel:t={},layoutService:r,colorModel:n,dock:i,scale:o,style:a,formatter:s,theme:l,localeInfo:u,rtl:c,key:d,path:m}){const f=e?t.dimensionRefLineLabels:m?t.query.getRefLineLabels(m):t.measureRefLineLabels;if(!f.length)return[];const p=[],h=!e||r.meta.isContinuous,y=f.map((e=>(({refLineLayout:e,refLineModel:t,layoutService:r,colorModel:n,scale:i,theme:o,isContinuous:a})=>{const s=n.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>Go.resolveValue({refLineLayout:e,refLineModel:t,layoutService:r}),l.valueText=()=>Go.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:r}),l.valueInfo=()=>Go.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:r})),l})({refLineLayout:e,refLineModel:t,layoutService:r,colorModel:n,scale:o,theme:l,isContinuous:h})));return p.push((({isDimension:e,layoutService:t,style:r,labels:n,scale:i,formatter:o,dock:a,key:s,rtl:l,theme:u,isContinuous:c,localeInfo:d})=>({key:s,type:"reference-line-labels",renderer:"svg",labels:n,formatter:o,scale:i,layoutService:t,layout:{dock:a,rtl:l},theme:u,isContinuous:c,isDimension:e,localeInfo:d,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:l?2:4,right:l?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===a||"right"===a?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}}}))({isDimension:e,rtl:c,style:U(!0,Xo,a),dock:i,key:d,labels:y,scale:o,formatter:s,layoutService:r,theme:l,isContinuous:h,localeInfo:u})),p}function Zo({layoutService:e,discreteModel:t}){const{isContinuous:r,canBeContinuous:n,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=oe.dimensionless(o),l=qo.getMeasureRefLines(o),u=qo.getDimensionRefLines(o,s),c=qo.getMeasureRefLineLabels(o),d=qo.getDimensionRefLineLabels(o,s);let m={},f={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=qo.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(n){const r=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:i}=r;return qo.isOutOfRange({value:t,qMin:n,qMax:i})}return!1})(o)||(t=>{if(!f[t])return!1;if(!r&&i){const r={valueInfo:f[t]},n="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(n);return qo.isOutOfDataPages({label:r,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:n,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:f,dimensionValuesInfo:m,query:{getRefLines:e=>qo.getRefLines(o,e),getRefLineLabels:e=>qo.getRefLineLabels(o,e)},update:()=>{f=h.dimensionRefLineInfo,p()&&(m=qo.getDimensionValuesInfo({layout:o,canBeContinuous:n,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=m,u.forEach((t=>{const r=qo.getInputValue({refLineLayout:t,layoutService:e});m[r]&&(f[r]?(f[r].innerValues=m[r].innerValues,f[r].minOrder=Math.min(f[r].minOrder,m[r].minOrder),f[r].maxOrder=Math.max(f[r].maxOrder,m[r].maxOrder),f[r].isMinOrderOk=f[r].isMinOrderOk||m[r].isMinOrderOk,f[r].isMaxOrderOk=f[r].isMaxOrderOk||m[r].isMaxOrderOk):f[r]={id:m[r].id,qText:m[r].qText,innerValues:m[r].innerValues,minOrder:m[r].minOrder,maxOrder:m[r].maxOrder,isMinOrderOk:m[r].isMinOrderOk,isMaxOrderOk:m[r].isMaxOrderOk},f[r].numInnerValues=(f[r].maxOrder||0)-(f[r].minOrder||0)+1)})))}};return h.update(),h}const Qo={combineBounds(e){let t=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach((e=>{e&&(t=Math.min(t,e.x,e.x+e.width),r=Math.max(r,e.x,e.x+e.width),n=Math.min(n,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))})),{x:t,y:n,width:r-t,height:i-n}}};var ea={DATA:{MAIN:"qHyperCube",REDUCED:"reduced-data"},SCALE:{MAJOR:"main-major",MAJOR_INNER:"major-inner",MINOR:{PRIMARY:"minor-primary",SECONDARY:"minor-secondary",REDUCED_PRIMARY:"reduced-minor-primary",REDUCED_SECONDARY:"reduced-minor-secondary"},COLOR:"color",REDUCED:"reduced-major"},COMPONENT:{BAR:"bar-series",BAR_LABEL:"bar-label",BAR_OOB_LABEL:"bar-oob-label",STACK_BAR:"stack-bar",STACK_BAR_LABEL:"stack-bar-label",AXIS:{MAJOR:"major-axis",MAJOR_CONTINUOUS:"major-axis-continuous",TIME_INNER:"major-axis-time-inner",TIME_OUTER:"major-axis-time-outer",MINOR:{PRIMARY:"minor-primary-axis",SECONDARY:"minor-secondary-axis"}},AXIS_OVERLAY:{TIME_INNER:"axis-overlay-time-inner",TIME_OUTER:"axis-overlay-time-outer",CONTINUOUS:"axis-overlay-continuous"},AXIS_TITLE:{MAJOR:"major-axis-title",MINOR:{PRIMARY:"minor-primary-axis-title",SECONDARY:"minor-secondary-axis-title"}},MARKER:"marker-series",LINE:"line-series",POINT:"point-component",LABEL_SPACE:"label-space-component",POINT_LABEL:"point-label",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",LEGEND:"legend",LEGEND_CATEGORICAL:"legend-cat",LEGEND_TOOLTIP:"legend-tooltip",TOOLTIP:"tooltip",MINI_CHART:{BAR:"mini-chart-bar-series",LINE:"mini-chart-line-series",MARKER:"mini-chart-marker-series"},BAR_OOB:"bar-oob",GHOST_BAR_OOB:"ghost-bar-oob",SLICED_HAT:"sliced-hat",DATA_OOB_MARKER:"data-out-of-bounds-marker",PRIMARY_MEASURE_AXIS_REF_LINE:"primary-mes-axis-ref-line",SECONDARY_MEASURE_AXIS_REF_LINE:"secondary-mes-axis-ref-line",DIMENSION_REF_LINE:"dim-ref-line",PRIMARY_MEASURE_AXIS_REF_LINE_LABEL:"primary-mes-ref-line-label",SECONDARY_MEASURE_AXIS_REF_LINE_LABEL:"secondary-mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label"},COLLECTION:{PRIMARY:"primary-collection",SECONDARY:"secondary-collection",STACKED_PRIMARY:"stacked-collection-primary",STACKED_SECONDARY:"stacked-collection-secondary",STACKED_TOTAL_PRIMARY:"stacked-total-collection-primary",STACKED_TOTAL_SECONDARY:"stacked-total-collection-secondary",REDUCED:"reduced-collection",REDUCED_PRIMARY:"reduced-collection-primary",REDUCED_SECONDARY:"reduced-collection-secondary",REDUCED_STACKED_PRIMARY:"reduced-collection-stacked-primary",REDUCED_STACKED_SECONDARY:"reduced-collection-stacked-secondary",LINE:"line-collection"},FORMATTER:{PRIMARY:"primary-formatter",SECONDARY:"secondary-formatter"}},ta={LINE:"line",BAR:"bar",MARKER:"marker"},ra={PRIMARY:0,SECONDARY:1},na={type:"bar",axis:0};const ia={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 oa(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const aa={getImageSize(e,t){let r;function n(){r&&(clearTimeout(r),r=null)}function i(e){const t=e;t.onload=null,t.onerror=null,n()}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:r,width:l}=s,u=o[t]*(r>l?1:r/l),c=o[t]*(l>r?1:l/r);!r||!l||0===r&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,r),width:Math.min(c,l)},n()):(e={height:u,width:c},n()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,r=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function sa(e,t,r,n){var i,o,a,s,l,u;const{app:c,flags:d}=t,m=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!m)return[];const[f]=m,p=f.size||"small",h=f.type||"media";let y=-1;for(let e=0;e<r.length;e++)if(r[e].cId===f.cId){y=e;break}const g=(null===(a=n.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==y&&g[y]&&(v=g[y]),"media"===h&&null!==(l=f.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return async function(e,t,r){let n=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,r,n,i,o,a;return e&&e.session&&e.session.options||e&&e.enigmaModel&&e.enigmaModel.session&&e.enigmaModel.session.sessionConfig?(t=e.session.options||e.enigmaModel.session.sessionConfig,a=void 0!==t.secure?t.secure:t.isSecure,r=a?"https://":"http://",n=t.host||"localhost",i=t.port?":"+t.port:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o+="/"),r+n+i+o):""}(r);i&&(function(e,t){e.replace(t,"").replace(/^\.\.\//i,"/")[0]}(n,i),n=n.replace(/"/g,'\\"'),n=n.replace(/'/g,"\\'"),n=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(n,i));const{height:o,width:a,imageError:s}=await aa.getImageSize(n,t);return{src:n,size:t,height:o,width:a,imageError:s}}(f,p,c);if("url"===h)return async function(e,t,r,n,i){let o,a=r.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&oa(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:r,width:i,imageError:s}=await aa.getImageSize(t,n);o={src:t,size:n,height:r,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:r}=await aa.getImageSize(a,n);o={src:a,size:n,height:e,width:t,imageError:r}}return o}(c,d,f,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,r,n){let i;const o=n.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(oa(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:n,width:o,imageError:a}=await aa.getImageSize(e,r);i={src:e,size:r,height:n,width:o,imageError:a}}}catch(e){}return i}(c,r[y],p,v)}return[]}const la={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:r,opts:n}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(sa(e,n,r,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,r;const n=null===(t=e.layout)||void 0===t||null===(r=t.tooltip)||void 0===r?void 0:r.imageComponents;return!!n&&n.length>0}},ua={async handlePromises({customTooltipModel:e,nodes:t,attrExps:r,opts:n}){let i=t;return i=await la.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:r,opts:n}),i},checkIfPromisesExist:({customTooltipModel:e})=>la.checkIfPromisesExist({customTooltipModel:e})};const ca=(e,t)=>{var r,n,i;const o=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qDimensions,a=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:ia.CHART.CHART_PARENT_TYPE,qId:ia.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},da=e=>{var t,r,n;const i=null===(t=e.tooltip)||void 0===t||null===(r=t.chart)||void 0===r||null===(n=r.object)||void 0===n?void 0:n.refId;return{qInfo:{qType:ia.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const ma={createContainer:({ctx:e,layout:t})=>{var r,n;if(!((null===(r=t.qHyperCube)||void 0===r||null===(n=r.qDimensionInfo)||void 0===n?void 0:n.length)<=0))return function(e,t){var r,n,i,o;const a=null!==(r=null===(n=t.tooltip)||void 0===n||null===(i=n.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==r?r:"medium",s=ia.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:ia.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:r,dimIndex:n,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 ma.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:r}){const n=r,i=ia.CHART.STATE,o=t.qStateName;n.miniChartToken.alternateState||(n.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),n.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:r}){var n;const i=r;null!==(n=i.miniChartToken.sessionObj)&&void 0!==n&&n.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=ia.CHART.STATE,a=ca(t,o),s=await e.createSessionObject(a),l=da(t);if(s.id!==ia.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,m,f,p;const e=r.length>0&&void 0!==(null===(d=r[0].data)||void 0===d?void 0:d.value)?[null===(m=r[0].data)||void 0===m?void 0:m.value]:[],a=void 0!==n?n:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===n&&r.length>0){var h,y;const e=null!==(h=r[0].data.selectionOuterDimension)&&void 0!==h?h:r[0].data.selectionDimension;if(null!=e&&null!==(y=e.source)&&void 0!==y&&y.field){var g;const t=null==e||null===(g=e.source)||void 0===g?void 0:g.field.split("/"),r=t[t.length-1],n=void 0!==e.value?[e.value]:[];n.length>0&&void 0!==r&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(r),n,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(ia.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===(f=u.miniChartToken.model)||void 0===f?void 0:f.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await ma.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const r=t;null!=r&&r.embed&&(ma.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(ia.CHART.CHART_OBJECT_ID),r.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const r=t,n=ia.CHART.STATE;await e.removeSessionAlternateState(n),r.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,r;const n=e;"function"==typeof(null===(t=n.miniChartToken)||void 0===t||null===(r=t.vis)||void 0===r?void 0:r.destroy)&&(n.miniChartToken.vis.destroy(),n.miniChartToken.vis=void 0)}};function fa(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function pa(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:r,IMAGES:n}=ia.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[r]=!0,i[n]=!0,i}function ha(e){const t=pa();return e.filter((e=>t[e.id]))}const ya={getNodes(e,t){const r=function(e,t){let r=0,n=0;e.center?(r+=e.center.x,n+=e.center.y):(r+=e.clientX,n+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:r-i.left,cy:n-i.top}}(e,t);return t.shapesAt({x:r.cx,y:r.cy})},getDataNodes(e,t){let r,n=[];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=[],n.push(e)}}else{r||(r=[],Object.keys(i).forEach((t=>{r=r.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=r.filter((e=>{var t,r;const n=null!==(t=null!==(r=e.data.stack)&&void 0!==r?r:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return n&&n.value===u.value&&n.label===u.label}));t.length>0&&(n=n.concat(t[0]))}})),n},displayTooltip(e,t,{nodes:r,opts:n={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=ya.getAttrExprData(a);o.length||r.length?ua.handlePromises({customTooltipModel:i,nodes:ya.getDataNodes(s,o.length>0?o:r),attrExps:l,opts:n}).then((()=>{t.emit("show",e,r.length?{nodes:r}:void 0)})):t.emit("show",e,r.length?{nodes:r}:void 0)}else{var s,l;null!==(s=n.flags)&&void 0!==s&&s.isEnabled("CUSTOM_TOOLTIP_CHART")&&null!=i&&null!==(l=i.miniChartToken)&&void 0!==l&&l.alternateState&&ma.hide({app:n.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>ua.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var r;const n=t,i=null!==(r=e.qHyperCubeDef)&&void 0!==r&&r.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[i]||(n[i]=[]),n[i]},getAttrExprData(e){var t;let r=[],n="";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;r=(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)||[],n=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:r,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){var r,n;if(!(null===(r=e.qLayoutExclude)||void 0===r||null===(n=r.quarantine)||void 0===n?void 0:n[ia.CUSTOM.QUARANTINE])){!function(e,t){const r=t;let n=r.qLayoutExclude;n||(r.qLayoutExclude={quarantine:{}},n=r.qLayoutExclude),n.quarantine||(n.quarantine={}),n.quarantine[ia.CUSTOM.QUARANTINE]=[],e.forEach((e=>{n.quarantine[ia.CUSTOM.QUARANTINE].push(e)})),r.qLayoutExclude=n}(ha(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,r;const n=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(r=t.quarantine)||void 0===r?void 0:r[ia.CUSTOM.QUARANTINE])&&delete n.qLayoutExclude.quarantine[ia.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const r=fa(e);if(!r)return;const n=void 0!==t?t:r.length-1;if(!r[n])return;const i=this.getAttrExps(e,r[n]);if(0===ha(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)||[],r=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[n].qAttributeExpressions=r:s.qHyperCube.qDimensionInfo[n].qAttrExprInfo=r}},moveCustomTooltipAttrs(e,t={},r){let n=[];const i=fa(e)||[];[...i,t].forEach((e=>{const t=ha(e.qAttributeExpressions||[]);t.length>0&&(n=t)}));const o=pa(),a=i.map((e=>{const t=e,r=e.qAttributeExpressions||[];return t.qAttributeExpressions=r.filter((e=>!o[e.id])),t})),s=void 0!==r?r:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(n));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:he.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const r=he.detectTextDirection(e.src),n=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){n.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const r=e.imageError?`${e.src}?${Math.random()}`:e.src;n.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:r,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,n),""],style:{"text-align":t.rtl?"right":"left",direction:r,"max-width":e.width},colspan:2},{}]}};function ga(e,t,r,n){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[r])||void 0===o||null===(a=o[n])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[n]?e.qSubNodes[n].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 r;switch(e.id){case ia.CUSTOM.EXPRESSION:r="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case ia.CUSTOM.TITLE:case ia.CUSTOM.DESCRIPTION:case ia.CUSTOM.IMAGES:r=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:r="NaN"}return r}(e,i);l.push({source:{key:"qHyperCube",field:`${r}/${n}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const va={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const r=t-1,n="qDimensionInfo";return{field:`${n}/${r}`,value:t=>ga(t,e,n,r)}}};const ba={getCustomAttrExps(e,t,r){var n,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(n=t.data)||void 0===n||null===(i=n.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,r,n){const i={[ia.CUSTOM.TITLE]:!0,[ia.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=ya.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===ia.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:r("qHyperCube").field(`${a}/${o}`).formatter()(s.value);n.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&&n.customTooltipInfoAttrExpsArr.push({...e.id===ia.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),n}(r,a.map((t=>ye.getMeasure(e,t))),e,o)}};function xa({nodes:e,layout:t,dataset:r}){return function(e,t,r){const n=[];return e.forEach((e=>{n.push(ba.getCustomAttrExps(r,e,t))})),n}(e,t,r).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Ma({key:e,source:t,layoutService:r,fieldModel:n,colorService:i,series:o}){const{meta:a}=r;if(a.isBarSeriesStacked){const{major:a,majorNumeric:s}=n.main,l=o.filter((e=>e.type===ta.BAR)),u=r.meta.isContinuous?s:a,c=e=>"NaN"!==e.qNum?e.qNum:0;return[{key:e,data:{extract:l.map((({ref:e,typeIndex:n,refIndex:o})=>({source:t,field:a,value:r.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},segment:{field:e,value:c,reduceLabel:"none"},end:{field:e,value:c,reduceLabel:"none"},null:{fields:l.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},typeIndex:n,...i.getDatumProps(o),customTooltipAttrExps:va.getNode(r.getLayout(),r.meta),sumOfPositives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"}}}))),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}]}return[]}function Sa({key:e,series:t,source:r,fieldModel:n,colorService:i,layoutService:o,forceCreate:a=!1}){if(t.length||a){const{major:a,majorNumeric:s}=n.main,l=e=>"NaN"!==e.qNum?e.qNum:0,u=o.meta.isContinuous?s:a;return[{key:e,data:{extract:t.map((({ref:e,refIndex:t,typeIndex:n,options:s},c)=>({source:r,field:a,value:o.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},end:{field:e,value:s.showAsZeros?l:void 0,reduceLabel:"none"},start:0,line:c,typeIndex:n,null:{field:e,value:e=>"NaN"===e.qNum,reduceLabel:"none"},customTooltipAttrExps:va.getNode(o.getLayout(),o.meta),...i.getDatumProps(t)}})))}}]}return[]}function Ea({key:e,layoutService:t,fieldModel:r,series:n}){const{meta:i}=t;if(i.isBarSeriesStacked){const{major:t,majorNumeric:o}=r.main,a=n.filter((e=>e.type===ta.BAR)),s=i.isContinuous?{field:o,value:e=>e.qNum,reduceLabel:"none"}:[];return[{key:e,data:{extract:{field:0,props:{major:{field:i.isContinuous?o:t},null:{fields:a.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},sumOfPositives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},timeStart:s,timeEnd:s},value:i.isContinuous?e=>e.qNum:void 0}}}]}return[]}const Ca={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var qa={OPTIONS:Ca,DEFAULT:Ca.MINI_CHART};function Oa({layoutService:e,discrete:t}){return({h:r,rect:n,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=n[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 r("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 Aa({layoutService:e,viewState:t,viewCache:r}){return e.meta.isContinuous?function(e,t){const r=e.get("zoom"),n=t.get("continuousMin"),i=t.get("continuousMax");return[(r.min-n)/(i-n),(r.max-n)/(i-n)]}(t,r):function(e){return e.get("viewRange")}(t)}const Da=e=>({miniChart:e===qa.OPTIONS.MINI_CHART.value,bar:e===qa.OPTIONS.BAR.value,none:e===qa.OPTIONS.NONE.value});function Na({layoutService:e,override:t}){const r=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Da(t);const r=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===r)return Da(qa.DEFAULT.value);const n=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Da(!r&&(n||!n&&i)?qa.OPTIONS.NONE.value:qa.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:r})&&(r.miniChart=t.value===qa.OPTIONS.MINI_CHART.value,r.bar=t.value===qa.OPTIONS.BAR.value,r.none=t.value===qa.OPTIONS.NONE.value),r}function Ia({componentKey:e,chart:t,viewState:r,viewCache:n,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===o.meta.major.orientation,f=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=m?d.rect.computedInner.width:d.rect.computedInner.height,h=m&&a?p-f:f,y=Math.max(0,Math.min(h/p,1)),[g,v]=Aa({layoutService:i,viewState:r,viewCache:n}),b=y<g,x=y>v,M=!b&&!x;return{pixel:h,relative:y,thumb:M?h-g*p:0,beforeThumb:b,afterThumb:x,onThumb:M}}}function Ta({componentKey:e,chart:t,viewState:r,viewCache:n,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,m]=Aa({layoutService:i,viewState:r,viewCache:n});return{size:c,thumbSize:(m-d)*c}}}function wa({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Ia({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ta({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(n,i)=>!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(r){r.preventDefault();const a=u(r);if(o.meta.isContinuous){const e=n.get("zoom"),t=e.max-e.min,r=i.get("continuousMin"),o=i.get("continuousMax"),s=r+(o-r)*a.relative;n.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,r+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,r=Math.max(0,t/e.size);s.command.scrollTo(r)}t.component(e).emit("render")}}}}function La({e:e}){return(e.srcEvent||e).srcElement.getAttribute("data-scrollbar-handle")||""}const Ra="scrollbarResize";function ka({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Ia({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:"event:scrollbarResize",options:{event:Ra,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!r.scroll.enabled())&&(!t||(this[Ra]=this[Ra]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&La({e:t})&&(this[Ra].panningEvent=t.srcEvent),!!this[Ra].panningEvent))}},events:{scrollbarResizestart(r){r.preventDefault(),this[Ra]=this[Ra]||{},this[Ra].panningEvent&&t.component(e).emit("dragStart",this[Ra].panningEvent)},scrollbarResizemove(r){if(r.preventDefault(),this[Ra]=this[Ra]||{},!this[Ra].panningEvent)return;const o=n.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(r).relative+a,d=La({e:this[Ra].panningEvent});let m="start"===d?Math.min(c,o.max):o.min,f="end"===d?Math.max(c,o.min):o.max;m===f&&(m-="start"===d?u:0,f+="end"===d?u:0),n.set("zoom",{min:m,max:f}),t.component(e).emit("render")},scrollbarResizeend(r){r.preventDefault(),this[Ra]=this[Ra]||{},delete this[Ra].panningEvent,t.component(e).emit("dragEnd")},scrollbarResizecancel(r){r.preventDefault(),this[Ra]=this[Ra]||{},delete this[Ra].panningEvent,t.component(e).emit("dragEnd")}}}}const Pa="scrollbarPan";function ja({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Ia({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Ta({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:"event:scrollbarPan",options:{event:Pa,threshold:0,enable(n,i){return this[Pa]=this[Pa]||{},!(i&&!this[Pa].isPanning)||!!r.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{scrollbarPanstart(r){r.preventDefault();const a=u(r);if(this[Pa]=this[Pa]||{},this[Pa].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=n.get("zoom"),t=e.max-e.min,r=i.get("continuousMin"),o=i.get("continuousMax"),s=r+(o-r)*a.relative;s<e.min?n.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,r+t)}):s>e.max&&n.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,r+t)}),this[Pa].relative=a.relative,this[Pa].zoom=n.get("zoom"),this[Pa].zoom.span=this[Pa].zoom.max-this[Pa].zoom.min,this[Pa].zoom.fullSpan=o-r}else if(a.onThumb)this[Pa].offset=a.thumb;else{const e=c();this[Pa].offset=a.beforeThumb?0:e.thumbSize}},scrollbarPanmove(r){r.preventDefault();const a=u(r);if(this[Pa]=this[Pa]||{},o.meta.isContinuous){const e=a.relative-this[Pa].relative,{fullSpan:t,span:r,min:o,max:s}=this[Pa].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");n.set("zoom",{min:Math.min(o+e*t,u-r),max:Math.max(s+e*t,l+r)})}else{const e=a.pixel-(this[Pa].offset||0),t=c(),r=Math.max(0,e/t.size);s.command.scrollTo(r)}t.component(e).emit("render")},scrollbarPanend(r){r.preventDefault(),this[Pa]=this[Pa]||{},this[Pa].isPanning=!1,t.component(e).emit("unlockState")},scrollbarPancancel(r){r.preventDefault(),this[Pa]=this[Pa]||{},this[Pa].isPanning=!1,t.component(e).emit("unlockState")}}}}function Fa({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[wa({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),ka({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),ja({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function Va({componentKey:e,chart:t,actions:r,layoutService:n}){const i=(i,o)=>{if(!n.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&r.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const _a={background:"rgba(0, 0, 0, 0.1)"},za={top:-1,bottom:-1,width:6},Ha={width:2,background:"#595959"};var $a={before:_a,after:_a,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:za,endHandle:za,startHandleBorder:Ha,endHandleBorder:Ha};const Ba={background:"rgba(0, 0, 0, 0.1)"},Ua={top:-1,bottom:-1,width:6},Ya={width:2,background:"#595959"};var Wa={before:Ba,after:Ba,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Ua,endHandle:Ua,startHandleBorder:Ya,endHandleBorder:Ya};const Ga={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Ka={pointerEvents:"initial"},Xa={pointerEvents:"none"};const Ja="ew-resize",Za="default";function Qa(){const{rect:e}=this,{settings:t}=this.settings,r="horizontal"===t.orientation,n=r?e.computedInner.width:e.computedInner.height,i=t.range(),o=r&&t.rtl;return{size:n,start:(o?1-i[1]:i[0])*n,end:(o?1-i[0]:i[1])*n}}function es(){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?Ja:Za}function ts(e,t,r){const{min:n}=this.settings.settings.size.thumb;if(r-t<n){const i=(n-(r-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,r+i-e);return{size:e,start:t-i+o,end:r+i+o}}return{size:e,start:t,end:r}}function rs(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function ns(){const{size:e,start:t,end:r}=Qa.call(this);this.renderer.render(this.elements(this.h,ts.call(this,e,t,r)))}function is(){const{state:e,settings:t,style:r}=this,n=t.settings.style;return e.style[n]||(e.style[n]=function({id:e,style:t}){const r="slim"===e?Wa:$a;return{container:{...Ga},before:{...Ga,...r.before,...t.before},after:{...Ga,...r.after,...t.after},thumb:{...Ga,...r.thumb,...t.thumb},startHandle:{...Ga,...Ka,...r.startHandle},endHandle:{...Ga,...Ka,...r.endHandle},startHandleBorder:{...Ga,...Xa,...r.startHandleBorder},endHandleBorder:{...Ga,...Xa,...r.endHandleBorder}}}({id:t.settings.style,style:r[n]})),e.style[n]}var os={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(){ns.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||!rs.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=La({e:e});t&&(this.state.hover[t]=!0),es.call(this),ns.call(this)},leave(){this.state.locked||(this.state.hover.reset(),es.call(this),ns.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=La({e:e});t&&(this.state.drag[t]=!0),es.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),es.call(this),ns.call(this))}},preferredSize({outer:e}){const{min:t,max:r,ratio:n}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(r,e[i]*n))},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:r,end:n}=Qa.call(this);return this.elements(e,ts.call(this,t,r,n))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:r,end:n}){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:r,end:n,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-r},m={[i.start]:n},f={left:-3},p={left:1},h={right:-3,left:"auto"},y={left:3},g=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:f},class:"scrollbar--start-handle","data-scrollbar-handle":"start"},o?e("div",{style:{...s.startHandleBorder,...u?y:p}}):void 0);b.push(t);const r=e("div",{style:{...s.endHandle,...u?f:h},class:"scrollbar--end-handle","data-scrollbar-handle":"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:y}}):void 0);b.push(r)}const x=e("div",{style:{...s.thumb,[i.start]:r,[i.end]:t-n},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[g,x,v,...c])}({h:e,size:t,start:r,end:n,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:is.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};function as({layoutService:e}){return e.meta.isContinuous&&Na({layoutService:e}).miniChart}function ss({models:e}){const{layoutService:t,fieldModel:r,seriesModel:n,colorService:i}=e,{primarySeries:o,secondarySeries:a}=n.meta,s=n.query.series(ta.LINE),l=[...Sa({forceCreate:!0,key:ea.COLLECTION.PRIMARY,series:o,fieldModel:r,colorService:i,layoutService:t}),...Sa({key:ea.COLLECTION.SECONDARY,series:a,fieldModel:r,colorService:i,layoutService:t}),...Sa({key:ea.COLLECTION.LINE,series:s,fieldModel:r,colorService:i,layoutService:t}),...Ma({key:ea.COLLECTION.STACKED_PRIMARY,layoutService:t,fieldModel:r,colorService:i,series:o}),...Ma({key:ea.COLLECTION.STACKED_SECONDARY,layoutService:t,fieldModel:r,colorService:i,series:a}),...Ea({key:ea.COLLECTION.STACKED_TOTAL_PRIMARY,layoutService:t,fieldModel:r,series:o}),...Ea({key:ea.COLLECTION.STACKED_TOTAL_SECONDARY,layoutService:t,fieldModel:r,series:a})];return as(e)&&(l.push(...Sa({key:ea.COLLECTION.REDUCED,source:ea.DATA.REDUCED,series:n.query.all(),fieldModel:r,colorService:i,layoutService:t})),l.push(...Sa({key:ea.COLLECTION.REDUCED_PRIMARY,source:ea.DATA.REDUCED,series:o,fieldModel:r,colorService:i,layoutService:t})),l.push(...Sa({key:ea.COLLECTION.REDUCED_SECONDARY,source:ea.DATA.REDUCED,series:a,fieldModel:r,colorService:i,layoutService:t})),l.push(...Ma({key:ea.COLLECTION.REDUCED_STACKED_PRIMARY,source:ea.DATA.REDUCED,layoutService:t,fieldModel:r,series:n.meta.primarySeries.filter((e=>e.type===ta.BAR)),colorService:i})),l.push(...Ma({key:ea.COLLECTION.REDUCED_STACKED_SECONDARY,source:ea.DATA.REDUCED,layoutService:t,fieldModel:r,series:n.meta.secondarySeries.filter((e=>e.type===ta.BAR)),colorService:i}))),l}const ls=({layoutService:e,dockService:t})=>"custom"!==e.getLayoutValue("dimensionAxis.axisDisplayMode")?Math.min(200,t.meta.chart.size["horizontal"===t.meta.major.orientation?"height":"width"]/4):void 0;function us({models:e}){const{dockService:t,seriesModel:r}=e;if(1!==r.meta.measureAxes.length)return.5;const n=r.meta.measureAxes[0].isPrimary?t.meta.minor.dock:t.meta.minorSecondary.dock;return"horizontal"===t.meta.minor.orientation?"near"===n||"bottom"===n?1:0:"near"===n||"left"===n?0:1}const cs=({models:e,environment:t})=>{const{fieldModel:r,discreteModel:n,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{data:{extract:{field:r.main.major,props:{selectionDimension:{field:r.main.major}}}},maxPxStep:ls({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:n.query.getScaleRange,align:us({models:e})}},ds=({models:e,environment:t})=>{const{fieldModel:r,discreteModel:n,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{type:"group-by-measure",data:{extract:{field:r.main.major}},measureCount:i.meta.groupSize,maxPxStep:ls({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:n.query.getScaleRange,align:us({models:e})}};function ms({viewState:e,models:t,environment:r}){const{fieldModel:n,dockService:i}=t,{orientation:o}=i.meta.major;return{type:"linear",invert:"horizontal"===o&&"rtl"===r.options.direction,data:{extract:{field:n.main.majorNumeric}},ticks:{forceBounds:!0,count:e.get("zoom").min===e.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>e.get("zoom").min,max:()=>e.get("zoom").max}}function fs({viewCache:e,mainMajor:t}){return U(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}function ps({viewState:e,viewCache:t,layoutService:r}){return t.set("qTimeAxisCache",[]),{get:(e,r=0)=>{const n=t.get("qTimeAxisCache");return n[r]&&n[r][0]===e?n[r][1]:void 0},set:(e,r,n=0)=>{t.get("qTimeAxisCache")[n]=[e,r]},key:({distance:n})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=r.getHyperCubeValue("qAxisData.qAxis",[]).map((e=>e.qName));return[n,Number.parseFloat(a).toFixed(12),...s].toString()}}}function hs({picasso:e,viewState:t,viewCache:r,models:n,environment:i}){const{layoutService:o,fieldModel:a,appLayoutModel:s,themeService:l}=n,{measureText:u}=e.renderer("svg")(),{majorNumeric:c}=a.main,d=l.getStyles(),m={type:"time",data:{field:c},qAxis:()=>o.getHyperCubeValue("qAxisData.qAxis",[]),field:c,min:()=>t.get("zoom").min,max:()=>t.get("zoom").max,invert:"rtl"===i.options.direction,formatter:{fn:e.formatter("q-time"),localeInfo:s.qLocaleInfo,qNumFormat:o.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:d.axis.label.name.fontFamily,fontSize:d.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:t.get("zoom").min},anchor:"start",clamp:!0},cache:ps({viewState:t,viewCache:r,layoutService:o})};return{[ea.SCALE.MAJOR]:U(!0,{},m,{ticks:{level:"outer"}}),[ea.SCALE.MAJOR_INNER]:U(!0,{},m,{ticks:{level:"inner"}})}}function ys({picasso:e,models:t,viewState:r,viewCache:n,environment:i}){const{meta:o}=t.layoutService,a=o.isTime?{...hs({picasso:e,viewState:r,viewCache:n,models:t,environment:i})}:o.isContinuous?{[ea.SCALE.MAJOR]:ms({models:t,viewState:r,environment:i})}:o.isBarSeriesGrouped?{[ea.SCALE.MAJOR]:ds({models:t,environment:i})}:{[ea.SCALE.MAJOR]:o.isBarSeriesStackedInBothAxis?ds({models:t,environment:i}):cs({models:t,environment:i})};return as(t)?{...a,[ea.SCALE.REDUCED]:fs({viewCache:n,mainMajor:a[ea.SCALE.MAJOR]})}:a}function gs({fields:e,tickModel:t,dockService:r,environment:n}){const i="rtl"===n.options.direction,{orientation:o}=r.meta.minor;return{data:{source:"qHyperCube",fields:e},invert:"vertical"===o||i,ticks:{values:t.query.getValues},min:t.query.getMin,max:t.query.getMax}}function vs({layoutService:e,tickModel:t,dockService:r,environment:n}){if(!as({layoutService:e}))return;const i="rtl"===n.options.direction,{orientation:o}=r.meta.minor;return{type:"linear",invert:"vertical"===o||i,min:t.query.getMin,max:t.query.getMax}}function bs({picasso:e,models:t,viewState:r,viewCache:n,environment:i}){const{layoutService:o,fieldModel:a,primaryTickModel:s,secondaryTickModel:l,colorService:u,dockService:c}=t;return{...ys({picasso:e,models:t,viewState:r,viewCache:n,environment:i}),[ea.SCALE.MINOR.PRIMARY]:gs({fields:a.main.minorsPrimary,tickModel:s,dockService:c,environment:i}),[ea.SCALE.MINOR.SECONDARY]:gs({fields:a.main.minorsSecondary,tickModel:l,dockService:c,environment:i}),[ea.SCALE.MINOR.REDUCED_PRIMARY]:vs({layoutService:o,tickModel:s,dockService:c,environment:i}),[ea.SCALE.MINOR.REDUCED_SECONDARY]:vs({layoutService:o,tickModel:l,dockService:c,environment:i}),...u.custom.wrappedScales()}}var xs={AXIS:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"SMALL"},VERTICAL:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"MEDIUM"},VERTICAL:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REFERENCE_LINE:"SPARK"};const Ms=["all","labels"];function Ss({models:e}){const{layoutService:t,dockService:r,seriesModel:n,themeService:i}=e,o=t.getLayoutValue("measureAxes");if(!o||!o.length)return!1;const a=i.getStyles(),{measureAxes:s}=n.meta;return s.filter((e=>{const t=e.isPrimary?0:1;return Ms.some((e=>o[t].show===e))})).map((e=>({type:"axis",key:e.isPrimary?ea.COMPONENT.AXIS.MINOR.PRIMARY:ea.COMPONENT.AXIS.MINOR.SECONDARY,scale:e.scale,layout:{dock:e.isPrimary?r.meta.minor.dock:r.meta.minorSecondary.dock,minimumLayoutMode:xs.AXIS.MINOR},settings:{labels:{show:!0,fontFamily:a.axis.label.name.fontFamily,fontSize:a.axis.label.name.fontSize,fill:a.axis.label.name.color},line:{stroke:a.axis.line.major.color},ticks:{stroke:a.axis.line.major.color},minorTicks:{stroke:a.axis.line.minor.color}}})))}var Es=.5,Cs=3,qs=13;function Os({models:e,environment:t}){const{layoutService:r,dockService:n,themeService:i}=e,o="rtl"===t.options.direction,a=r.getLayoutValue("dimensionAxis"),s=i.getStyles(),l=(({layoutService:e})=>{const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[r]=e.getDataPages(),n=r?r.qMatrix:[];return ue.getAdjustedMaxGlyphCount(t,n,0,"qText")})({layoutService:r}),{orientation:u}=n.meta.major;return{type:"axis",key:ea.COMPONENT.AXIS.MAJOR,scale:ea.SCALE.MAJOR,layout:{dock:n.meta.major.dock,minimumLayoutMode:xs.AXIS.MAJOR[u.toUpperCase()]},settings:{labels:{mode:a.label,tiltAngle:o?-40:40,maxEdgeBleed:50,maxLengthPx:n.meta.minor.size/4,maxGlyphCount:l,tiltThreshold:l>Cs&&l<qs?1:void 0,fontFamily:s.axis.label.name.fontFamily,fontSize:s.axis.label.name.fontSize,fill:s.axis.label.name.color}},brush:{consume:[{context:"selection",style:{inactive:{opacity:Es}}}]}}}function As({models:e}){const{dockService:t,themeService:r}=e,{orientation:n}=t.meta.major,i=r.getStyles();return{type:"axis",key:ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,scale:ea.SCALE.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:xs.AXIS.MAJOR[n.toUpperCase()]},settings:{labels:{align:0,offset:4,fontFamily:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:i.axis.label.name.color},line:{show:!1}}}}function Ds({models:e,environment:t}){const{layoutService:r}=e,n=r.getLayoutValue("dimensionAxis");if(!n)return[];const{show:i}=n;return"none"===i||"title"===i?[]:r.meta.isTime?function({models:e,environment:t}){const{dockService:r,themeService:n}=e,i="rtl"===t.options.direction,{orientation:o}=r.meta.major,a="bottom"===r.meta.major.dock?0:1,s=n.getStyles(),l=i?1:0,u={type:"time-axis",renderer:"svg",layout:{dock:r.meta.major.dock,minimumLayoutMode:xs.AXIS.MAJOR[o]},preferredSize:()=>({size:2*parseFloat(s.axis.label.name.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:i?"end":"start",label:{align:a,justify:l},guideLine:{major:{justify:l},minor:{align:a}},line:{show:!1}},style:{label:{fontFamily:s.axis.label.name.fontFamily,fontSize:s.axis.label.name.fontSize,fill:s.axis.label.name.color},majorGuideLine:{stroke:s.axis.line.major.color},minorGuideLine:{stroke:s.axis.line.minor.color}}};return[U(!0,{},u,{key:ea.COMPONENT.AXIS.TIME_INNER,scale:ea.SCALE.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}}},style:{majorGuideLine:{stroke:s.axis.line.minor.color},minorGuideLine:{stroke:s.axis.line.major.color}}}),U(!0,{},u,{key:ea.COMPONENT.AXIS.TIME_OUTER,scale:ea.SCALE.MAJOR,settings:{guideLine:{minor:{show:!1}}}})]}({models:e,environment:t}):r.meta.isContinuous?[As({models:e})]:[Os({models:e,environment:t})]}const Ns=({layoutService:e,axis:t})=>e.meta.isBarSeriesGrouped?({scale:e,datum:t})=>e([t.value,t.typeIndex.value])+e.bandwidth()/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:r})=>e([r.value,t])+e.bandwidth()/2:null,Is=({layoutService:e,seriesModel:t,rtl:r,orientation:n})=>e.meta.isContinuous?null:e.meta.isBarSeriesGrouped?({scale:e,datum:i})=>e([i.value,r&&"horizontal"===n?t.meta.barSeriesCount-1:0])+e.bandwidth()*t.meta.barSeriesCount/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:t})=>e([t.value,r&&"horizontal"===n?1:0])+e.bandwidth():null;function Ts({layoutService:e,active:t={},inactive:r={}}){return{consume:[{context:"selection",data:["selectionDimension","end","color","major"],style:{active:{strokeWidth:e.meta.isContinuous?0:2,stroke:"#000",opacity:e=>{var t,r;return!0===(null===(t=e.data)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)?0:1},...t},inactive:{opacity:e=>{var t,r;return!0===(null===(t=e.data)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)?0:Es},...r}}}]}}var ws="max",Ls="min";function Rs(e,t){return function(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n}(e,t)||function(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n}(e,t)}const ks=(e,t)=>`${e}-${t.id}`,Ps=4,js=12,Fs=4;function Vs({chart:e,layoutService:t,dockService:r,markerKey:n,markerType:i}){if(t.meta.isContinuous)return()=>Fs+"px";const o={size:void 0},a="horizontal"===r.meta.major.orientation?"width":"height";return t=>{if(!o.size){const r=e.component(n),s=t.resources.scale(ea.SCALE.MAJOR),l=r.rect[a]*s.bandwidth()*.25,u=Math.max(Ps,Math.min(js,l));o.size=("bar"===i?2*u:u)+"px"}return o.size}}const{isDark:_s}=lt;const zs=({chart:e,models:t,series:r,environment:n})=>{const{layoutService:i,seriesModel:o,colorService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,c=a.getColor(),{fill:d,marker:m}=r.options,{isContinuous:f}=i.meta,p="rtl"===n.options.direction,{orientation:h}=s.meta.major,y="horizontal"===h,g=(r.isPrimary?l:u).query.getExtrema(),v=({end:e})=>{const{value:t}=e;return Rs(t,g)},b=ks(ea.COMPONENT.MARKER,r);return{type:"point",key:b,data:{filter:e=>r.ref===e.end.source.field,collection:r.collection},settings:{[y?"x":"y"]:{scale:ea.SCALE.MAJOR,fn:Is({layoutService:i,seriesModel:o,rtl:p,orientation:h}),ref:f?"major":void 0},[y?"y":"x"]:{scale:r.scale,ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(r))}},fill:d?c:"none",opacity:e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)||v(e.datum)?0:1},stroke:e=>{const t=c(e);return d?_s(t)?function(e){return Fe(e).brighter(.5).toString()}(t):function(e){return Fe(e).darker().toString()}(t):t},size:Vs({chart:e,layoutService:i,dockService:s,markerKey:b,markerType:m}),shape:()=>(({marker:e,horizontal:t,rtl:r})=>{let n;return"triangle"!==e||t||(n=r?"left":"right"),"bar"===e&&(n=t?"horizontal":"vertical"),n?{type:e,direction:n}:{type:e}})({marker:m,horizontal:y,rtl:p})},brush:Ts({layoutService:i,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:Es}}})}};function Hs({property:e="end",isHorizontal:t,isColor:r,fallback:n,rtl:i}){return function(o){const{datum:a,resources:{scale:s}}=o,l=s(ea.SCALE.MAJOR),u=s(ea.SCALE.COLOR),c=t&&i?[...a.points].reverse():a.points,d=c.reduce(((t,r,n)=>{const i="NaN"===r[e].value||Number.isNaN(r[e].value),o=c[n+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(r):t.push(r),t}),[]),m="group-by-measure"===l.type?e=>l([e.major.value,e.typeIndex.value]):e=>l(e.major.value),f=d.map(m),p=Math.min(...f),h=Math.max(...f)-p,y=0===h?1:h,g=f.map(((e,t)=>0===t?0:t===f.length-1?1:(e-p)/y)),v=[];for(let t=0;t<d.length;t++){const i=d[t],o=i.color&&i.color.value,a=r?o||n:u(o)||n,s=0===t,l=t===d.length-1,c=g[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))v[t-1].virtual||v.push({virtual:!0});else{const r=d[t-1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?v.push({color:a,offset:s?0:Math.max(0,parseFloat((c-(c-g[t-1])/2).toFixed(5)))}):v.push({color:a,offset:c});const n=d[t+1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?v.push({color:a,offset:l?1:Math.max(0,parseFloat((c+(g[t+1]-c)/2).toFixed(5)))}):v.push({color:a,offset:c})}}const b=v.reduce(((e,t,r)=>{if(t.virtual){const t=v[r-1],n=v[r+1],i=t.offset+(n.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:n.color,offset:i})}else e.push(t);return e}),[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:b}}}function $s({environment:e,models:t,measureIndex:r}){const{layoutService:n,colorService:i,dockService:o}=t,a="rtl"===e.options.direction,{hasMultipleMeasures:s}=n.meta,{mode:l,type:u,nil:c}=i.getSettingsForMeasure(r),d="horizontal"===o.meta.major.orientation;if(!l||"constant"===u)return i.getColor();if("measure"===l&&"categorical"===u)return i.getColor();const m=n.getHyperCubeValue(`qMeasureInfo.${r}.color`);if(null!=m&&m.on)return"byExpression"===m.mode?Hs({isHorizontal:d,isColor:!0,fallback:c,rtl:a}):i.getColor();const f=n.getLayoutValue("color",{}),p=!f.auto&&"byExpression"===f.mode,h=!!f.colorExpression;if(p&&!h)return c;const y=!f.auto&&"byMeasure"===f.mode&&f.byMeasureDef&&void 0!==f.byMeasureDef.activeMeasureIndex;return s||!y?Hs({isHorizontal:d,isColor:"color"===u,fallback:c,rtl:a}):"continuous"===u?function({isHorizontal:e,rtl:t}){return function(r){const{datum:{points:n},resources:{scale:i}}=r,o=i(ea.SCALE.COLOR),a=n.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e))),offset:Math.min(1,Math.max(0,(e-s)/c))})));return{type:"gradient",x1:!e&&t?1:0,x2:e||t?0:1,y1:e?1:0,y2:0,stops:d}}}({isHorizontal:d,rtl:a}):function({isHorizontal:e,isArea:t,fallback:r,rtl:n}){return function(i){const{datum:{points:o},resources:{scale:a}}=i,s=a(ea.SCALE.COLOR),l=o.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),u=Math.min(...l),c=Math.max(...l),d=t?Math.min(0,u):u,m=(t?Math.max(0,c):c)-d,f=0===m?1:m,p=s.domain(),h=[];for(let e=0;e<p.length-1;e++){const t=p[e],n=s(t)||r;h.push({color:n,offset:Math.min(1,Math.max(0,(t-d)/f))});const i=p[e+1];h.push({color:n,offset:Math.min(1,Math.max(0,(i-d)/f))})}return{type:"gradient",x1:!e&&n?1:0,x2:e||n?0:1,y1:e?1:0,y2:0,stops:h}}}({isHorizontal:d,fallback:c,rtl:a})}const Bs=({models:e,environment:t,series:r})=>{const{layoutService:n,seriesModel:i,dockService:o,styleModel:a}=e,s="rtl"===t.options.direction,{orientation:l}=o.meta.major,u=Is({layoutService:n,seriesModel:i,rtl:s,orientation:l});return{key:ks(ea.COMPONENT.LINE,r),type:"line",data:{filter:e=>r.ref===e.end.source.field,collection:r.collection},settings:{coordinates:{major:{scale:ea.SCALE.MAJOR,fn:u},minor:{scale:r.scale,ref:"end"}},layers:{curve:a.query.line.getCurveFn(),line:{stroke:$s({models:e,environment:t,measureIndex:r.refIndex}),strokeWidth:a.query.line.getStrokeWidthFn(),strokeDasharray:a.query.line.getStrokeDasharrayFn(),strokeLinejoin:"round"}},connect:r.options.showAsConnections,orientation:o.meta.major.orientation},brush:Ts({layoutService:n,active:{stroke:void 0,strokeWidth:void 0,opacity:Es},inactive:{opacity:Es}})}};var Us={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}},LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone",STEP:"step"},WIDTH:{FULL:{DEFAULT:2,ACTIVE:2},LESS:{DEFAULT:1,ACTIVE:1}},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4}}};function Ys({series:e,layoutService:t}){const{showAsConnections:r}=e.options,n=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:r}=e.end;return"NaN"===r||Number.isNaN(r)}}({layoutService:t}),i=r?(e,t)=>0!==e&&t.slice(0,e).reverse().some((e=>!n({item:e}))):(e,t)=>0!==e&&!n({item:t[e-1]}),o=r?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some((e=>!n({item:e}))):(e,t)=>e!==t.length-1&&!n({item:t[e+1]});return({index:e,items:t})=>({before:i(e,t),after:o(e,t)})}const Ws=3,Gs=20;function Ks({models:e,series:t,environment:r}){const{layoutService:n,colorService:i,seriesModel:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u,selectionService:c}=e,d=n.getLayoutValue("dataPoint.show",!1),{orientation:m}=a.meta.major,f="horizontal"===m,p="SPARK"===a.meta.chart.mode,h=i.getColor(),{POINT:y}=Us,g=function({layoutService:e,series:t}){const r={key:void 0,map:void 0},n=Ys({series:t,layoutService:e});return({item:e,items:t})=>{r.key!==t&&(r.key=t,r.map=function({items:e}){return e.reduce(((e,t)=>{const{value:r}=t.line;return e[r]||(e[r]={items:[],keys:[]}),e[r].items.push(t),e[r].keys.push(`${t.major.value}-${t.line.value}`),e}),{})}({items:t}));const{value:i}=e.line,o=r.map[i],a=`${e.major.value}-${i}`,s=o.keys.indexOf(a),{before:l,after:u}=n({index:s,items:o.items});return!l&&!u}}({series:t,layoutService:n}),v="rtl"===r.options.direction,b=(t.isPrimary?l:u).query.getExtrema(),{isContinuous:x}=n.meta,M=({end:e})=>{const{value:t}=e;return Rs(t,b)};return{type:"point",key:ks(ea.COMPONENT.POINT,t),data:{filter:e=>t.ref===e.end.source.field,collection:t.collection},preferredSize:()=>({edgeBleed:{top:f?y.SIZE.DEFAULT/2:0}}),settings:{[f?"y":"x"]:{scale:t.scale,ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(r))}},[f?"x":"y"]:{scale:ea.SCALE.MAJOR,fn:Is({layoutService:n,seriesModel:o,rtl:v,orientation:m}),ref:"major"},sizeLimits:{minPx:Ws,maxPx:Gs},size:e=>{const{value:t}=e.datum.line;return s.query.point.getSize(t)+"px"},fill:h,opacity:({datum:e,data:t})=>{var r;return null!==(r=e.null)&&void 0!==r&&r.value||M(e)?0:p?g({item:e,items:t.items})?1:0:d||g({item:e,items:t.items})?1:0}},brush:Ts({layoutService:n,active:{r:e=>e.r+Us.POINT.SIZE.ACTIVE/2,strokeWidth:1.5,stroke:"#FFFFFF",opacity:e=>{var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||M(e.data))return 0;if(!x||d)return 1;const{event:r,components:n=[]}=(null==c?void 0:c.getSelectionInfo())||{};if("continuousRange"===r)return 0;if("tap"!==r)return 1;return[ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER].some((e=>n.indexOf(e)>=0))?0:1}},inactive:{opacity:e=>1===e.opacity?.5:0}})}}const Xs=(e,{dataset:t})=>{var r;if(null!==(r=e.null)&&void 0!==r&&r.value)return"-";const{value:n,label:i,source:o}=e.end,a=t(o.key).field(o.field);return a.raw().isCustomFormatted?i:a.formatter()(n)};function Js({chart:e,models:t,environment:r,series:n,lineSeries:i}){const{layoutService:o,dockService:a,themeService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,{id:c}=n,d="rtl"===r.options.direction,m=o.getLayoutValue("dataPoint");if(!m)return!1;if(!m.show||!m.showLineLabels)return!1;const f=(n.isPrimary?l:u).query.getExtrema(),p=s.getStyles();return{type:"point-label",key:`${ea.COMPONENT.POINT_LABEL}-${c}`,layout:{displayOrder:2,minimumLayoutMode:xs.VALUE_LABEL},settings:{orientation:a.meta.major.orientation,rtl:d,itemSize:()=>{},connect:n.options.showAsConnections,label:t=>Xs(t,e),pointValue:e=>e.end.value,majorValue:e=>e.value,target:{labelSpace:ea.COMPONENT.LABEL_SPACE,point:`${ea.COMPONENT.POINT}-${c}`,allPoints:i.map((e=>`${ea.COMPONENT.POINT}-${e.id}`))},lineIndex:"typeIndex",showLabel:e=>!(({end:e})=>Rs(e.value,f))(e.data)},style:{fontFamily:p.label.value.fontFamily,fontSize:p.label.value.fontSize,fill:p.label.value.color}}}const Zs=({chart:e,dock:t})=>{let r=t;const n=e.component(`${ea.COMPONENT.SLICED_HAT}-${ws}`),i=e.component(`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.PRIMARY}`),o=e.component(`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.SECONDARY}`);return n?r=`@${ea.COMPONENT.SLICED_HAT}-${ws}`:i?r=`@${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.PRIMARY}`:o&&(r=`@${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.SECONDARY}`),r},Qs=({dockPosition:e,orientation:t,rtl:r})=>{let n=1;return e!==`@${ea.COMPONENT.SLICED_HAT}-${ws}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.PRIMARY}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.SECONDARY}`||!("horizontal"===t||"vertical"===t&&r)||(n=4),e!==`@${ea.COMPONENT.SLICED_HAT}-${Ls}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.PRIMARY}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.SECONDARY}`||"vertical"!==t||r||(n=4),n};function el({chart:e,models:t,environment:r,lineSeries:n}){const{layoutService:i,dockService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=i.getLayoutValue("dataPoint",{}),u="rtl"===r.options.direction;if(!n.length)return!1;if(!l.show||!l.showLineLabels)return!1;const c="horizontal"===o.meta.major.orientation,{show:d}=i.getLayoutValue("dimensionAxis",{});if("none"!==d){const{dock:e}=o.meta.major;if(c&&"top"===e)return!1;if(!c&&e===(u?"left":"right"))return!1}const m=u?"left":"right";return{type:"label-space",key:ea.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:xs.LABEL_SPACE,dock:Zs({chart:e,dock:c?"top":m})},settings:{size:10},show:()=>{const t=e.component(`${ea.COMPONENT.LINE}-${n[0].id}`);if(!t||!t.rect)return!1;const r=(c?17:34)/t.rect[c?"height":"width"],i=a.query.getExtrema(),o=e.scale(ea.SCALE.MINOR.PRIMARY)(i.implicit.line.max),l=c||u?o:1-o,d=n.filter((e=>e.isPrimary)).length>0,m=s.query.getExtrema(),f=e.scale(ea.SCALE.MINOR.SECONDARY)(m.implicit.line.max),p=c||u?f:1-f,h=n.filter((e=>!e.isPrimary)).length>0;return d&&l<r||h&&p<r}}}const tl={min:"Min",max:"Max"};function rl(e,t,r){const{hasExplicitMax:n}=r.meta,{max:i}=r.explicit;return!!n&&Math.max(e,t)>i&&i<=Math.min(e,t)}function nl(e,t,r){const{hasExplicitMin:n}=r.meta,{min:i}=r.explicit;return!!n&&Math.min(e,t)<i&&i>=Math.max(e,t)}function il(e,t,r){return rl(e,t,r)||nl(e,t,r)}function ol(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n&&n<=0}function al(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n&&n>=0}function sl(e,t){return ol(e,t)||al(e,t)}function ll({extrema:e,type:t}){return!(function({extrema:e,type:t}){return!e.meta["hasExplicit"+tl[t]]}({extrema:e,type:t})||function({extrema:e,type:t}){const r=t===ws?e.implicit.bar.max:e.implicit.bar.min,n=Number(r.toFixed(13));return t===ws?!ol(n,e):!al(n,e)}({extrema:e,type:t}))}var ul=Object.freeze({__proto__:null,isSegmentMaxOutOfBounds:rl,isSegmentMinOutOfBounds:nl,isSegmentOutOfBounds:il,isMaxOutOfBounds:ol,isMinOutOfBounds:al,isOutOfBounds:sl,shouldShowOob:ll});const cl={min:"Min",max:"Max"},dl=({chart:e,models:t,markerSeries:r,lineSeries:n,barSeries:i,environment:o,type:a})=>{const{dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,primaryTickModel:c,secondaryTickModel:d,layoutService:m,seriesModel:f,themeService:p,fieldModel:h}=t,y="rtl"===o.options.direction,{dock:g,opposite:v,orientation:b}=s.meta.major,x=l.query.getExtrema(),M=u.query.getExtrema(),S=a===ws,{isBarSeriesGrouped:E}=m.meta,C=(({chart:e,type:t,opposite:r,dock:n})=>{let i=t===ws?r:n;const o=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}`),a=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),s=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`),l=e.component(ea.COMPONENT.LABEL_SPACE),u=e.component(`${ea.COMPONENT.BAR_OOB}-${t}`),c=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`),d=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`);return o?i=`@${ea.COMPONENT.SLICED_HAT}-${t}`:a?i=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`:s?i=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`:u||c||d?l&&t===ws?i="@"+ea.COMPONENT.LABEL_SPACE:u?i=`@${ea.COMPONENT.BAR_OOB}-${t}`:c?i=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`:d&&(i=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`):l&&t===ws&&(i="@"+ea.COMPONENT.LABEL_SPACE),i})({chart:e,type:a,opposite:v,dock:g}),q=Is({layoutService:m,seriesModel:f,rtl:y,orientation:b}),O=n.concat(r);if(!O.length)return!1;const A=S?x.implicit.bar.max:x.implicit.bar.min,D=Number(A.toFixed(13));if(!E&&i.length&&ul[`is${cl[a]}OutOfBounds`](D,x))return!1;if(!x.meta.hasExplicit&&!M.meta.hasExplicit)return!1;const N=S?"max":"min",I=Math[N](Number(x.implicit.line[N].toFixed(13)),Number(x.implicit.marker[N].toFixed(13))),T=Math[N](Number(M.implicit.line[N].toFixed(13)),Number(M.implicit.marker[N].toFixed(13))),w=O.filter((e=>e.isPrimary)),L=O.filter((e=>!e.isPrimary)),R=w.length>0,k=L.length>0,{major:P,majorNumeric:j}=h.main,F=e=>"NaN"!==e.qNum?e.qNum:0,V=m.meta.isContinuous?j:P;return{type:"data-out-of-bounds-marker",key:`${ea.COMPONENT.DATA_OOB_MARKER}-${a}`,layout:{dock:C,minimumLayoutMode:xs.OUT_OF_BOUNDS_MARKER},data:{extract:O.map((({ref:e,typeIndex:t,options:r})=>({field:P,value:m.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:V},end:{field:e,value:r.showAsZeros?F:void 0},typeIndex:t,null:{field:e,value:e=>"NaN"===e.qNum}}})))},settings:{type:a,primaryExtremum:S?()=>c.query.getMax():()=>c.query.getMin(),secondaryExtremum:S?()=>d.query.getMax():()=>d.query.getMin(),primarySeries:w,secondarySeries:L,orientation:b,rtl:y,major:{scale:ea.SCALE.MAJOR,fn:q},markerOffset:Qs({dockPosition:C,orientation:b,rtl:y})},brush:Ts({layoutService:m}),show:()=>{if(S){if(R&&I>c.query.getMax())return!0;if(k&&T>d.query.getMax())return!0}if(!S){if(R&&I<c.query.getMin())return!0;if(k&&T<d.query.getMin())return!0}return!1},style:{fill:p.getStyles().outOfRange.color}}};function ml(e){return(ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fl(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function pl(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){fl(o,n,i,a,s,"next",e)}function s(e){fl(o,n,i,a,s,"throw",e)}a(void 0)}))}}function hl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yl(Object(r),!0).forEach((function(t){hl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vl(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function bl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||Ml(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xl(e){return function(e){if(Array.isArray(e))return Sl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ml(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 Ml(e,t){if(e){if("string"==typeof e)return Sl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sl(e,t):void 0}}function Sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var El=Object.prototype.hasOwnProperty,Cl=Object.prototype.toString,ql=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,Al=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Cl.call(e)},Dl=function(e){if(!e||"[object Object]"!==Cl.call(e))return!1;var t,r=El.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&El.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||El.call(e,t)},Nl=function(e,t){ql&&"__proto__"===t.name?ql(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Il=function(e,t){if("__proto__"===t){if(!El.call(e,t))return;if(Ol)return Ol(e,t).value}return e[t]},Tl=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=Il(s,r),s!==(i=Il(t,r))&&(c&&i&&(Dl(i)||(o=Al(i)))?(o?(o=!1,a=n&&Al(n)?n:[]):a=n&&Dl(n)?n:{},Nl(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&Nl(s,{name:r,newValue:i}));return s};function wl(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",t);return n.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Ll(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",t);return n.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function Rl(e,t,r,n,i){var o,a=i.byRow,s=i.byElemNo;if(n&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===r.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(n,n.raw().qCardinal);if(n){var l=t.pic.extract({field:n.key(),trackBy:n.value}).length;return a(n,l)}return{}}function kl(e,t){var r=e.hc.qDimensionInfo,n=t.input.byDimDef||{activeDimensionIndex:r.length-1};if(n.activeDimensionIndex>=0){var i=r[n.activeDimensionIndex];n=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:n.activeDimensionIndex}:{activeDimensionIndex:n.activeDimensionIndex}}return n}function Pl(e,t){var r;return t.activeDimensionIndex>=0?r=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(r=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),r}function jl(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Fl(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Vl(){}var _l=1/.7,zl="\\s*([+-]?\\d+)\\s*",Hl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",$l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bl=/^#([0-9a-f]{3,8})$/,Ul=new RegExp("^rgb\\("+[zl,zl,zl]+"\\)$"),Yl=new RegExp("^rgb\\("+[$l,$l,$l]+"\\)$"),Wl=new RegExp("^rgba\\("+[zl,zl,zl,Hl]+"\\)$"),Gl=new RegExp("^rgba\\("+[$l,$l,$l,Hl]+"\\)$"),Kl=new RegExp("^hsl\\("+[Hl,$l,$l]+"\\)$"),Xl=new RegExp("^hsla\\("+[Hl,$l,$l,Hl]+"\\)$"),Jl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Zl(){return this.rgb().formatHex()}function Ql(){return this.rgb().formatRgb()}function eu(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Bl.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?tu(t):3===r?new ou(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?ru(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?ru(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ul.exec(e))?new ou(t[1],t[2],t[3],1):(t=Yl.exec(e))?new ou(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Wl.exec(e))?ru(t[1],t[2],t[3],t[4]):(t=Gl.exec(e))?ru(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Kl.exec(e))?uu(t[1],t[2]/100,t[3]/100,1):(t=Xl.exec(e))?uu(t[1],t[2]/100,t[3]/100,t[4]):Jl.hasOwnProperty(e)?tu(Jl[e]):"transparent"===e?new ou(NaN,NaN,NaN,0):null}function tu(e){return new ou(e>>16&255,e>>8&255,255&e,1)}function ru(e,t,r,n){return n<=0&&(e=t=r=NaN),new ou(e,t,r,n)}function nu(e){return e instanceof Vl||(e=eu(e)),e?new ou((e=e.rgb()).r,e.g,e.b,e.opacity):new ou}function iu(e,t,r,n){return 1===arguments.length?nu(e):new ou(e,t,r,null==n?1:n)}function ou(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function au(){return"#"+lu(this.r)+lu(this.g)+lu(this.b)}function su(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function lu(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function uu(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new du(e,t,r,n)}function cu(e){if(e instanceof du)return new du(e.h,e.s,e.l,e.opacity);if(e instanceof Vl||(e=eu(e)),!e)return new du;if(e instanceof du)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new du(a,s,l,e.opacity)}function du(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function mu(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function fu(e){return function(){return e}}function pu(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):fu(isNaN(e)?t:e)}jl(Vl,eu,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Zl,formatHex:Zl,formatHsl:function(){return cu(this).formatHsl()},formatRgb:Ql,toString:Ql}),jl(ou,iu,Fl(Vl,{brighter:function(e){return e=null==e?_l:Math.pow(_l,e),new ou(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new ou(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:au,formatHex:au,formatRgb:su,toString:su})),jl(du,(function(e,t,r,n){return 1===arguments.length?cu(e):new du(e,t,r,null==n?1:n)}),Fl(Vl,{brighter:function(e){return e=null==e?_l:Math.pow(_l,e),new du(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new du(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ou(mu(e>=240?e-240:e+120,i,n),mu(e,i,n),mu(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var hu=function e(t){var r=function(e){return 1==(e=+e)?pu:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):fu(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=iu(e)).r,(t=iu(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=pu(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1),yu=/^class(-pyramid)?/,gu=function(e,t,r,n){var i=void 0!==r.min?r.min:n.min(),o=void 0!==r.max?r.max:n.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(xl(c))),o=Math.max.apply(Math,[o].concat(xl(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,r=e.max,n=e.limits,i=e.range,o=[],a=[];if(n.length)if(n[n.length-1]<t)a.push(t,r),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(n[0]>r)a.push(t,r),o.push(i[0],i[0],i[0]);else{if(n[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<n.length;s++)if(t<n[s]){o.push(i[s]);break}}for(var l=0;l<n.length;l++)t<n[l]&&n[l]<r&&(a.push(n[l]),o.push(i[l]));if(n[n.length-1]<r)a.push(r),o.push(i[n.length]),o.push(i[n.length]);else{a.push(r);for(var u=0;u<n.length;u++)if(n[u]>r){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:r,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var m=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var f=0;f<c.length;f+=1)if(m[f]){var p=d[f],h=d[f+1],y=hu(p,h)(.5);u.range.push(y),u.domain.push(c[f]),f<c.length-1&&m[f+1]&&(u.range.push(d[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(d[f]),u.range.push(d[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function vu(e,t,r,n,i){var o,a,s,l=0,u=[],c=(e-t)/(n+1);if(0===c)return 1;for(o=0;o<r.length;o+=1)a=.99*(r[o]-t),s=r[o]>e?Math.floor(e/c):r[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=n||l>=i?Math.max(l,n):vu(e,t,r,n+1,i)}var bu=function(e,t,r,n){var i,o,a=t.theme,s=t.hc,l=n.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:r.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=r.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=r.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,xl(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===r.input.autoMinMax){if(u.min=r.input.measureMin,u.max=r.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,xl(c)),u.max=Math.max.apply(Math,xl(c))}if(r.input.measureScheme&&(u.palettes={quant:r.input.measureScheme}),a){var m=a.getDataColorScales().filter((function(e){return e.key===r.input.measureScheme}))[0];u.type=m&&yu.test(m.type)?"categorical":"continuous","categorical"===u.type&&(o=m.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,xl(m.colors.map((function(e){return e?e.length:0})))):m.colors.length)}if("categorical"===u.type){for(var f=d?vu(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,h=[],y=0;y<f+1;y+=1)h.push(u.min+p*y);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),r=Math.max(1,Math.floor(t.length/f)),n=[],i=0;i<f;i+=1)n.push(t[i*r]);return[n[0]].concat(n,[n[n.length-1]])}}return u};function xu(e,t){var r;return t.activeMeasureIndex>=0?r=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?r=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),r||(r=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(r=e.pic.fields().filter((function(e){return"measure"===e.type()}))[r.raw().matchMeasure]),r}function Mu(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Su(e,t){for(var r=(null==t?void 0:t.domain)||[],n=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=r.indexOf(o);-1===s?(r.push(o),n.push(a.primary)):n[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=r.indexOf(o);-1!==l&&(r.splice(l,1),n.splice(l,1))}}return{domain:r,range:n,exclude:i}}function Eu(e,t,r,n){var i=function(e,t,r,n){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,r){var n=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?xu:o,s=r.input.byMeasureDef||{activeMeasureIndex:0},l=a(r,s),u=bu(0,{theme:n,hc:i},r,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=r.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=r.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),r.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&Tl(u,gu(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,r,t);if("byDimension"===t.input.mode)return function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.getCDef,o=void 0===i?kl:i,a=n.getCByField,s=void 0===a?Pl:a,l=n.getPersistence,u=void 0===l?Rl:l,c=o(t,r),d=s(r,c),m=d?d.raw():{},f=r&&r.pic?r.pic.raw():{};if(m.qError||m.qSize&&0===m.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:m.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===m.labelExpRef&&(p.label=r.input.altLabel)),!p.label&&d&&(p.label=d.title()),r.input.dimensionScheme&&(p.palettes={categorical:r.input.dimensionScheme}),r.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),Tl(p,u(t,r,c,d,{byRow:Ll,byElemNo:wl})),p}(e,r,t);if("byExpression"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!(s&&s.raw().qFallbackTitle&&(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||r.input.expressionIsColor)))return{mode:"constant",type:"constant",primary:n.nil};if(r.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=bu(0,{hc:i,theme:o},r,{f:s});return l.invalid||(l.label=r.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,r,t,n);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.input.useBaseColors;if(("byMultiple"===r.input.mode||"primary"===r.input.mode&&"measure"===r.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===r.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(n.primary):u.push(i)}}));var c=r.input.dimensionScheme?{categorical:r.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===r.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var m=[],f=[];return i.qDimensionInfo.forEach((function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){m.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(n.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:m.length?m[0]:void 0,explicit:m.length?{domain:m,range:f}:void 0}}var p=n.primary;if(void 0!==r.input.paletteColor)r.input.paletteColor&&(p=e.resolveUIColor(r.input.paletteColor));else{var h=r.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,r,t,n)}return{}}(e,t,r,n);return t.input.measureOverrides?(i.measureOverrides=t.input.measureOverrides.map((function(r,i){return function(e){var t,r=e.cm,n=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,r){var n=r.primary;return void 0!==t.paletteColor&&t.paletteColor&&(n=e.resolveUIColor(t.paletteColor)),gl(gl({},r),{},{mode:"constant",type:"constant",primary:n})}(r,o,n):"byExpression"===s?function(e,t,r){var n="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(n)&&"colorByMeasureExpression"===e.raw().id})),o=i;return gl(gl({},r),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:r.nil})}(i,a,n):null}({cm:e,input:r,defaults:n,index:i,pic:t.pic})})),function(e,t){var r,n,i,o=t.translator;if(Mu(e),1===(null===(r=e.measureOverrides)||void 0===r?void 0:r.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Su(e.measureOverrides,e.explicit),Mu(e)),null!==(n=e.measureOverrides)&&void 0!==n&&n.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Su(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(i,r)):i}function Cu(e){var t=gl({hc:null,colorProps:null,layout:null,theme:null},e),r={},n={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(n.auto=e,i):n.auto},getDimensionColorMap:function(e){return e?(n.getDimensionColorMap=e,i):n.getDimensionColorMap},getAttributeDimension:function(e){return e?(n.getAttributeDimension=e,i):n.getAttributeDimension},getMeasure:function(e){return e?(n.getMeasure=e,i):n.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Tl(t,e),(r={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=n.auto(e.layout);r.input=Tl(!0,{},r.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(r.input.dimensionScheme=a[0].key);var s=0;r.input.byDimDef&&+r.input.byDimDef.activeDimensionIndex>=0&&(s=+r.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&r.input.byDimDef&&(r.input.byDimDef.type="libraryItem",r.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=r.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(r.input=Tl(!1,{},r.input,{measureOverrides:null}))},palettes:function(){if(!r.palettes){var e=t.theme,n=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){n.push({key:"ui",colors:e.colors})})),r.palettes=n}return r.palettes},getAuxiliaryData:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=e.auxiliary||{},o=i.key;if("measure"===e.fieldType)return n.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(r,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?n.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?n.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,n){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,n).then((function(n){if(!n)return{};if("measure"===e.fieldType){if(n.coloring&&n.coloring.gradient){var o=r.pic.field(e.field);return gu(i,n.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=n[0],l=n[1]?n[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[r.pic.field(e.field).raw(),r.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,r,n){var i=n.external,o=n.field,a=gl({},e);Tl(a,wl(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=r.resolveUIColor(t.nul)),t.oth&&(a.others=r.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Tl(a,wl(o)))):!1===t.autoFill&&t.single?a.range=[r.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Tl(a,wl(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,r){for(var n={},i=0;i<e.length;i+=1)n[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;n[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(n[u])))}return a.push(-3,-2),o.push(r.others),o.push(r.nil),a},range:function(){return o}}}(t.colors,r,a)),a}(a,l,i,{external:t,field:r.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===r.uiPalette&&(r.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!r.uiPalette)return e.color;var t="none"===r.uiPalette.colors[0]?e.index:e.index-1;return void 0===r.uiPalette.colors[t]?e.color:r.uiPalette.colors[t]},settings:function(){if(this.palettes(),!r.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},n=t.theme;n&&(e=gl(gl({},e),n.getDataColorSpecials())),r.settings=Tl(e,Eu(this,r,t,e))}return r.settings}};return i}var qu=function(e,t){var r=e.fieldType,n={};if(t)if("measure"===r){var i=t.coloring;i&&(n.measureGradient=i.gradient)}else if("dimension"===r){var o=t[0],a=t[1];o&&(n.legendDataPage=o),a&&(n.dimValsData=a.colorMap)}return n},Ou=function(e){throw e.isHandled=!0,e},Au=function(e,t){var r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:r.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},Du=function(e,t){var r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:r.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},Nu=function(e,t){var r=t.layout,n=t.model,i=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.legendDataPage?Promise.resolve(r.snapshotData.content.chartData.legendDataPage):Promise.reject():n&&n.session&&i?n.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Ou):Promise.reject()};function Iu(e){var t=e.hc,r=e.source,n=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:r,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}function Tu(e){return function(t){return"object"===ml(t.datum[e])?t.datum[e].value:void 0}}function wu(e){return"object"===ml(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Lu(e){return-3===e.datum.value}var Ru=function(e,t,r){var n=e&&e.dock||void 0;if("auto"!==n)return n||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return r?"left":"right"},ku=function(e,t,r){return!(r.invalid||"color"===r.type||"measure"===r.mode&&t.qMeasureInfo.length<=1||"dimension"===r.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function Pu(e,t){var r=e.styleReference,n=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:Ru(o,n,i)},show:"function"==typeof o.show?function(){return ku(o,l,a)}:ku(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(r,"legend.title","color"):void 0,fontSize:s?s.getStyle(r,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(r,"legend.title","fontFamily"):"QlikView Sans, sans-serif"}}}}function ju(e,t,r){var n=[],i=[],o=function(e,t,r){return"categorical"===t.coloring.type?function(e,t,r){var n=Pu(e,t);if(!n.show)return!1;var i=e.key,o=e.styleReference,a=e.viewState,s=e.rtl,l=e.settings,u=e.style,c=t.scaleKey,d=t.theme,m=t.scales,f={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"},p="".concat(c,"Legend");return Tl(!0,n,{type:"legend-cat",key:"".concat(i,"-cat"),scale:p in m?p:c,settings:{layout:{scrollOffset:function(){return a?a.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(n.layout.dock)?2:1,direction:s?"rtl":"ltr",horizontal:20},item:{show:function(e){return-2!==e.datum.value},label:{fill:d?d.getStyle(o,"legend.label","color"):void 0,fontSize:d?d.getStyle(o,"legend.label","fontSize"):void 0,fontFamily:d?d.getStyle(o,"legend.label","fontFamily"):"QlikView Sans, sans-serif"}},navigation:{disabled:r,button:{content:function(e,t){var r=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:f[r]})])])}}}},brush:{consume:[{context:"selection",data:["",i],style:{inactive:{opacity:.3}}}]}},{settings:l,style:u})}(e,t,r):"continuous"===t.coloring.type&&function(e,t){var r=e.key,n=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=Pu(e,t);return!!u.show&&Tl(!0,u,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(n,"legend.label","color"):void 0,fontSize:l?l.getStyle(n,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(n,"legend.label","fontFamily"):"QlikView Sans, sans-serif"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}(e,t,r&&r.navigationDisabled);return n.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,r=e.requireFailure,n=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:r,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,r){var n;if(!r)return!0;if(null!=i&&null!==(n=i.interact)&&void 0!==n&&n.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=r.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,r)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.eventName,n=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:r,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===r||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:(e={},hl(e,"".concat(r,"start"),(function(e){e.preventDefault(),this.started!==r&&(this.started=r,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),hl(e,"".concat(r,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),hl(e,"".concat(r,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,r))),{interactions:i,components:n}}var Fu=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Vu(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,r=Cu(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var r=t.layout,n=t.app;return Au(e,{layout:r,app:n})})).getMeasure((function(e,t){var r=t.layout,n=t.app;return Du(e,{layout:r,app:n})})).getAttributeDimension((function(e,t){var r=t.layout,n=t.model,i=t.app;return Nu(e,{layout:r,model:n,app:i})}));return r.getSnapshotData=qu,r}({resources:e}),r={},n={},i=function(e){return n.settings||(e||console.warn("settings() called before auxiliarySettings()"),n.settings=t.settings()),n.settings},o={config:function(i){if(r=gl({},i),n={},!r.key)throw new Error("Missing key");t.set(gl(gl({},e),r))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return n.auxiliarySettings?Promise.resolve(n.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return n.auxiliarySettings=e||{},n.settings=gl(gl({},n.settings),n.auxiliarySettings),n.scales=void 0,n.color=void 0,n.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var r=i();return t.getAuxiliaryData(r,e).then((function(e){return t.getSnapshotData(r,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var r=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||r)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,r=e.coloring,n=e.theme,i=[];if(r&&r.palettes&&n){var o=r.palettes.categorical||t.dimensionScheme,a=n.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||n.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=r.palettes.metric||t.measureScheme,l=n.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(xl(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:r.colorProps,theme:r.theme})},scales:function(){return n.scales=n.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,r=e.coloring,n=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(r){var u={override:!0,domain:r.explicit&&"function"==typeof r.explicit.domain?r.explicit.domain:[].concat(xl((r.explicit||{}).domain||[]),[-3,-2]),range:r.explicit&&"function"==typeof r.explicit.range?r.explicit.range:[].concat(xl((r.explicit||{}).range||[]),[r.others,r.nil])};if("field"===r.mode){if("dimension"===r.fieldType){var c,d=Iu({hc:t,source:o,coloring:r}).data;if(r.legendDataset){var m=0,f={};a.data("q")({data:t}).extract({field:r.field,trackBy:r.valueAccessor,reduce:function(e){var t=e[0];return f[t]=m++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:d,range:r.range,domain:r.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=gl(gl({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===r.fieldType){var h={data:{field:r.field},min:r.min,max:r.max};s[l]=Tl({},h,{type:"categorical"===r.type?"threshold-color":"sequential-color",range:r.range,domain:r.domain,invert:r.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Tl({},h,{invert:!!n}))}else if("color"!==r.type)throw new Error("UNUSED FIELD")}else if("dimension"===r.mode){var y={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}else if("measure"===r.mode){var g={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,n;return!(null!==(t=r.explicit)&&void 0!==t&&null!==(n=t.exclude)&&void 0!==n&&n.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}}return s}({hc:r.hc,coloring:i(),key:r.key,source:r.source,picasso:e.picasso}),n.scales},color:function(){return n.color=n.color||function(e){var t=e.coloring,r=e.scales,n=e.key,i=Tu(n),o=Tu("".concat(n,"IsAnOther")),a=function(e,t){var n=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return Lu(e)||o(e)?u:l}:r[t]?function(e){return Lu(e)?u:wu(e)||-2===i(e)&&"dimension"===n||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return Lu(e)||o(e)?u:wu(e)?l:c}:"color"===d?function(e){return Lu(e)||o(e)?u:wu(e)?l:i(e)||u}:null},s=a(t,n);if(t.measureOverrides){var l=Tu("".concat(n,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:r.key}),n.color},datumProps:function(e){return function(e){var t,r,n=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(r={field:t,reduce:"first"},"color"===i.type&&(r.value=function(e){return"NaN"!==e.qNum?Fu(e.qNum):e.qText&&eu(e.qText)?e.qText:c})):"dimension"===i.mode?r=void 0!==i.field?i.field:n.qDimensionInfo.length-1:"measure"===i.mode&&(r=l);var d=hl({},u,r);return n.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:n.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:r.key,hc:r.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:r.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,d=void 0===c?{}:c,m=e.style,f=void 0===m?{}:m,p=arguments.length>1?arguments[1]:void 0;return ju({eventName:t,key:n,rtl:s,viewState:o,chart:a,styleReference:u,settings:d,style:f},{legendProps:r.legendProps,scaleKey:r.key,coloring:i(),theme:r.theme,hc:r.hc,scales:this.scales()},p)}};return o}var _u=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function zu(e){var t=e.qHyperCube,r=t.qDimensionInfo,n=t.qMeasureInfo,i=r.some(_u),o=n.some(_u),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function Hu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=gl(gl(gl({},e),t),{},{colorProps:gl(gl({},e.colorProps),t.colorProps||{})});return r}var $u=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Bu(e){var t,r=e.qHyperCube.qDimensionInfo.some($u),n=e.qHyperCube.qMeasureInfo.some($u),i=r?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:n?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Uu=function(){};function Yu(e){var t=e.chart,r=e.logicalSize;if(r)return r;var n=t?t.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}var Wu=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function Gu(e){var t=e.width,r=e.height,n=Wu.filter((function(e){return t>=e.size.width&&r>=e.size.height})).shift();return n?n.key:"SPARK"}var Ku={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Xu(e){var t=e.orientation,r=e.dock,n=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(r):function(e,t){var r="left"===e||"near"===e?"left":"right";return t?Ku[r]:r}(r,i),a=function(e,t,r){return"vertical"===e?t?"bottom":"top":r?"right":"left"}(t,n,i);return{current:o,opposite:Ku[o],start:a,end:Ku[a]}}function Ju(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Gu(e);var t=Xu({orientation:"horizontal",dock:r.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),n=t.current,i=t.opposite;u.x.dock=n,u.x.opposite=i,u.x.size=e.width;var o=Xu({orientation:"vertical",dock:r.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(Yu({chart:t,logicalSize:a})),c}var Zu="vertical",Qu="horizontal";function ec(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===Zu?Zu:Qu,m=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",meta:p,update:function(e){p.chart.orientation=r.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=Gu(e),p.major.orientation=function(e){var t=e.chartOrientation,r=e.invert;return e.layoutService.meta.isContinuous?Qu:r?t===Zu?Qu:Zu:t}({layoutService:r,chartOrientation:p.chart.orientation,invert:m});var t=Xu({orientation:p.major.orientation,dock:r.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),n=t.current,i=t.opposite;p.major.dock=n,p.major.opposite=i,p.major.size=p.major.orientation===Zu?e.height:e.width,f.forEach((function(t){var n={};n.orientation=p.major.orientation===Zu?Qu:Zu;var i=Xu({orientation:n.orientation,dock:r.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;n.dock=o,n.opposite=a,n.start=s,n.end=l,n.size=n.orientation===Zu?e.height:e.width,p[t.name]=n}))}};return h.update(Yu({chart:t,logicalSize:l})),h}function tc(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?Ju:ec)({chart:t,layoutService:r,config:i,typeConfig:a})}function rc(e,t,r){if(void 0===e||void 0===t)return r;for(var n=t.split("."),i=e,o=0;o<n.length;++o){var a=n[o];if(void 0===i[a])return r;i=i[a]}return i}function nc(e,t,r){if(void 0!==e&&void 0!==t){for(var n=t.split("."),i=n[n.length-1],o=e,a=0;a<n.length-1;++a){var s=n[a];void 0===o[s]&&(o[s]=Number.isNaN(+n[a+1])?{}:[]),o=o[s]}void 0!==r?o[i]=r:delete o[i]}}function ic(){var e={};return{get:function(t){return e[t]},set:function(t,r){return e[t]=r,r},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function oc(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=function(){return e.apply(n,o)};clearTimeout(t),t=setTimeout(s,r)}}function ac(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];r=s;var u=Date.now()-o,c=function(){o=Date.now(),n=0,e.apply(t,r)};n||(u>=i?c():n=setTimeout(c,i-u))}}function sc(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,r=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(r)return r;var n=e.qStateCounts||{},i=n.qLocked,o=void 0===i?0:i,a=n.qOption,s=void 0===a?0:a,l=n.qSelected;return o+s+(void 0===l?0:l)}))}function lc(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:sc(e)}}}(e);case"K":return function(e){var t=sc(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=sc(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function uc(e){var t=e.originalArray,r=e.newArray,n=e.matchKey;return Array.isArray(t)&&t.length?(r.forEach((function(e){var r=-1;t.some((function(t,i){return t[n]&&t[n]===e[n]&&(r=i),r})),r>-1?t[r]=e:t.push(e)})),t):r}function cc(e){return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fc(e,t,r){return t&&mc(e.prototype,t),r&&mc(e,r),e}function pc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){pc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gc(e,t){return(gc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vc(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function bc(e,t,r){return(bc=vc()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&gc(i,r.prototype),i}).apply(null,arguments)}function xc(e){return function(e){if(Array.isArray(e))return Sc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Mc(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 Mc(e,t){if(e){if("string"==typeof e)return Sc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sc(e,t):void 0}}function Sc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ec=Object.prototype.hasOwnProperty,Cc=Object.prototype.toString,qc=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,Ac=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Cc.call(e)},Dc=function(e){if(!e||"[object Object]"!==Cc.call(e))return!1;var t,r=Ec.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Ec.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||Ec.call(e,t)},Nc=function(e,t){qc&&"__proto__"===t.name?qc(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ic=function(e,t){if("__proto__"===t){if(!Ec.call(e,t))return;if(Oc)return Oc(e,t).value}return e[t]},Tc=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=Ic(s,r),s!==(i=Ic(t,r))&&(c&&i&&(Dc(i)||(o=Ac(i)))?(o?(o=!1,a=n&&Ac(n)?n:[]):a=n&&Dc(n)?n:{},Nc(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&Nc(s,{name:r,newValue:i}));return s};function wc(e,t,r){if(!e)return-1;var n=r.cache,i=e.origin?e.origin():null;i&&(e=i);var o=n.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<n.wrappedFields.length;l++)if(s=n.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=n.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function Lc(e,t,r){var n=r.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:n,field:e.field.key()}),i}function Rc(e){var t=e.cache,r=e.f,n=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=n;if(i.field&&i.field!==r){var m=wc(i.field,o,{cache:t});if(-1===m)return;d=Tc({qRow:a},m(s))}u[c]=Lc(i,d,{key:l})}function kc(e,t,r,n){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===cc(i[a].field)?i[a].field:t.field(i[a].field),c=n.normalizeConfig(i[a],t),d=c.props,m=c.main,f=Object.keys(d),p=!!i[a].trackBy,h=cc(i[a].trackBy),y={},g=[],v=[],b=0;b<s.qDataPages.length;b++){var x=wc(u,s.qDataPages[b],{cache:r});if(-1!==x)for(var M=0;M<s.qDataPages[b].qMatrix.length;M++){var S=s.qDataPages[b].qArea.qTop+M,E=Tc({qRow:S},x(s.qDataPages[b].qMatrix[M])),C=Lc(m,E,{key:l});if(!m.filter||m.filter(E)){for(var q=0;q<f.length;q++){var O=d[f[q]],A=O.fields||[O];O.fields&&(C[f[q]]=[]);for(var D=0;D<A.length;D++)Rc({cache:r,f:u,mainCell:E,p:A[D],prop:f[q],props:d,page:s.qDataPages[b],rowIdx:S,row:s.qDataPages[b].qMatrix[M],sourceKey:l,target:O.fields?C[f[q]]:C,targetProp:O.fields?D:f[q]});if(O.fields){var N=C[f[q]].map((function(e){return e.value})),I=C[f[q]].map((function(e){return e.label}));C[f[q]]={value:"function"==typeof O.value?O.value(N):void 0!==O.value?O.value:N,label:"function"==typeof O.label?O.label(I):void 0!==O.label?String(O.label):String(C[f[q]].value)}}}p&&n.track({cfg:i[a],itemData:E,obj:C,target:g,tracker:y,trackType:h}),v.push(C)}}}p?o.push.apply(o,xc(n.collect(g,{main:m,propsArr:f,props:d}))):o.push.apply(o,v)}return o}function Pc(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function jc(e,t){var r,n,i,o,a,s=new zc(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Fc);r=u.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(a=i.length))for(r.children=new Array(a),o=a-1;o>=0;--o)u.push(n=r.children[o]=new zc(i[o])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(_c)}function Fc(e){return e.children}function Vc(e){e.data=e.data.data}function _c(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function zc(e){this.data=e,this.depth=this.height=0,this.parent=null}function Hc(e){if("function"!=typeof e)throw new Error;return e}zc.prototype=jc.prototype={constructor:zc,count:function(){return this.eachAfter(Pc)},each:function(e){var t,r,n,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),r=o.children)for(n=0,i=r.length;n<i;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(r=0,n=t.length;r<n;++r)o.push(t[r]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,r,n=this,i=[n];n=i.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return jc(this).eachBefore(Vc)}};var $c={depth:-1},Bc={};function Uc(e){return e.id}function Yc(e){return e.parentId}function Wc(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var r,n=e.split("/"),i=t,o=0;o<n.length;o++){if("*"===n[o]&&Array.isArray(i)){var a=[];r=n.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=Wc(r,i[s]);Array.isArray(l)?a.push.apply(a,xc(l)):a.push(l)}return a}if(!n[o]&&Array.isArray(i)){var u=new Array(i.length);r=n.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=Wc(r,i[c]);return u}n[o]in i&&(i=i[n[o]])}return i}function Gc(e,t,r){var n=[];if(!e||!e.length)return n;if(t<=0){var i=r>=0?[e[r]]:e;n.push.apply(n,xc(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&n.push.apply(n,xc(Gc(e[o].children,t-1,r)));return n}function Kc(e,t,r){if(e===t)return function(e){return e};if(e>t){var n=Math.max(0,Math.min(100,e-t)),i=xc(Array(n)).map(String.prototype.valueOf,"parent").join(".");return Function("node","return node.".concat(i,";"))}if(t>e){var o=Math.max(0,Math.min(100,t-e));return function(e){return Gc(e.children,o-1,r)}}return!1}function Xc(e,t){var r=t.cache;if("number"==typeof e)return r.fields[e];var n=r.allFields;if("function"==typeof e){for(var i=0;i<n.length;i++)if(e(n[i]))return n[i];return!1}if("string"==typeof e){for(var o=0;o<n.length;o++)if(n[o].key()===e||n[o].title()===e)return n[o]}else if(e&&-1!==n.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var Jc=/^qDimensionInfo(?:\/(\d+))?/,Zc=/^\/?qMeasureInfo\/(\d+)/,Qc=/\/qAttrExprInfo\/(\d+)/,ed=/\/qAttrDimInfo\/(\d+)/;function td(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function rd(e,t){var r=t.cube;if(!e)return-1;var n=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=n,d=r.qEffectiveInterColumnSortOrder,m=td(r);return Jc.test(c)&&(i=!0,o=+Jc.exec(c)[1],c=n.replace(Jc,"")),Zc.test(c)&&("K"===r.qMode?l=+Zc.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+Zc.exec(c)[1],u=0):u=+Zc.exec(c)[1],c=c.replace(Zc,"")),c&&(ed.exec(c)?s=+ed.exec(c)[1]:Qc.exec(c)&&(a=+Qc.exec(c)[1])),{fieldDepth:(i?"S"===r.qMode?m[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):r.qDimensionInfo.length-("K"===r.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function nd(e,t){var r,n,i=Kc(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return r=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?n=function(e){var r;return null==e||null===(r=e.qAttrDims)||void 0===r?void 0:r.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(n=function(e){var r;return null==e||null===(r=e.qAttrExps)||void 0===r?void 0:r.qValues[t.attrIdx]}),{nodeFn:i,attrFn:n,valueFn:r}}function id(e,t,r){var n=r.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:n,field:e.field.key()}),i}function od(e){for(var t=e.propsArr,r=e.props,n=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=r[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var m=function(e){var r=u[e],m=void 0,f=void 0,p=void 0,h=void 0,y=void 0,g=void 0;if("primitive"===r.type?(p=r.value,g=String(r.value)):("function"==typeof r.value&&(m=function(e){return r.value(e,n)}),"function"==typeof r.label&&(f=function(e){return r.label(e,n)}),r.accessor?(h=r.accessor(n),Array.isArray(h)?(y=h.map(r.valueAccessor),r.attrAccessor&&(y=y.map(r.attrAccessor)),m&&(p=y.map(m),m=null),f&&(g=y.map(f),f=null),p=r.reduce?r.reduce(p):p,g=r.reduceLabel?r.reduceLabel(g,p):String(p)):g=p=r.attrAccessor?r.attrAccessor(r.valueAccessor(h)):r.valueAccessor(h)):(p=i,g=i)),l.fields){var v=m?m(p):p;c.push(v),d.push(f&&null!=g?f(g):null!=g?g:String(v))}else{var b=m?m(p):p;o[t[s]]={value:b,label:f?f(g):null!=g?g:String(b)},r.field&&(o[t[s]].source={field:r.field.key(),key:a})}},f=0;f<u.length;f++)m(f);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,n):c,label:"function"==typeof l.label?l.label(d,n):d})}}var ad=function(e,t,r){var n="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Wc(n,e);return o&&o[0]?(t.tree=jc(o[0],r.children||function(e){return e[i]}),t.tree):null};function sd(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){var t=e.raw().qColumnOrder,r=e.fields();return t&&t.length===r.length?t:r.map((function(e,t){return t}))}(e),n=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return r.indexOf(n.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return r.indexOf(n.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var m=l[i[d]],f="".concat(u,"__").concat(m.qText);a[f]||(a[f]=yc({__id:f,__parent:u,qValues:[]},m),c=!0),u=f}if(c)for(var p=0;p<o.length;p++){var h=l[o[p]];a[u].qValues.push(h)}}var y=Object.keys(a).map((function(e){return a[e]}));return function(){var e=Uc,t=Yc;function r(r){var n,i,o,a,s,l,u,c=r.length,d=new Array(c),m={};for(i=0;i<c;++i)n=r[i],s=d[i]=new zc(n),null!=(l=e(n,i,r))&&(l+="")&&(m[u="$"+(s.id=l)]=u in m?Bc:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(r[i],i,r))&&(l+="")){if(!(a=m["$"+l]))throw new Error("missing: "+l);if(a===Bc)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=$c,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(_c),o.parent=null,c>0)throw new Error("cycle");return o}return r.id=function(t){return arguments.length?(e=Hc(t),r):e},r.parentId=function(e){return arguments.length?(t=Hc(e),r):t},r}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(y)}var ld=function(e){for(var t=e.propsArr,r=e.props,n=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=r[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var m=nd(o,rd(d.field,{cube:n,cache:i}));d.accessor=m.nodeFn,d.valueAccessor=m.valueFn,d.attrAccessor=m.attrFn}}};function ud(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?sd(t):ad(i,r,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=td(i),m=d[u-1];c=r.fields[m]}else{var f=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(f=i.qDimensionInfo.length),c=r.fields[f]}var p=n.normalizeConfig(yc(yc({},e),{},{field:c?c.key():void 0}),t),h=p.props,y=p.main,g=Object.keys(h);l[u]={propsArr:g,props:h,main:y};var v=c?rd(c,{cube:i,cache:r}):{fieldDepth:0};ld({propsArr:g,props:h,cube:i,cache:r,itemDepthObject:v,f:c})}for(var b=a.copy(),x=b.descendants(),M=a.descendants(),S=0;S<M.length;S++){var E=l[M[S].depth].propsArr,C=l[M[S].depth].props,q=l[M[S].depth].main,O=x[S],A=O.data,D=id(q,A,{key:o});od({propsArr:E,props:C,item:O,itemData:A,ret:D,sourceKey:o,isTree:!0}),M[S].data=D}return a}function cd(e,t,r,n){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!ad(s,r,e))continue;var u="object"===cc(i[a].field)?i[a].field:t.field(i[a].field),c=n.normalizeConfig(i[a],t),d=c.props,m=c.main,f=Object.keys(d),p=rd(u,{cube:s,cache:r}),h=nd({fieldDepth:0},p),y=h.nodeFn,g=h.attrFn,v=h.valueFn;ld({propsArr:f,props:d,cube:s,cache:r,itemDepthObject:p,f:u});for(var b=!!i[a].trackBy,x=cc(i[a].trackBy),M={},S=[],E=y(r.tree),C=[],q=0;q<E.length;q++){var O=E[q],A=g?g(v(O)):v(O);if(!m.filter||m.filter(A)){var D=id(m,A,{key:l});od({propsArr:f,props:d,item:O,itemData:A,ret:D,sourceKey:l}),b&&n.track({cfg:i[a],itemData:A,obj:D,target:S,tracker:M,trackType:x}),C.push(D)}}b?o.push.apply(o,xc(n.collect(S,{main:m,propsArr:f,props:d}))):o.push.apply(o,C)}return o}var dd,md=(function(e){
7
+ import{useElement as e,useState as t,useEffect as r,useRect as n,usePromise as i,useStaleLayout as o,useModel as a,useApp as s,useAppLayout as l,usePlugins as u,useOptions as c,useTranslator as d,useEmbed as m,useTheme as f,useDeviceType as p,useConstraints as h,useLayout as y,useAction as g,useSelections as v,onTakeSnapshot as b,useImperativeHandle as x}from"@nebula.js/stardust";import M from"hammerjs";import S from"picasso.js";import E from"picasso-plugin-q";import C from"picasso-plugin-hammer";import q from"react";import{Button as O,Popover as A,List as D,ListItem as N,ListItemIcon as I,ListItemText as T}from"@material-ui/core";import w from"react-dom";import{createGenerateClassName as L,StylesProvider as R,ThemeProvider as k}from"@material-ui/styles";function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Object.prototype.hasOwnProperty,F=Object.prototype.toString,V=Object.defineProperty,_=Object.getOwnPropertyDescriptor,B=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===F.call(e)},H=function(e){if(!e||"[object Object]"!==F.call(e))return!1;var t,r=j.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&j.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||j.call(e,t)},$=function(e,t){V&&"__proto__"===t.name?V(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},z=function(e,t){if("__proto__"===t){if(!j.call(e,t))return;if(_)return _(e,t).value}return e[t]},U=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=z(s,r),s!==(i=z(t,r))&&(c&&i&&(H(i)||(o=B(i)))?(o?(o=!1,a=n&&B(n)?n:[]):a=n&&H(n)?n:{},$(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&$(s,{name:r,newValue:i}));return s};const Y="center",W="bottom";var G={NoDataExist:{label:"NoDataExist",alignment:Y,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:Y,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:Y,default:!1},LimitedData:{label:"LimitedData",alignment:W,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:W,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:W,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:W,default:!1}};const K=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],X={};K.forEach((([e,{width:t,height:r}])=>{X[e]={width:t,height:r}}));const J={getLayoutModes:()=>X,getLayoutMode(e,t){let r;for(r=0;r<K.length;++r)if(e>=K[r][1].width&&t>=K[r][1].height)return K[r][0];return"SPARK"}};const Z=["$date","$timestamp","$time"],Q=["D","TS","T"],ee={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>Z.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&Q.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(ee.hasTimeTag(t)&&ee.hasUnknownFormat(t)||ee.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&ee.isTimeDimension(e,t.qHyperCube.qDimensionInfo[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some((e=>"$numeric"===e)))},canBeContinuous:e=>!(!(e&&e.qHyperCube&&e.qHyperCube.qDimensionInfo)||e.qHyperCube.qDimensionInfo.length<1)&&ee.canBeContinuousDimension(e.qHyperCube.qDimensionInfo[0]),maxNumberOfLines:12},te=(e,t,r)=>{const n=t.split(".");let i,o=e;if(void 0===o)return r;for(i=0;i<n.length;++i){if(void 0===o[n[i]])return r;o=o[n[i]]}return o},re=e=>te(e,"qHyperCube.qDimensionInfo",[]),ne=e=>te(e,"qHyperCube.qMeasureInfo",[]),ie=e=>te(e,"barGrouping.grouping"),oe={continuous:(e,t=!1)=>!!ee.canBeContinuous(e)&&(te(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!re(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===ie(e)&&(re(e).length>1||ne(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&re(e).length>1&&1===ne(e).length},groupedByMeasure(e){return this.grouped(e)&&1===re(e).length&&ne(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==ie(e)||this.continuous(e))&&(re(e).length>1||ne(e).length>1)},stackedByDimension(e){return this.stacked(e)&&re(e).length>1&&1===ne(e).length},stackedByMeasure(e){return this.stacked(e)&&1===re(e).length&&ne(e).length>1},simple:e=>0===re(e).length||1===re(e).length&&1===ne(e).length,snapshot:e=>!!te(e,"snapshotData")};function ae(e,t){const r=e.component(t);return r&&r._DO_NOT_USE_getInfo&&r._DO_NOT_USE_getInfo().offset}const se=e=>{throw e.isHandled=!0,e};const le={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":return"far";case"far":return"near";default:return"far"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,r)=>"vertical"===e||"y"===e?le.getVerticalDock(t):r?le.getOppositeDock(le.getHorizontalDock(t)):le.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment(e,t){switch(e){case"vertical":return"near"===t||"bottom"===t?1:0;default:return"near"===t||"left"===t?0:1}},getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:r})=>"vertical"===e?t:r},ue={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),r=e.match(/[\u3040-\u309F]/g),n=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,r=r?r.length:0,n=n?n.length:0;const i=t+r+n;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,r="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const n={latin:0,cjk:0};let i;void 0===t?e.forEach((e=>{i=ue.getCharacterRatios(e[r]),n.latin+=i.latin,n.cjk+=i.cjk})):e.forEach((e=>{i=ue.getCharacterRatios(e[t][r]),n.latin+=i.latin,n.cjk+=i.cjk}));const o=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/o,n.cjkRatio=n.cjk/o,n},getAdjustedMaxGlyphCount(e,t,r,n="qText"){const i=ue.getTotalCharacterRatios(t,r,n),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(ue.stringWidthOverMWidth(o)+1.0909090909090908*a)}};function ce(){if(!document.querySelector("#la-vie-tooltip")){const e=document.createElement("div");e.id="la-vie-tooltip",e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function de({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ce()},beforeUpdate(){ce()},destroyed(){!function(){const e=document.querySelector("#la-vie-tooltip");e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector("#la-vie-tooltip"),content:({h:e,data:t,style:r})=>t[0].map((t=>e("tr",{},function(e,{h:t,style:r}){return e.map((e=>{const n={style:{...r.cell||{},...e.style||{}},class:e.class};return e.colspan&&(n.colspan=e.colspan),t("td",n,e.content)}))}(t,{h:e,style:r})))),direction:t?"rtl":"ltr"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"QlikView Sans, sans-serif","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const me=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),fe=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),pe=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),he={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>me.test(e),isRtlChar:e=>fe.test(e)||pe.test(e),detectTextDirection(e){const t=e?e.length:0;let r,n;for(r=0;r<t;r++){if(n=e[r],he.isLtrChar(n))return"ltr";if(he.isRtlChar(n))return"rtl"}return"ltr"}},ye={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,r){const n=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(r.coloring.label&&(a.label=""+r.coloring.label),"color"!==r.coloring.type&&n.fillTooltip){const e=i("fill"),t="measure"===r.coloring.fieldType;if(a.value=t&&e?e(n.fillTooltip.value):n.fillTooltip.label?n.fillTooltip.label:n.fillTooltip.value,!r.coloring.label){const e=o(n.fillTooltip.source.key).field(n.fillTooltip.source.field).title();a.label=""+e}}return a.fill=void 0===n._fillColor?ye.getNodeFillColor(t):n._fillColor,a},getMeasure:(e,t)=>({label:""+e(t.source.key).field(t.source.field).title(),value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const r=he.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:r},colspan:2},{}]},getDescriptionRow(e,t){const r=he.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:r},colspan:2},{}]},getNMoreRow(e,t,r){const n=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:n,style:{"font-weight":"bold","text-align":r?"right":"left",direction:he.detectTextDirection(n)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",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:2},{}],getColorRow(e,t,r){const n=he.detectTextDirection(t.color.label),i=r?[":",t.color.label]:[t.color.label,":"],o=he.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":r?"right":"left",direction:n}},{content:r?[t.color.value,ye.getColorSymbol(e,t)]:[ye.getColorSymbol(e,t),t.color.value],style:{"text-align":r?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,r,n,i=!1){const o=he.detectTextDirection(e.label),a=n?[":",e.label]:[e.label,":"],s=he.detectTextDirection(e.value);let l;return l=i?n?[e.value,ye.getColorSymbol(t,r)]:[ye.getColorSymbol(t,r),e.value]:[e.value],[{content:a,style:{"text-align":n?"right":"left",direction:o}},{content:l,style:{"text-align":n?"left":"right",direction:s,"vertical-align":"middle"}}]}};function ge(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ve(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function be(){}var xe=1/.7,Me="\\s*([+-]?\\d+)\\s*",Se="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ce=/^#([0-9a-f]{3,8})$/,qe=new RegExp("^rgb\\("+[Me,Me,Me]+"\\)$"),Oe=new RegExp("^rgb\\("+[Ee,Ee,Ee]+"\\)$"),Ae=new RegExp("^rgba\\("+[Me,Me,Me,Se]+"\\)$"),De=new RegExp("^rgba\\("+[Ee,Ee,Ee,Se]+"\\)$"),Ne=new RegExp("^hsl\\("+[Se,Ee,Ee]+"\\)$"),Ie=new RegExp("^hsla\\("+[Se,Ee,Ee,Se]+"\\)$"),Te={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function we(){return this.rgb().formatHex()}function Le(){return this.rgb().formatRgb()}function Re(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ce.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?ke(t):3===r?new Ve(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Pe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Pe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=qe.exec(e))?new Ve(t[1],t[2],t[3],1):(t=Oe.exec(e))?new Ve(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ae.exec(e))?Pe(t[1],t[2],t[3],t[4]):(t=De.exec(e))?Pe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ne.exec(e))?$e(t[1],t[2]/100,t[3]/100,1):(t=Ie.exec(e))?$e(t[1],t[2]/100,t[3]/100,t[4]):Te.hasOwnProperty(e)?ke(Te[e]):"transparent"===e?new Ve(NaN,NaN,NaN,0):null}function ke(e){return new Ve(e>>16&255,e>>8&255,255&e,1)}function Pe(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ve(e,t,r,n)}function je(e){return e instanceof be||(e=Re(e)),e?new Ve((e=e.rgb()).r,e.g,e.b,e.opacity):new Ve}function Fe(e,t,r,n){return 1===arguments.length?je(e):new Ve(e,t,r,null==n?1:n)}function Ve(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function _e(){return"#"+He(this.r)+He(this.g)+He(this.b)}function Be(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function He(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function $e(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,r,n)}function ze(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof be||(e=Re(e)),!e)return new Ue;if(e instanceof Ue)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ue(a,s,l,e.opacity)}function Ue(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Ye(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}ge(be,Re,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:we,formatHex:we,formatHsl:function(){return ze(this).formatHsl()},formatRgb:Le,toString:Le}),ge(Ve,Fe,ve(be,{brighter:function(e){return e=null==e?xe:Math.pow(xe,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_e,formatHex:_e,formatRgb:Be,toString:Be})),ge(Ue,(function(e,t,r,n){return 1===arguments.length?ze(e):new Ue(e,t,r,null==n?1:n)}),ve(be,{brighter:function(e){return e=null==e?xe:Math.pow(xe,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ve(Ye(e>=240?e-240:e+120,i,n),Ye(e,i,n),Ye(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var We=Math.PI/180,Ge=180/Math.PI,Ke=4/29,Xe=6/29,Je=3*Xe*Xe;function Ze(e){if(e instanceof Qe)return new Qe(e.l,e.a,e.b,e.opacity);if(e instanceof at)return st(e);e instanceof Ve||(e=je(e));var t,r,n=nt(e.r),i=nt(e.g),o=nt(e.b),a=et((.2225045*n+.7168786*i+.0606169*o)/1);return n===i&&i===o?t=r=a:(t=et((.4360747*n+.3850649*i+.1430804*o)/.96422),r=et((.0139322*n+.0971045*i+.7141733*o)/.82521)),new Qe(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Qe(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function et(e){return e>.008856451679035631?Math.pow(e,1/3):e/Je+Ke}function tt(e){return e>Xe?e*e*e:Je*(e-Ke)}function rt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function it(e){if(e instanceof at)return new at(e.h,e.c,e.l,e.opacity);if(e instanceof Qe||(e=Ze(e)),0===e.a&&0===e.b)return new at(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ge;return new at(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ot(e,t,r,n){return 1===arguments.length?it(e):new at(e,t,r,null==n?1:n)}function at(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function st(e){if(isNaN(e.h))return new Qe(e.l,0,0,e.opacity);var t=e.h*We;return new Qe(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ge(Qe,(function(e,t,r,n){return 1===arguments.length?Ze(e):new Qe(e,t,r,null==n?1:n)}),ve(be,{brighter:function(e){return new Qe(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Qe(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Ve(rt(3.1338561*(t=.96422*tt(t))-1.6168667*(e=1*tt(e))-.4906146*(r=.82521*tt(r))),rt(-.9787684*t+1.9161415*e+.033454*r),rt(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),ge(at,ot,ve(be,{brighter:function(e){return new at(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new at(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return st(this).rgb()}}));var lt={isDark:function(e){return ot(e).l<70}};function ut(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ct(e){return 1===e.length&&(e=function(e){return function(t,r){return ut(e(t),r)}}(e)),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)<0?n=o+1:i=o}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)>0?i=o:n=o+1}return n}}}var dt=ct(ut).right,mt=Math.sqrt(50),ft=Math.sqrt(10),pt=Math.sqrt(2);function ht(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,i);return i>=0?(o>=mt?10:o>=ft?5:o>=pt?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=mt?10:o>=ft?5:o>=pt?2:1)}function yt(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=mt?i*=10:o>=ft?i*=5:o>=pt&&(i*=2),t<e?-i:i}function gt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function vt(){}function bt(e,t){var r=new vt;if(e instanceof vt)e.each((function(e,t){r.set(t,e)}));else if(Array.isArray(e)){var n,i=-1,o=e.length;if(null==t)for(;++i<o;)r.set(i,e[i]);else for(;++i<o;)r.set(t(n=e[i],i,e),n)}else if(e)for(var a in e)r.set(a,e[a]);return r}function xt(){}vt.prototype=bt.prototype={constructor:vt,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var Mt=bt.prototype;xt.prototype={constructor:xt,has:Mt.has,add:function(e){return this["$"+(e+="")]=e,this},remove:Mt.remove,clear:Mt.clear,values:Mt.keys,size:Mt.size,empty:Mt.empty,each:Mt.each};var St=Array.prototype,Et=St.map,Ct=St.slice;function qt(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ot(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function At(){}var Dt=1/.7,Nt="\\s*([+-]?\\d+)\\s*",It="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wt=/^#([0-9a-f]{3})$/,Lt=/^#([0-9a-f]{6})$/,Rt=new RegExp("^rgb\\("+[Nt,Nt,Nt]+"\\)$"),kt=new RegExp("^rgb\\("+[Tt,Tt,Tt]+"\\)$"),Pt=new RegExp("^rgba\\("+[Nt,Nt,Nt,It]+"\\)$"),jt=new RegExp("^rgba\\("+[Tt,Tt,Tt,It]+"\\)$"),Ft=new RegExp("^hsl\\("+[It,Tt,Tt]+"\\)$"),Vt=new RegExp("^hsla\\("+[It,Tt,Tt,It]+"\\)$"),_t={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Bt(e){var t;return e=(e+"").trim().toLowerCase(),(t=wt.exec(e))?new Yt((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Lt.exec(e))?Ht(parseInt(t[1],16)):(t=Rt.exec(e))?new Yt(t[1],t[2],t[3],1):(t=kt.exec(e))?new Yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Pt.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=jt.exec(e))?$t(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ft.exec(e))?Gt(t[1],t[2]/100,t[3]/100,1):(t=Vt.exec(e))?Gt(t[1],t[2]/100,t[3]/100,t[4]):_t.hasOwnProperty(e)?Ht(_t[e]):"transparent"===e?new Yt(NaN,NaN,NaN,0):null}function Ht(e){return new Yt(e>>16&255,e>>8&255,255&e,1)}function $t(e,t,r,n){return n<=0&&(e=t=r=NaN),new Yt(e,t,r,n)}function zt(e){return e instanceof At||(e=Bt(e)),e?new Yt((e=e.rgb()).r,e.g,e.b,e.opacity):new Yt}function Ut(e,t,r,n){return 1===arguments.length?zt(e):new Yt(e,t,r,null==n?1:n)}function Yt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Wt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Gt(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xt(e,t,r,n)}function Kt(e){if(e instanceof Xt)return new Xt(e.h,e.s,e.l,e.opacity);if(e instanceof At||(e=Bt(e)),!e)return new Xt;if(e instanceof Xt)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Xt(a,s,l,e.opacity)}function Xt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Jt(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}qt(At,Bt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),qt(Yt,Ut,Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+Wt(this.r)+Wt(this.g)+Wt(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),qt(Xt,(function(e,t,r,n){return 1===arguments.length?Kt(e):new Xt(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new Xt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Xt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Yt(Jt(e>=240?e-240:e+120,i,n),Jt(e,i,n),Jt(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Zt=Math.PI/180,Qt=180/Math.PI,er=4/29,tr=6/29,rr=3*tr*tr;function nr(e){if(e instanceof ir)return new ir(e.l,e.a,e.b,e.opacity);if(e instanceof cr){if(isNaN(e.h))return new ir(e.l,0,0,e.opacity);var t=e.h*Zt;return new ir(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof Yt||(e=zt(e));var r,n,i=lr(e.r),o=lr(e.g),a=lr(e.b),s=or((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?r=n=s:(r=or((.4360747*i+.3850649*o+.1430804*a)/.96422),n=or((.0139322*i+.0971045*o+.7141733*a)/.82521)),new ir(116*s-16,500*(r-s),200*(s-n),e.opacity)}function ir(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function or(e){return e>.008856451679035631?Math.pow(e,1/3):e/rr+er}function ar(e){return e>tr?e*e*e:rr*(e-er)}function sr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function lr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ur(e){if(e instanceof cr)return new cr(e.h,e.c,e.l,e.opacity);if(e instanceof ir||(e=nr(e)),0===e.a&&0===e.b)return new cr(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Qt;return new cr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function cr(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}qt(ir,(function(e,t,r,n){return 1===arguments.length?nr(e):new ir(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return new ir(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new ir(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Yt(sr(3.1338561*(t=.96422*ar(t))-1.6168667*(e=1*ar(e))-.4906146*(r=.82521*ar(r))),sr(-.9787684*t+1.9161415*e+.033454*r),sr(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),qt(cr,(function(e,t,r,n){return 1===arguments.length?ur(e):new cr(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return new cr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new cr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return nr(this).rgb()}}));var dr=-.29227,mr=-.90649,fr=1.97294,pr=fr*mr,hr=1.78277*fr,yr=-.6557636667999999;function gr(e){if(e instanceof vr)return new vr(e.h,e.s,e.l,e.opacity);e instanceof Yt||(e=zt(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(yr*n+pr*t-hr*r)/(yr+pr-hr),o=n-i,a=(fr*(r-i)-dr*o)/mr,s=Math.sqrt(a*a+o*o)/(fr*i*(1-i)),l=s?Math.atan2(a,o)*Qt-120:NaN;return new vr(l<0?l+360:l,s,i,e.opacity)}function vr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function br(e){return function(){return e}}function xr(e){return 1==(e=+e)?Mr:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):br(isNaN(t)?r:t)}}function Mr(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):br(isNaN(e)?t:e)}qt(vr,(function(e,t,r,n){return 1===arguments.length?gr(e):new vr(e,t,r,null==n?1:n)}),Ot(At,{brighter:function(e){return e=null==e?Dt:Math.pow(Dt,e),new vr(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new vr(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*Zt,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new Yt(255*(t+r*(-.14861*n+1.78277*i)),255*(t+r*(dr*n+mr*i)),255*(t+r*(fr*n)),this.opacity)}}));var Sr=function e(t){var r=xr(t);function n(e,t){var n=r((e=Ut(e)).r,(t=Ut(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=Mr(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function Er(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,o=new Array(i),a=new Array(n);for(r=0;r<i;++r)o[r]=Ir(e[r],t[r]);for(;r<n;++r)a[r]=t[r];return function(e){for(r=0;r<i;++r)a[r]=o[r](e);return a}}function Cr(e,t){var r=new Date;return t-=e=+e,function(n){return r.setTime(e+t*n),r}}function qr(e,t){return t-=e=+e,function(r){return e+t*r}}function Or(e,t){var r,n={},i={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Ir(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}var Ar=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dr=new RegExp(Ar.source,"g");function Nr(e,t){var r,n,i,o=Ar.lastIndex=Dr.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(r=Ar.exec(e))&&(n=Dr.exec(t));)(i=n.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:qr(r,n)})),o=Dr.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}function Ir(e,t){var r,n=typeof t;return null==t||"boolean"===n?br(t):("number"===n?qr:"string"===n?(r=Bt(t))?(t=r,Sr):Nr:t instanceof Bt?Sr:t instanceof Date?Cr:Array.isArray(t)?Er:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Or:qr)(e,t)}function Tr(e,t){return t-=e=+e,function(r){return Math.round(e+t*r)}}function wr(e){return+e}var Lr=[0,1];function Rr(e){return e}function kr(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Pr(e){var t,r=e[0],n=e[e.length-1];return r>n&&(t=r,r=n,n=t),function(e){return Math.max(r,Math.min(n,e))}}function jr(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=kr(i,n),o=r(a,o)):(n=kr(n,i),o=r(o,a)),function(e){return o(n(e))}}function Fr(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=kr(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(t){var r=dt(e,t,1,n)-1;return o[r](i[r](t))}}function Vr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _r(e,t){return function(){var e,t,r,n,i,o,a=Lr,s=Lr,l=Ir,u=Rr;function c(){return n=Math.min(a.length,s.length)>2?Fr:jr,i=o=null,d}function d(t){return isNaN(t=+t)?r:(i||(i=n(a.map(e),s,l)))(e(u(t)))}return d.invert=function(r){return u(t((o||(o=n(s,a.map(e),qr)))(r)))},d.domain=function(e){return arguments.length?(a=Et.call(e,wr),u===Rr||(u=Pr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Ct.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Ct.call(e),l=Tr,c()},d.clamp=function(e){return arguments.length?(u=e?Pr(a):Rr,d):u!==Rr},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,c()}}()(e,t)}function Br(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Hr(e){return(e=Br(Math.abs(e)))?e[1]:NaN}var $r,zr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ur(e){return new Yr(e)}function Yr(e){if(!(t=zr.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function Wr(e,t){var r=Br(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}Ur.prototype=Yr.prototype,Yr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gr={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Wr(100*e,t)},r:Wr,s:function(e,t){var r=Br(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-($r=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Br(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function Kr(e){return e}var Xr,Jr,Zr,Qr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function en(e){var t,r,n=e.grouping&&e.thousands?(t=e.grouping,r=e.thousands,function(e,n){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[a=(a+1)%t.length];return o.reverse().join(r)}):Kr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):Kr,s=e.percent||"%";function l(e){var t=(e=Ur(e)).fill,r=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,m=e.comma,f=e.precision,p=e.trim,h=e.type;"n"===h?(m=!0,h="g"):Gr[h]||(null==f&&(f=12),p=!0,h="g"),(c||"0"===t&&"="===r)&&(c=!0,t="0",r="=");var y="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",g="$"===u?i[1]:/[%p]/.test(h)?s:"",v=Gr[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=y,M=g;if("c"===h)M=v(e)+M,e="";else{var S=(e=+e)<0;if(e=v(Math.abs(e),f),p&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(i>0){if(!+e[n])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&(S=!1),x=(S?"("===l?l:"-":"-"===l||"("===l?"":l)+x,M=("s"===h?Qr[8+$r/3]:"")+M+(S&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){M=(46===u?o+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}m&&!c&&(e=n(e,1/0));var E=x.length+e.length+M.length,C=E<d?new Array(d-E+1).join(t):"";switch(m&&c&&(e=n(C+e,C.length?d-M.length:1/0),C=""),r){case"<":e=x+e+M+C;break;case"=":e=x+C+e+M;break;case"^":e=C.slice(0,E=C.length>>1)+x+e+M+C.slice(E);break;default:e=C+x+e+M}return a(e)}return f=null==f?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var r=l(((e=Ur(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(Hr(t)/3))),i=Math.pow(10,-n),o=Qr[8+n/3];return function(e){return r(i*e)+o}}}}function tn(e,t,r,n){var i,o=yt(e,t,r);switch((n=Ur(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Hr(t)/3)))-Hr(Math.abs(e)))}(o,a))||(n.precision=i),Zr(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hr(t)-Hr(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(e){return Math.max(0,-Hr(Math.abs(e)))}(o))||(n.precision=i-2*("%"===n.type))}return Jr(n)}function rn(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){var n,i,o,a,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t<e)&&(i=e,e=t,t=i),0===(a=ht(e,t,r))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return n&&o.reverse(),o}(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return tn(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(n=s,s=l,l=n,n=o,o=a,a=n),(n=ht(s,l,r))>0?n=ht(s=Math.floor(s/n)*n,l=Math.ceil(l/n)*n,r):n<0&&(n=ht(s=Math.ceil(s*n)/n,l=Math.floor(l*n)/n,r)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(l/n)*n,t(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(l*n)/n,t(i)),e},e}function nn(){var e=_r(Rr,Rr);return e.copy=function(){return Vr(e,nn())},gt.apply(e,arguments),rn(e)}Xr=en({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Jr=Xr.format,Zr=Xr.formatPrefix;var on=new Date,an=new Date;function sn(e,t,r,n){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},i.round=function(e){var t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=function(e,r){return t(e=new Date(+e),null==r?1:Math.floor(r)),e},i.range=function(r,n,o){var a,s=[];if(r=i.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return s;do{s.push(a=new Date(+r)),t(r,o),e(r)}while(a<r&&r<n);return s},i.filter=function(r){return sn((function(t){if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(i.count=function(t,n){return on.setTime(+t),an.setTime(+n),e(on),e(an),Math.floor(r(on,an))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(n?function(t){return n(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var ln=sn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));ln.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?sn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):ln:null};var un=sn((function(e){e.setTime(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}));sn((function(e){e.setTime(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),sn((function(e){var t=6e4*e.getTimezoneOffset()%36e5;t<0&&(t+=36e5),e.setTime(36e5*Math.floor((+e-t)/36e5)+t)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}));var cn=sn((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}));function dn(e){return sn((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}))}var mn=dn(0),fn=dn(1);dn(2),dn(3);var pn=dn(4);dn(5),dn(6),sn((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()}));var hn=sn((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()}));hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var yn=sn((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()})),gn=sn((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()})),vn=sn((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 bn(e){return sn((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}))}var xn=bn(0),Mn=bn(1);bn(2),bn(3);var Sn=bn(4);bn(5),bn(6);var En=sn((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()})),Cn=sn((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()}));function qn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function On(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function An(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}Cn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var Dn,Nn,In,Tn={"-":"",_:" ",0:"0"},wn=/^\s*\d+/,Ln=/^%/,Rn=/[\\^$*+?|[\]().{}]/g;function kn(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(t)+i:i)}function Pn(e){return e.replace(Rn,"\\$&")}function jn(e){return new RegExp("^(?:"+e.map(Pn).join("|")+")","i")}function Fn(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function Vn(e,t,r){var n=wn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function _n(e,t,r){var n=wn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Bn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Hn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function $n(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function zn(e,t,r){var n=wn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Un(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Yn(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Wn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Gn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Kn(e,t,r){var n=wn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Xn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Jn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Zn(e,t,r){var n=wn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Qn(e,t,r){var n=wn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ei(e,t,r){var n=wn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ti(e,t,r){var n=Ln.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function ri(e,t,r){var n=wn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function ni(e,t,r){var n=wn.exec(t.slice(r));return n?(e.Q=1e3*+n[0],r+n[0].length):-1}function ii(e,t){return kn(e.getDate(),t,2)}function oi(e,t){return kn(e.getHours(),t,2)}function ai(e,t){return kn(e.getHours()%12||12,t,2)}function si(e,t){return kn(1+cn.count(hn(e),e),t,3)}function li(e,t){return kn(e.getMilliseconds(),t,3)}function ui(e,t){return li(e,t)+"000"}function ci(e,t){return kn(e.getMonth()+1,t,2)}function di(e,t){return kn(e.getMinutes(),t,2)}function mi(e,t){return kn(e.getSeconds(),t,2)}function fi(e){var t=e.getDay();return 0===t?7:t}function pi(e,t){return kn(mn.count(hn(e),e),t,2)}function hi(e,t){var r=e.getDay();return e=r>=4||0===r?pn(e):pn.ceil(e),kn(pn.count(hn(e),e)+(4===hn(e).getDay()),t,2)}function yi(e){return e.getDay()}function gi(e,t){return kn(fn.count(hn(e),e),t,2)}function vi(e,t){return kn(e.getFullYear()%100,t,2)}function bi(e,t){return kn(e.getFullYear()%1e4,t,4)}function xi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kn(t/60|0,"0",2)+kn(t%60,"0",2)}function Mi(e,t){return kn(e.getUTCDate(),t,2)}function Si(e,t){return kn(e.getUTCHours(),t,2)}function Ei(e,t){return kn(e.getUTCHours()%12||12,t,2)}function Ci(e,t){return kn(1+vn.count(Cn(e),e),t,3)}function qi(e,t){return kn(e.getUTCMilliseconds(),t,3)}function Oi(e,t){return qi(e,t)+"000"}function Ai(e,t){return kn(e.getUTCMonth()+1,t,2)}function Di(e,t){return kn(e.getUTCMinutes(),t,2)}function Ni(e,t){return kn(e.getUTCSeconds(),t,2)}function Ii(e){var t=e.getUTCDay();return 0===t?7:t}function Ti(e,t){return kn(xn.count(Cn(e),e),t,2)}function wi(e,t){var r=e.getUTCDay();return e=r>=4||0===r?Sn(e):Sn.ceil(e),kn(Sn.count(Cn(e),e)+(4===Cn(e).getUTCDay()),t,2)}function Li(e){return e.getUTCDay()}function Ri(e,t){return kn(Mn.count(Cn(e),e),t,2)}function ki(e,t){return kn(e.getUTCFullYear()%100,t,2)}function Pi(e,t){return kn(e.getUTCFullYear()%1e4,t,4)}function ji(){return"+0000"}function Fi(){return"%"}function Vi(e){return+e}function _i(e){return Math.floor(+e/1e3)}!function(e){Dn=function(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=jn(i),c=Fn(i),d=jn(o),m=Fn(o),f=jn(a),p=Fn(a),h=jn(s),y=Fn(s),g=jn(l),v=Fn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:ii,e:ii,f:ui,H:oi,I:ai,j:si,L:li,m:ci,M:di,p:function(e){return i[+(e.getHours()>=12)]},Q:Vi,s:_i,S:mi,u:fi,U:pi,V:hi,w:yi,W:gi,x:null,X:null,y:vi,Y:bi,Z:xi,"%":Fi},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Mi,e:Mi,f:Oi,H:Si,I:Ei,j:Ci,L:qi,m:Ai,M:Di,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:Vi,s:_i,S:Ni,u:Ii,U:Ti,V:wi,w:Li,W:Ri,x:null,X:null,y:ki,Y:Pi,Z:ji,"%":Fi},M={a:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=p[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=d.exec(t.slice(r));return n?(e.w=m[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=g.exec(t.slice(r));return n?(e.m=v[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=h.exec(t.slice(r));return n?(e.m=y[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return C(e,t,r,n)},d:Gn,e:Gn,f:ei,H:Xn,I:Xn,j:Kn,L:Qn,m:Wn,M:Jn,p:function(e,t,r){var n=u.exec(t.slice(r));return n?(e.p=c[n[0].toLowerCase()],r+n[0].length):-1},Q:ri,s:ni,S:Zn,u:_n,U:Bn,V:Hn,w:Vn,W:$n,x:function(e,t,n){return C(e,r,t,n)},X:function(e,t,r){return C(e,n,t,r)},y:Un,Y:zn,Z:Yn,"%":ti};function S(e,t){return function(r){var n,i,o,a=[],s=-1,l=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Tn[n=e.charAt(++s)])?n=e.charAt(++s):i="e"===n?" ":"0",(o=t[n])&&(n=o(r,i)),a.push(n),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(r){var n,i,o=An(1900);if(C(o,e,r+="",0)!=r.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(n=On(An(o.y))).getUTCDay(),n=i>4||0===i?Mn.ceil(n):Mn(n),n=vn.offset(n,7*(o.V-1)),o.y=n.getUTCFullYear(),o.m=n.getUTCMonth(),o.d=n.getUTCDate()+(o.w+6)%7):(i=(n=t(An(o.y))).getDay(),n=i>4||0===i?fn.ceil(n):fn(n),n=cn.offset(n,7*(o.V-1)),o.y=n.getFullYear(),o.m=n.getMonth(),o.d=n.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?On(An(o.y)).getUTCDay():t(An(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,On(o)):t(o)}}function C(e,t,r,n){for(var i,o,a=0,s=t.length,l=r.length;a<s;){if(n>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=M[i in Tn?t.charAt(a++):i])||(n=o(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return b.x=S(r,b),b.X=S(n,b),b.c=S(t,b),x.x=S(r,x),x.X=S(n,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",qn);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e,On);return t.toString=function(){return e},t}}}(e),Nn=Dn.utcFormat,In=Dn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||Nn("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||In("%Y-%m-%dT%H:%M:%S.%LZ");function Bi(e){return new Date(e)}function Hi(e){return e instanceof Date?+e:+new Date(+e)}function $i(e,t,r,n,i,o,a,s,l){var u=_r(Rr,Rr),c=u.invert,d=u.domain,m=l(".%L"),f=l(":%S"),p=l("%I:%M"),h=l("%I %p"),y=l("%a %d"),g=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function M(s){return(a(s)<s?m:o(s)<s?f:i(s)<s?p:n(s)<s?h:t(s)<s?r(s)<s?y:g:e(s)<s?v:b)(s)}function S(t,r,n,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(n-r)/t,a=ct((function(e){return e[2]})).right(x,o);a===x.length?(i=yt(r/31536e6,n/31536e6,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(yt(r,n,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(Et.call(e,Hi)):d().map(Bi)},u.ticks=function(e,t){var r,n=d(),i=n[0],o=n[n.length-1],a=o<i;return a&&(r=i,i=o,o=r),r=(r=S(e,i,o,t))?r.range(i,o+1):[],a?r.reverse():r},u.tickFormat=function(e,t){return null==t?M:l(t)},u.nice=function(e,t){var r=d();return(e=S(e,r[0],r[r.length-1],t))?d(function(e,t){var r,n=0,i=(e=e.slice()).length-1,o=e[n],a=e[i];return a<o&&(r=n,n=i,i=r,r=o,o=a,a=r),e[n]=t.floor(o),e[i]=t.ceil(a),e}(r,e)):u},u.copy=function(){return Vr(u,$i(e,t,r,n,i,o,a,s,l))},u}const zi={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Ui=e=>e+" 12px -12px inset rgba(0, 0, 0, 0.0625)";var Yi={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:r,rtl:n}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=zi[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Ui(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Ui(t.shadow.endOffset)}}})(r),u="horizontal"===r&&n,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function Wi({viewState:e,viewCache:t,layoutService:r,dockService:n,rtl:i}){return!r.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:n.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:r}){return e.meta.isContinuous?function(e,t){const r=e.get("zoom"),n=t.get("continuousMin"),i=t.get("continuousMax");return[(r.min-n)/(i-n),(r.max-n)/(i-n)]}(t,r):function(e){return e.get("viewRange")}(t)}({layoutService:r,viewState:e,viewCache:t})}}}let Gi;function Ki(){Gi=Gi||document.createElement("canvas").getContext("2d")}const Xi={measureTextWidth(e){Ki();const{width:t}=Gi.measureText(e);return t},lineWrap(e,t,r,n){let i,o;Ki();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof n&&a.length>=n)return a.slice(0,n);for(r&&(Gi.font=r),o=0;o<a.length;o++){for(d=a[o]||"",m=d.split(/\s+/),[f]=m,c="",i=1;i<m.length;i++)if(l=`${f} ${m[i]}`,u=Xi.measureTextWidth(l),u>t&&("number"!=typeof n||n>s.length)?(s.push(f),f=m[i]):f=l,"number"==typeof n&&s.length>=n){c=m.slice(i+1).join(" ");break}"number"!=typeof n||s.length<n?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${f} ${c}`}return s},wordWrap(e,t,r,n,i){if(Ki(),!e||!e.length)return[];r&&(Gi.font=r);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||Xi.measureTextWidth(u)<=t?o.push(u):(s=Xi.splitWord(u,t,void 0,n-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?Xi.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=n?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,r)=>{r[t]=e?e.trim():e})),o.length>n?(o=o.splice(0,n),o[o.length-1]=Xi.truncate(o[o.length-1],t,r,i).text):(u=o[o.length-1],u&&u.length>1&&Xi.measureTextWidth(u)>t&&(o[o.length-1]=Xi.truncate(u,t,r,i).text)),o},truncate(e,t,r,n="…"){Ki();let i,o,a,s,l=e;const u=Xi.measureTextWidth("i"),c=Math.ceil(t/u);if(r&&(Gi.font=r),e&&t){if(Xi.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+n,Xi.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,r,n){let i;Ki();let o,a=e,s="",l=[];if(Xi.isNumber(r)&&r<=1)return[e];const u=Math.ceil(t/n);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Xi.measureTextWidth(a)<=t));i--);return(!i&&!a||Xi.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Xi.measureTextWidth(s)>t?(s=Xi.explodeWord(s,t,r-1,n),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,r,n)=>(Ki(),e&&t?(r&&(Gi.font=r),Xi.explodeWord(e,t,n,Math.max(1,Xi.measureTextWidth("i")))):[]),wrapText(e,t,r,n,i){let o;return Number.isNaN(t)?[e]:(o=n>1?Xi.lineWrap(e,t,r,n):[e],o=Xi.wordWrap(o,t,r,n,i),o)},getFontHeight:e=>(Ki(),e&&(Gi.font=e),1.5*Xi.measureTextWidth("m")),tokenize(e,t,r,n,i,o,a=1){Ki(),t&&(Gi.font=t);const s=Xi.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const m=o?Math.max(1,Math.floor(o/l)):n||1;return Array.isArray(n)?(n.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),n.forEach((e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)}))):u=[Number.isNaN(n)||n<=0?m:Math.min(m,n)],Array.isArray(e)?e.forEach(((e,r)=>{d.length<m&&(d=d.concat(Xi.wrapText(e,i,t,u[r])))})):d=Xi.wrapText(e,i,t,u[0],r),d}},Ji={getDefaultSettings:({size:e=10,fill:t="#999",alignment:r}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:r}),createOob({oob:e,dockValue:t,boxCenter:r,rendWidth:n,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=n,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=n,d=t<.5?180:0),a(U({},e,{[s]:r*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},Zi=U.bind(null,!0),Qi={},{isArray:eo}=Array;function to(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function ro(e){return void 0===e}function no(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function io(e,t){const r=t.substring(1).split("/").slice(0,-1);let n;return r.forEach(((t,i)=>{if(i===r.length)return;n=+t;const o=isNaN(n)?{}:[];e[n||t]=ro(e[n||t])?o:e[t],e=e[n||t]})),e}function oo(e,t){let r=!0;if(to(e)&&to(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((n=>{oo(e[n],t[n])||(r=!1)})),r);if(eo(e)&&eo(t)){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r+=1)if(!oo(e[r],t[r]))return!1;return!0}return e===t}Qi.generate=function(e,t,r){r=r||"";let n=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?Zi({},{val:e}).val:e}(t[i]),a=e[i],s=`${r}/${i}`;oo(o,a)||no(t,i)||(ro(a)?n.push({op:"add",path:s,value:o}):to(o)&&to(a)?n=n.concat(Qi.generate(a,o,s)):eo(o)&&eo(a)?n=n.concat(function(e,t,r){let n=[];const i=e.slice();let o=-1;function a(e,t,r){if(e[r]&&ro(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(let r=0,n=e.length;r<n;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(oo(t,i))return n;if(!ro(t[0])&&ro(t[0].qInfo)||0===t.length)return n.push({op:"replace",path:r,value:t}),n;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(n.push({op:"remove",path:`${r}/${e}`}),i.splice(e,1)):n=n.concat(Qi.generate(i[e],t[o],`${r}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(n.push({op:"add",path:`${r}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(n.push({op:"move",path:`${r}/${e}`,from:`${r}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return n}(a,o,s)):n.push({op:"replace",path:`${r}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{ro(t[i])&&!no(e,i)&&n.push({op:"remove",path:`${r}/${i}`})})),n},Qi.apply=function(e,t){t.forEach((t=>{let r=io(e,t.path),n=t.path.split("/").splice(-1)[0],i=n&&isNaN(+n)?r[n]:r[+n]||r;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,i=e),"add"===t.op||"replace"===t.op)if(eo(r))"-"===n&&(n=r.length),r.splice(+n,"add"===t.op?0:1,t.value);else if(eo(i)&&eo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(to(i)&&to(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!no(a,e)&&delete a[e]})),Zi(i,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[n]=t.value}else if("move"===t.op){const i=io(e,t.from);eo(r)?r.splice(+n,0,i.splice(+o,1)[0]):(r[n]=i[o],delete i[o])}else"remove"===t.op&&(eo(r)?r.splice(+n,1):delete r[n]);var a}))},Qi.clone=function(e){return Zi({},e)},Qi.createPatch=function(e,t,r){const n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},Qi.updateObject=function(e,t){Object.keys(e).length?Qi.apply(e,Qi.generate(e,t)):Zi(e,t)};const ao=[[2,4,6],[2,4],[3]],so=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function lo(e,t,r){const n=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<n;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==r&&(o=Math.min(o,r/e[n-1])),e.splice(0,0,o)}function uo(e,t,r){let n;const i=e?e.length:0;for(n=0;n<i;n++)lo(e[n],t,r)}!function(){let e,t;for(uo(ao,1,10),e=0;e<so.length;e++)if(so[e])for(t=0;t<so[e].length;t++)Array.isArray(so[e][t])&&uo(so[e][t])}();const co={isInside(e,t,r,n){if(!n)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=r},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const r=e.position<t.position?e:t,n=e.position<t.position?t:e;return n.position-n.radius-(r.position+r.radius)},findSegmentPositionMeetMax(e,t){const r=Math.max(0,e.max-t);return e.center-r},findSegmentPositionMeetMin(e,t){const r=Math.max(0,t-e.min);return e.center+r},findSegmentPositionMeetMinThenMax(e,t,r){const n=co.findSegmentPositionMeetMin(e,t);return co.findSegmentPositionMeetMax({center:n,max:n+e.radius},r)},findSegmentPositionMeetMaxThenMin(e,t,r){const n=co.findSegmentPositionMeetMax(e,r);return co.findSegmentPositionMeetMin({center:n,min:n-e.radius},t)},layoutPositionFromMin(e,t,r,n=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=co.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-n)/2),s=o.position+o.radius+n/2;a.position=co.findSegmentPositionMeetMaxThenMin(a,s,r)},adjustPositionFromMax(e,t,r,n=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-r);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,co.getGap(s,a)-n),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,r,n=0){const i=e.length-1;if(!(i<0))if(0!==i)co.layoutPositionFromMin(e,t,r,n),co.adjustPositionFromMax(e,t,r,n);else{const n=e[0];n.position=co.findSegmentPositionMeetMaxThenMin(n,t,r)}}},mo=(e,t,r,n=1)=>{const i=e.bandwidth();return r?"start"===t?i:"end"===t?i*(1-n):i*(2-n)/2:"start"===t?0:"end"===t?i*n:i*n/2},fo=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,po=e=>e.filter(fo),ho=(e,t)=>po(te(e,t,[])),yo=e=>fo(e)&&(!1!==e.showValue||!1!==e.showLabel),go=e=>e.filter(yo),vo=(e,t)=>go(te(e,t,[])),bo=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,xo=(e,t,r)=>{const{dimensionRefLineInfo:n}=t;if(n[e])return n[e][r]},Mo=({label:e,dataPages:t})=>{const{qArea:r={}}=t||{},{qTop:n,qHeight:i}=r;return void 0!==n&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<n},So=({label:e,dataPages:t})=>{const{qArea:r={}}=t||{},{qTop:n,qHeight:i}=r;return void 0!==n&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=n+i},Eo=({value:e,qMin:t})=>"NaN"!==t&&e<t,Co=({value:e,qMax:t})=>"NaN"!==t&&e>t,qo={isRefLineVisible:fo,getVisibleRefLines:po,getRefLines:ho,getMeasureRefLines:e=>ho(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:ho(e,"refLine.dimRefLines"),isRefLineLabelVisible:yo,getVisibleRefLineLabels:go,getRefLineLabels:vo,getMeasureRefLineLabels:e=>vo(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:vo(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:r,valueInfo:n,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=mo(s,i,o,a.meta.measureCount),s([r,0])+l;if(a.meta.isGroupedByDimension){if(!n)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=n;let u;return l=mo(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:r,invert:n,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:n});for(let n=0;n<r.length;n++){const{id:a,order:s}=r[n],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:r,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(r):u)+l}return l=mo(s,i,o),s(r)+l}return e(r)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:r,layoutService:n})=>{const{isGroupedByDimension:i}=n.meta,o={},a=te(e,"qHyperCube"),s="K"===a.qMode,l=r?r.query.getCurrentDataPage():te(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=te(l,s?"qData.0.qSubNodes":"qMatrix",[]),c=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),d=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<u.length;e++){const t=u[e],r=e+d,n=t[c];o[n]||(o[n]={id:t.qElemNo,qText:t.qText,minOrder:r,maxOrder:r})}})():i?(()=>{let e;for(let t=0;t<u.length;t++){const r=u[t][0],n=u[t][1],i=t+d,a=r[c];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:n.qElemNumber,order:i}):o[a]={id:r.qElemNumber,qText:r.qText,minOrder:i,maxOrder:i,innerValues:[{id:n.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<u.length;e++){const t=u[e][0],r=e+d,n=t[c];o[n]||(o[n]={id:t.qElemNumber,qText:t.qText,minOrder:r,maxOrder:r})}})(),o},getInputValue:bo,extractInfoFromInputValue:xo,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const n=bo({refLineLayout:e,layoutService:r});return xo(n,t,"id")},isDiscreteMinOutOfBounds:Mo,isDiscreteMaxOutOfBounds:So,isContinuousMinOutOfBounds:Eo,isContinuousMaxOutOfBounds:Co,isOutOfRange:({value:e,qMin:t,qMax:r})=>Eo({value:e,qMin:t})||Co({value:e,qMax:r}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&So({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&Mo({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:r})=>"horizontal"===e?t:r};function Oo(e,t,r=70){for(let n=0;n<e.length;n++){const i=e[n];i.lines=Xi.tokenize(i.title,t,"… "+i.valueString,3,r),i.maxNumLines=i.lines.length}}function Ao({title:e,font:t,ellipsis:r,maxNumLines:n=5,maxWidth:i=200}){const o=Xi.tokenize(e,t,r,n,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function Do({oobs:e,font:t,ellipsis:r,maxNumLines:n=5,maxWidth:i=200}){const o=e.map((e=>Ao({title:e.title,font:t,ellipsis:`${r} ${e.valueString}`,maxNumLines:n,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function No(e,t="value"){e.sort(((e,r)=>e[t]-r[t]))}const Io=3,To=2;function wo({inputValue:e,inputValueLabel:t,localeInfo:r}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!r)return!0;const n=`+-${r.qDecimalSep||""}${r.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${n}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const Lo=({label:e,dataPages:t,qMin:r,qMax:n})=>{if(void 0!==r&&void 0!==n){const{inputValue:t}=e;if(qo.isContinuousMaxOutOfBounds({value:t,qMax:n}))return 1;if(qo.isContinuousMinOutOfBounds({value:t,qMin:r}))return-1}return qo.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:qo.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Ro={hasEngineFormat:wo,calculateLabelPositions({labels:e,scale:t,size:r,layoutService:n,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=qo.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===n.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=n.getHyperCubeValue(u),{canBeContinuous:d}=n.meta;let m,f;if(s&&d){const e=n.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,f=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=Lo({label:o,dataPages:c,qMin:m,qMax:f});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:qo.getScaledPosition({scale:t,size:r,value:s,valueInfo:d,align:u,invert:l,layoutService:n,isContinuous:a}),o.center=o.scaledValue*r}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:r,canBeContinuous:n,localeInfo:i}){let o;if(r)for(let r=0;r<e.length;r++){const n=e[r],{value:a,inputValue:s,inputValueLabel:l}=n;o=wo({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,n.valueString=`${he.lrm}(${o})${he.lrm}`,n.title=Ro.getTitle(n)}else if(n)for(let t=0;t<e.length;t++){const r=e[t],{valueText:n,inputValue:a,inputValueLabel:s}=r;o=wo({inputValue:a,inputValueLabel:s,localeInfo:i})?s:n,r.valueString=`${he.lrm}(${o})${he.lrm}`,r.title=Ro.getTitle(r)}else for(let t=0;t<e.length;t++){const r=e[t];o=r.valueText,r.valueString=`${he.lrm}(${o})${he.lrm}`,r.title=Ro.getTitle(r)}},measureLabelsWidth(e,t){for(let r=0;r<e.length;r++){const n=e[r];n.totalWidth=t(n.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,r,n=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-n)/2,a.cMin=o.cMax+n;a.cMax=r}else o.cMax=r},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,r){const n=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(r,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=n},reduceTotalMaxNumLines(e,t,r){const n=Math.floor(r/t);let i=3;do{const t=Ro.getTotalNumLines(e)-n;if(t<=0)return;Ro.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,r=0){for(let n=0;n<e.length;n++){const i=e[n];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+r)/t)))}},addLabelsSize(e,t,r=15,n){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Ro.measureLabelMaxLineWidth(o,n)),o.height=o.lines.length*r}},addLabelSegments(e,t){for(let r=0;r<e.length;r++){const n=e[r],{center:i}=n,o=n[t],a=o/2;n.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:r,lowerLimit:n,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:f,isContinuous:p,isDimension:h}){const y=e.map((e=>e)),g=r;Ro.calculateLabelPositions({labels:e,scale:t,size:g,layoutService:f,orientation:c,rtl:m,isContinuous:p,isDimension:h}),No(e,"center"),Ro.addLabelsNeighborInfo(e,n,i,o),Oo(e,a,s),Ro.reduceTotalMaxNumLines(y,l,i-(y.length-1)*o),"vertical"===c&&(Ro.reduceMaxNumLines(e,l,.05*o),function(e,t,r=70){for(let n=0;n<e.length;n++){const i=e[n];i.lines.length>i.maxNumLines&&(i.lines=Xi.tokenize(i.title,t,"… "+i.valueString,i.maxNumLines,r))}}(e,a,s)),Ro.addLabelsSize(e,s,l,d),Ro.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:r,areaProps:n,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l}=n,{minorCenter:u}=i,{fontSize:c,fontFamily:d,background:m}=t;let f=[];return e.forEach((e=>{const{lines:t}=e,n=t.length,i=t.map(((t,i)=>{const m={type:"text",text:t,title:Ao({title:e.title,font:a,ellipsis:"… "+e.valueString}),dx:0,dy:0,maxWidth:r,width:r,fontSize:c,fontFamily:d,fill:e.fill,baseline:"central",anchor:"middle"};return m[l]=u,m[s]=e.segment.position,m.y+=(i-(n-1)/2)*o,m}));e.background&&f.push(function({minorCenter:e,majorAxis:t,minorAxis:r,label:n,lineHeight:i,background:o}){const{lines:a}=n,{borderRadius:s=Io,padding:l={}}=o,{top:u=To,bottom:c=To,left:d=To,right:m=To}=l,f=a.length,p={type:"rect",rx:s,ry:s,fill:n.background.fill,width:n.width+(d+m),height:n.height+(u+c)};return p[r]=e,p[t]=n.segment.position,p.x-=n.width/2+d,p.y-=f*i/2+u,p}({minorCenter:u,majorAxis:s,minorAxis:l,label:e,lineHeight:o,background:m})),f=f.concat(i)})),f}};function ko(e,t,r){let n;const i=typeof t;if("string"===i||"object"===i)n=e.formatter(t);else if(void 0!==r&&r.data){const e=r.data()&&r.data().fields;n=e&&e[0]?e[0].formatter():null}return n}function Po(e,t,r){return"top"===e||"bottom"===e?function(e,t){const{font:r,lineHeight:n,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Ro.getMaxTextWidth(e)>a&&(Oo(e,r,a),s=Math.max(...e.map((e=>e.lines.length)))),s*n+i+o}(t,r):function(e,t){const{left:r,right:n,maxLabelWidth:i}=t;return Math.min(i,Ro.getMaxTextWidth(e))+r+n}(t,r)}function jo(e,t){return t?e.domain():[0,1]}function Fo(e,t,r,n="value"){let i=e.filter((e=>e[n]>=t));i=i.filter((e=>e[n]<=r));const o=e.filter((e=>e[n]<t)),a=e.filter((e=>e[n]>r));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function Vo(e){let t,r=0;for(let n=1;n<10;n++)t=e(n),r=Math.max(r,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[r,Math.max(r,Math.sqrt(t.width*t.width+t.height*t.height))]}function _o(e,t){return e>9?t[1]:t[0]}function Bo({alignment:e,dockValue:t,oobs:r,style:n,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=r?r.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:f,minorDimension:p}=s,h=i[p],y=Ji.createOob({oob:Ji.getDefaultSettings({size:n.size,fill:n.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o}),g="c"+m,v="c"+f,b={type:"circle",r:l,stroke:"transparent",fill:n.text.background.fill,strokeWidth:0};b[v]=h/2,b[g]=a;const x={type:"text",text:c>9?"9+":c,title:Do({oobs:r,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:h,width:h,fontSize:n.text.fontSize,fontFamily:n.text.fontFamily,fill:n.text.fill,baseline:"central",anchor:"middle"};return x[f]=h/2,x[m]=a,[y,b,x]}function Ho(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:Xi.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const $o=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var zo={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:r,isContinuous:n,localeInfo:i}=this.settings,o=!!n||r.meta.canBeContinuous,a=$o(this.settings.labels),s=ko(this.chart,this.settings.formatter,e);Ro.addLabelTitles({labels:a,formatter:s,isContinuous:n,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:r,canBeContinuous:n,layoutService:i})=>{if(r){const[n,i]=jo(t,r);return Fo(e,n,i)}if(n){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:n}=t;if("NaN"!==r&&"NaN"!==n)return Fo(e,r,n,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:n,canBeContinuous:o,layoutService:r});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Ho(t.label),{dock:r}=this.settings.layout;return Ro.measureLabelsWidth(c,this.measureText),d=Po(r,c,e),d}const m=Vo(this.measureText),f=l?_o(l,m):0,p=u?_o(u,m):0;return d=Math.max(f,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:r,layoutService:n,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||n.meta.canBeContinuous,u=$o(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=r.label,f=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,r){const n=e[t.minorDimension];return{minorSize:n,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(n-r.right-r.left)/2+r.left:(n-r.top-r.bottom)/2+r.top}}(this.rect,f,m),{orientation:h,majorDimension:y}=f,{majorSize:g}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:M}=Ho(r.label),S=ko(this.chart,this.settings.formatter,e),E=g;Ro.addLabelTitles({labels:u,formatter:S,isContinuous:o,canBeContinuous:l,localeInfo:s}),Ro.calculateLabelPositions({labels:u,scale:e,size:E,layoutService:n,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[C,q]=jo(e,o),{filteredLabels:O,lowerOobs:A,upperOobs:D,lowerCircleSize:N,upperCircleSize:I,lowerOobSpace:T,upperOobSpace:w}=function({labels:e,minValue:t,maxValue:r,orientation:n,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=Fo(e,t,r,u),f="scaledValue"!==u&&qo.getInvert({orientation:n,rtl:i,isContinuous:o}),p=function(e,t,r){return r?t:e}(d,c,f),h=function(e,t,r){return r?e:t}(d,c,f),y=p.length,g=h.length,v=Vo(l),b=_o(y,v),x=_o(g,v);return{filteredLabels:m,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:function(e,t,r,n,i){return("vertical"===n?i.top:i.left)+(e>0?t+r:0)}(y,a.oob.size,b,n,s),upperOobSpace:function(e,t,r,n,i){return("vertical"===n?i.bottom:i.right)+(e>0?t+r:0)}(g,a.oob.size,x,n,s)}}({labels:u,minValue:C,maxValue:q,orientation:h,rtl:d,isContinuous:o,style:r,padding:m,measureText:this.measureText,prop:o?"value":"scaledValue"}),L=T,R=g-w;No(A),No(D);const k=Bo({alignment:0,dockValue:0,oobs:A,style:r.oob,rect:this.rect,symbol:t,position:r.oob.size+N/2,areaProps:f,radius:N/2,font:v}),P=Bo({alignment:1,dockValue:1,oobs:D,style:r.oob,rect:this.rect,symbol:t,position:g-(r.oob.size+I/2),areaProps:f,radius:I/2,font:v});Ro.addLabelsInfo({labels:O,scale:e,majorSize:g,lowerLimit:L,upperLimit:R,font:v,lineHeight:b,gap:x,maxLabelWidth:M,majorDimension:y,orientation:h,measureText:this.measureText,rtl:d,layoutService:n,isContinuous:o,isDimension:a}),co.layout(O.map((e=>e.segment)),L,R,r.label.gap);const j=O.filter((e=>co.isInside(e.segment,L,R,o)));return Ro.createLabels({labels:j,style:r.label,maxLabelWidth:M,areaProps:f,area:p,lineHeight:b,font:v,theme:i}).concat([...k,...P])}};const{getInputValue:Uo,extractInfoFromInputValue:Yo,resolveValue:Wo}=qo;var Go={resolveValue:Wo,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:r})=>{if(r.meta.isGroupedByDimension){const n=Uo({refLineLayout:e,layoutService:r});return Yo(n,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:r})=>{if(r.meta.mode.K)return 0;const n=Uo({refLineLayout:e,layoutService:r});return Yo(n,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const{dimensionValuesInfo:n}=t,{canBeContinuous:i}=r.meta,o=Uo({refLineLayout:e,layoutService:r});return n[o]&&i?n[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:r})=>{const n=Uo({refLineLayout:e,layoutService:r}),{dimensionRefLineInfo:i}=t;return i[n]}};function Ko({isDimension:e,refLineModel:t={},layoutService:r,colorModel:n,dockService:i,chart:o,scale:a,axis:s,rtl:l,key:u,mainComponentKey:c,path:d,minimumLayoutMode:m}){const f=e?t.dimensionRefLines:d?t.query.getRefLines(d):t.measureRefLines;if(!f.length)return!1;const p={key:u,type:"ref-line",layout:{minimumLayoutMode:m},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}})},h=!(!e||"horizontal"!==i.meta.major.orientation||!l),y=!e||r.meta.isContinuous;return f.forEach((l=>{p.lines[s].push((({isDimension:e,refLineLayout:t,refLineModel:r,layoutService:n,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var m,f;const p={dir:l,line:{strokeWidth:(null==t||null===(m=t.style)||void 0===m?void 0:m.lineThickness)||2,strokeDasharray:null==t||null===(f=t.style)||void 0===f?void 0:f.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||n.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):p.value=()=>{var e;const i=qo.getScaledPosition({scale:a.scale(s),value:Go.resolveValue({refLineLayout:t,refLineModel:r,layoutService:n}),valueInfo:Go.resolveValueInfo({refLineLayout:t,refLineModel:r,layoutService:n}),size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:n,isContinuous:d});return Number.isNaN(i)?void 0:i},p})({isDimension:e,refLineLayout:l,refLineModel:t,layoutService:r,colorModel:n,dockService:i,chart:o,scale:a,axis:s,invert:h,component:c,isContinuous:y}))})),p}const Xo={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}};function Jo({isDimension:e,refLineModel:t={},layoutService:r,colorModel:n,dock:i,scale:o,style:a,formatter:s,theme:l,localeInfo:u,rtl:c,key:d,path:m}){const f=e?t.dimensionRefLineLabels:m?t.query.getRefLineLabels(m):t.measureRefLineLabels;if(!f.length)return[];const p=[],h=!e||r.meta.isContinuous,y=f.map((e=>(({refLineLayout:e,refLineModel:t,layoutService:r,colorModel:n,scale:i,theme:o,isContinuous:a})=>{const s=n.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>Go.resolveValue({refLineLayout:e,refLineModel:t,layoutService:r}),l.valueText=()=>Go.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:r}),l.valueInfo=()=>Go.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:r})),l})({refLineLayout:e,refLineModel:t,layoutService:r,colorModel:n,scale:o,theme:l,isContinuous:h})));return p.push((({isDimension:e,layoutService:t,style:r,labels:n,scale:i,formatter:o,dock:a,key:s,rtl:l,theme:u,isContinuous:c,localeInfo:d})=>({key:s,type:"reference-line-labels",renderer:"svg",labels:n,formatter:o,scale:i,layoutService:t,layout:{dock:a,rtl:l},theme:u,isContinuous:c,isDimension:e,localeInfo:d,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:l?2:4,right:l?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===a||"right"===a?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}}}))({isDimension:e,rtl:c,style:U(!0,Xo,a),dock:i,key:d,labels:y,scale:o,formatter:s,layoutService:r,theme:l,isContinuous:h,localeInfo:u})),p}function Zo({layoutService:e,discreteModel:t}){const{isContinuous:r,canBeContinuous:n,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=oe.dimensionless(o),l=qo.getMeasureRefLines(o),u=qo.getDimensionRefLines(o,s),c=qo.getMeasureRefLineLabels(o),d=qo.getDimensionRefLineLabels(o,s);let m={},f={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=qo.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(n){const r=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:i}=r;return qo.isOutOfRange({value:t,qMin:n,qMax:i})}return!1})(o)||(t=>{if(!f[t])return!1;if(!r&&i){const r={valueInfo:f[t]},n="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(n);return qo.isOutOfDataPages({label:r,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:n,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:f,dimensionValuesInfo:m,query:{getRefLines:e=>qo.getRefLines(o,e),getRefLineLabels:e=>qo.getRefLineLabels(o,e)},update:()=>{f=h.dimensionRefLineInfo,p()&&(m=qo.getDimensionValuesInfo({layout:o,canBeContinuous:n,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=m,u.forEach((t=>{const r=qo.getInputValue({refLineLayout:t,layoutService:e});m[r]&&(f[r]?(f[r].innerValues=m[r].innerValues,f[r].minOrder=Math.min(f[r].minOrder,m[r].minOrder),f[r].maxOrder=Math.max(f[r].maxOrder,m[r].maxOrder),f[r].isMinOrderOk=f[r].isMinOrderOk||m[r].isMinOrderOk,f[r].isMaxOrderOk=f[r].isMaxOrderOk||m[r].isMaxOrderOk):f[r]={id:m[r].id,qText:m[r].qText,innerValues:m[r].innerValues,minOrder:m[r].minOrder,maxOrder:m[r].maxOrder,isMinOrderOk:m[r].isMinOrderOk,isMaxOrderOk:m[r].isMaxOrderOk},f[r].numInnerValues=(f[r].maxOrder||0)-(f[r].minOrder||0)+1)})))}};return h.update(),h}const Qo={combineBounds(e){let t=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach((e=>{e&&(t=Math.min(t,e.x,e.x+e.width),r=Math.max(r,e.x,e.x+e.width),n=Math.min(n,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))})),{x:t,y:n,width:r-t,height:i-n}}};var ea={DATA:{MAIN:"qHyperCube",REDUCED:"reduced-data"},SCALE:{MAJOR:"main-major",MAJOR_INNER:"major-inner",MINOR:{PRIMARY:"minor-primary",SECONDARY:"minor-secondary",REDUCED_PRIMARY:"reduced-minor-primary",REDUCED_SECONDARY:"reduced-minor-secondary"},COLOR:"color",REDUCED:"reduced-major"},COMPONENT:{BAR:"bar-series",BAR_LABEL:"bar-label",BAR_OOB_LABEL:"bar-oob-label",STACK_BAR:"stack-bar",STACK_BAR_LABEL:"stack-bar-label",AXIS:{MAJOR:"major-axis",MAJOR_CONTINUOUS:"major-axis-continuous",TIME_INNER:"major-axis-time-inner",TIME_OUTER:"major-axis-time-outer",MINOR:{PRIMARY:"minor-primary-axis",SECONDARY:"minor-secondary-axis"}},AXIS_OVERLAY:{TIME_INNER:"axis-overlay-time-inner",TIME_OUTER:"axis-overlay-time-outer",CONTINUOUS:"axis-overlay-continuous"},AXIS_TITLE:{MAJOR:"major-axis-title",MINOR:{PRIMARY:"minor-primary-axis-title",SECONDARY:"minor-secondary-axis-title"}},MARKER:"marker-series",LINE:"line-series",POINT:"point-component",LABEL_SPACE:"label-space-component",POINT_LABEL:"point-label",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",LEGEND:"legend",LEGEND_CATEGORICAL:"legend-cat",LEGEND_TOOLTIP:"legend-tooltip",TOOLTIP:"tooltip",MINI_CHART:{BAR:"mini-chart-bar-series",LINE:"mini-chart-line-series",MARKER:"mini-chart-marker-series"},BAR_OOB:"bar-oob",GHOST_BAR_OOB:"ghost-bar-oob",SLICED_HAT:"sliced-hat",DATA_OOB_MARKER:"data-out-of-bounds-marker",PRIMARY_MEASURE_AXIS_REF_LINE:"primary-mes-axis-ref-line",SECONDARY_MEASURE_AXIS_REF_LINE:"secondary-mes-axis-ref-line",DIMENSION_REF_LINE:"dim-ref-line",PRIMARY_MEASURE_AXIS_REF_LINE_LABEL:"primary-mes-ref-line-label",SECONDARY_MEASURE_AXIS_REF_LINE_LABEL:"secondary-mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label"},COLLECTION:{PRIMARY:"primary-collection",SECONDARY:"secondary-collection",STACKED_PRIMARY:"stacked-collection-primary",STACKED_SECONDARY:"stacked-collection-secondary",STACKED_TOTAL_PRIMARY:"stacked-total-collection-primary",STACKED_TOTAL_SECONDARY:"stacked-total-collection-secondary",REDUCED:"reduced-collection",REDUCED_PRIMARY:"reduced-collection-primary",REDUCED_SECONDARY:"reduced-collection-secondary",REDUCED_STACKED_PRIMARY:"reduced-collection-stacked-primary",REDUCED_STACKED_SECONDARY:"reduced-collection-stacked-secondary",LINE:"line-collection"},FORMATTER:{PRIMARY:"primary-formatter",SECONDARY:"secondary-formatter"}},ta={LINE:"line",BAR:"bar",MARKER:"marker"},ra={PRIMARY:0,SECONDARY:1},na={type:"bar",axis:0};const ia={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 oa(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const aa={getImageSize(e,t){let r;function n(){r&&(clearTimeout(r),r=null)}function i(e){const t=e;t.onload=null,t.onerror=null,n()}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:r,width:l}=s,u=o[t]*(r>l?1:r/l),c=o[t]*(l>r?1:l/r);!r||!l||0===r&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,r),width:Math.min(c,l)},n()):(e={height:u,width:c},n()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,r=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function sa(e,t,r,n){var i,o,a,s,l,u;const{app:c,flags:d}=t,m=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!m)return[];const[f]=m,p=f.size||"small",h=f.type||"media";let y=-1;for(let e=0;e<r.length;e++)if(r[e].cId===f.cId){y=e;break}const g=(null===(a=n.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==y&&g[y]&&(v=g[y]),"media"===h&&null!==(l=f.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return async function(e,t,r){let n=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,r,n,i,o,a;return e&&e.session&&e.session.options||e&&e.enigmaModel&&e.enigmaModel.session&&e.enigmaModel.session.sessionConfig?(t=e.session.options||e.enigmaModel.session.sessionConfig,a=void 0!==t.secure?t.secure:t.isSecure,r=a?"https://":"http://",n=t.host||"localhost",i=t.port?":"+t.port:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o+="/"),r+n+i+o):""}(r);i&&(function(e,t){e.replace(t,"").replace(/^\.\.\//i,"/")[0]}(n,i),n=n.replace(/"/g,'\\"'),n=n.replace(/'/g,"\\'"),n=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(n,i));const{height:o,width:a,imageError:s}=await aa.getImageSize(n,t);return{src:n,size:t,height:o,width:a,imageError:s}}(f,p,c);if("url"===h)return async function(e,t,r,n,i){let o,a=r.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&oa(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:r,width:i,imageError:s}=await aa.getImageSize(t,n);o={src:t,size:n,height:r,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:r}=await aa.getImageSize(a,n);o={src:a,size:n,height:e,width:t,imageError:r}}return o}(c,d,f,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,r,n){let i;const o=n.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(oa(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:n,width:o,imageError:a}=await aa.getImageSize(e,r);i={src:e,size:r,height:n,width:o,imageError:a}}}catch(e){}return i}(c,r[y],p,v)}return[]}const la={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:r,opts:n}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(sa(e,n,r,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,r;const n=null===(t=e.layout)||void 0===t||null===(r=t.tooltip)||void 0===r?void 0:r.imageComponents;return!!n&&n.length>0}},ua={async handlePromises({customTooltipModel:e,nodes:t,attrExps:r,opts:n}){let i=t;return i=await la.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:r,opts:n}),i},checkIfPromisesExist:({customTooltipModel:e})=>la.checkIfPromisesExist({customTooltipModel:e})};const ca=(e,t)=>{var r,n,i;const o=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qDimensions,a=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:ia.CHART.CHART_PARENT_TYPE,qId:ia.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},da=e=>{var t,r,n;const i=null===(t=e.tooltip)||void 0===t||null===(r=t.chart)||void 0===r||null===(n=r.object)||void 0===n?void 0:n.refId;return{qInfo:{qType:ia.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const ma={createContainer:({ctx:e,layout:t})=>{var r,n;if(!((null===(r=t.qHyperCube)||void 0===r||null===(n=r.qDimensionInfo)||void 0===n?void 0:n.length)<=0))return function(e,t){var r,n,i,o;const a=null!==(r=null===(n=t.tooltip)||void 0===n||null===(i=n.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==r?r:"medium",s=ia.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:ia.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:r,dimIndex:n,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 ma.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:r}){const n=r,i=ia.CHART.STATE,o=t.qStateName;n.miniChartToken.alternateState||(n.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),n.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:r}){var n;const i=r;null!==(n=i.miniChartToken.sessionObj)&&void 0!==n&&n.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=ia.CHART.STATE,a=ca(t,o),s=await e.createSessionObject(a),l=da(t);if(s.id!==ia.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,m,f,p;const e=r.length>0&&void 0!==(null===(d=r[0].data)||void 0===d?void 0:d.value)?[null===(m=r[0].data)||void 0===m?void 0:m.value]:[],a=void 0!==n?n:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===n&&r.length>0){var h,y;const e=null!==(h=r[0].data.selectionOuterDimension)&&void 0!==h?h:r[0].data.selectionDimension;if(null!=e&&null!==(y=e.source)&&void 0!==y&&y.field){var g;const t=null==e||null===(g=e.source)||void 0===g?void 0:g.field.split("/"),r=t[t.length-1],n=void 0!==e.value?[e.value]:[];n.length>0&&void 0!==r&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(r),n,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(ia.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===(f=u.miniChartToken.model)||void 0===f?void 0:f.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await ma.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const r=t;null!=r&&r.embed&&(ma.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(ia.CHART.CHART_OBJECT_ID),r.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const r=t,n=ia.CHART.STATE;await e.removeSessionAlternateState(n),r.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,r;const n=e;"function"==typeof(null===(t=n.miniChartToken)||void 0===t||null===(r=t.vis)||void 0===r?void 0:r.destroy)&&(n.miniChartToken.vis.destroy(),n.miniChartToken.vis=void 0)}};function fa(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function pa(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:r,IMAGES:n}=ia.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[r]=!0,i[n]=!0,i}function ha(e){const t=pa();return e.filter((e=>t[e.id]))}const ya={getNodes(e,t){const r=function(e,t){let r=0,n=0;e.center?(r+=e.center.x,n+=e.center.y):(r+=e.clientX,n+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:r-i.left,cy:n-i.top}}(e,t);return t.shapesAt({x:r.cx,y:r.cy})},getDataNodes(e,t){let r,n=[];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=[],n.push(e)}}else{r||(r=[],Object.keys(i).forEach((t=>{r=r.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=r.filter((e=>{var t,r;const n=null!==(t=null!==(r=e.data.stack)&&void 0!==r?r:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return n&&n.value===u.value&&n.label===u.label}));t.length>0&&(n=n.concat(t[0]))}})),n},displayTooltip(e,t,{nodes:r,opts:n={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=ya.getAttrExprData(a);o.length||r.length?ua.handlePromises({customTooltipModel:i,nodes:ya.getDataNodes(s,o.length>0?o:r),attrExps:l,opts:n}).then((()=>{t.emit("show",e,r.length?{nodes:r}:void 0)})):t.emit("show",e,r.length?{nodes:r}:void 0)}else{var s,l;null!==(s=n.flags)&&void 0!==s&&s.isEnabled("CUSTOM_TOOLTIP_CHART")&&null!=i&&null!==(l=i.miniChartToken)&&void 0!==l&&l.alternateState&&ma.hide({app:n.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>ua.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var r;const n=t,i=null!==(r=e.qHyperCubeDef)&&void 0!==r&&r.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[i]||(n[i]=[]),n[i]},getAttrExprData(e){var t;let r=[],n="";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;r=(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)||[],n=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:r,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){var r,n;if(!(null===(r=e.qLayoutExclude)||void 0===r||null===(n=r.quarantine)||void 0===n?void 0:n[ia.CUSTOM.QUARANTINE])){!function(e,t){const r=t;let n=r.qLayoutExclude;n||(r.qLayoutExclude={quarantine:{}},n=r.qLayoutExclude),n.quarantine||(n.quarantine={}),n.quarantine[ia.CUSTOM.QUARANTINE]=[],e.forEach((e=>{n.quarantine[ia.CUSTOM.QUARANTINE].push(e)})),r.qLayoutExclude=n}(ha(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,r;const n=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(r=t.quarantine)||void 0===r?void 0:r[ia.CUSTOM.QUARANTINE])&&delete n.qLayoutExclude.quarantine[ia.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const r=fa(e);if(!r)return;const n=void 0!==t?t:r.length-1;if(!r[n])return;const i=this.getAttrExps(e,r[n]);if(0===ha(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)||[],r=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[n].qAttributeExpressions=r:s.qHyperCube.qDimensionInfo[n].qAttrExprInfo=r}},moveCustomTooltipAttrs(e,t={},r){let n=[];const i=fa(e)||[];[...i,t].forEach((e=>{const t=ha(e.qAttributeExpressions||[]);t.length>0&&(n=t)}));const o=pa(),a=i.map((e=>{const t=e,r=e.qAttributeExpressions||[];return t.qAttributeExpressions=r.filter((e=>!o[e.id])),t})),s=void 0!==r?r:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(n));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:he.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const r=he.detectTextDirection(e.src),n=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){n.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const r=e.imageError?`${e.src}?${Math.random()}`:e.src;n.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:r,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,n),""],style:{"text-align":t.rtl?"right":"left",direction:r,"max-width":e.width},colspan:2},{}]}};function ga(e,t,r,n){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[r])||void 0===o||null===(a=o[n])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[n]?e.qSubNodes[n].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 r;switch(e.id){case ia.CUSTOM.EXPRESSION:r="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case ia.CUSTOM.TITLE:case ia.CUSTOM.DESCRIPTION:case ia.CUSTOM.IMAGES:r=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:r="NaN"}return r}(e,i);l.push({source:{key:"qHyperCube",field:`${r}/${n}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const va={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const r=t-1,n="qDimensionInfo";return{field:`${n}/${r}`,value:t=>ga(t,e,n,r)}}};const ba={getCustomAttrExps(e,t,r){var n,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(n=t.data)||void 0===n||null===(i=n.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,r,n){const i={[ia.CUSTOM.TITLE]:!0,[ia.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=ya.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===ia.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:r("qHyperCube").field(`${a}/${o}`).formatter()(s.value);n.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&&n.customTooltipInfoAttrExpsArr.push({...e.id===ia.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),n}(r,a.map((t=>ye.getMeasure(e,t))),e,o)}};function xa({nodes:e,layout:t,dataset:r}){return function(e,t,r){const n=[];return e.forEach((e=>{n.push(ba.getCustomAttrExps(r,e,t))})),n}(e,t,r).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Ma(e){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sa(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function Ea(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Sa(o,n,i,a,s,"next",e)}function s(e){Sa(o,n,i,a,s,"throw",e)}a(void 0)}))}}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qa(Object(r),!0).forEach((function(t){Ca(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Aa(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Da(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||Ia(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(e){return function(e){if(Array.isArray(e))return Ta(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ia(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 Ia(e,t){if(e){if("string"==typeof e)return Ta(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ta(e,t):void 0}}function Ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var wa=Object.prototype.hasOwnProperty,La=Object.prototype.toString,Ra=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,Pa=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===La.call(e)},ja=function(e){if(!e||"[object Object]"!==La.call(e))return!1;var t,r=wa.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&wa.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||wa.call(e,t)},Fa=function(e,t){Ra&&"__proto__"===t.name?Ra(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Va=function(e,t){if("__proto__"===t){if(!wa.call(e,t))return;if(ka)return ka(e,t).value}return e[t]},_a=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=Va(s,r),s!==(i=Va(t,r))&&(c&&i&&(ja(i)||(o=Pa(i)))?(o?(o=!1,a=n&&Pa(n)?n:[]):a=n&&ja(n)?n:{},Fa(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&Fa(s,{name:r,newValue:i}));return s};function Ba(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Ha(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function $a(e,t,r,n,i){var o,a=i.byRow,s=i.byElemNo;if(n&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===r.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(n,n.raw().qCardinal);if(n){var l=t.pic.extract({field:n.key(),trackBy:n.value}).length;return a(n,l)}return{}}function za(e,t){var r=e.hc.qDimensionInfo,n=t.input.byDimDef||{activeDimensionIndex:r.length-1};if(n.activeDimensionIndex>=0){var i=r[n.activeDimensionIndex];n=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:n.activeDimensionIndex}:{activeDimensionIndex:n.activeDimensionIndex}}return n}function Ua(e,t){var r;return t.activeDimensionIndex>=0?r=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(r=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),r}function Ya(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Wa(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Ga(){}var Ka=1/.7,Xa="\\s*([+-]?\\d+)\\s*",Ja="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Za="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qa=/^#([0-9a-f]{3,8})$/,es=new RegExp("^rgb\\("+[Xa,Xa,Xa]+"\\)$"),ts=new RegExp("^rgb\\("+[Za,Za,Za]+"\\)$"),rs=new RegExp("^rgba\\("+[Xa,Xa,Xa,Ja]+"\\)$"),ns=new RegExp("^rgba\\("+[Za,Za,Za,Ja]+"\\)$"),is=new RegExp("^hsl\\("+[Ja,Za,Za]+"\\)$"),os=new RegExp("^hsla\\("+[Ja,Za,Za,Ja]+"\\)$"),as={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ss(){return this.rgb().formatHex()}function ls(){return this.rgb().formatRgb()}function us(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Qa.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?cs(t):3===r?new ps(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?ds(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?ds(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=es.exec(e))?new ps(t[1],t[2],t[3],1):(t=ts.exec(e))?new ps(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=rs.exec(e))?ds(t[1],t[2],t[3],t[4]):(t=ns.exec(e))?ds(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=is.exec(e))?vs(t[1],t[2]/100,t[3]/100,1):(t=os.exec(e))?vs(t[1],t[2]/100,t[3]/100,t[4]):as.hasOwnProperty(e)?cs(as[e]):"transparent"===e?new ps(NaN,NaN,NaN,0):null}function cs(e){return new ps(e>>16&255,e>>8&255,255&e,1)}function ds(e,t,r,n){return n<=0&&(e=t=r=NaN),new ps(e,t,r,n)}function ms(e){return e instanceof Ga||(e=us(e)),e?new ps((e=e.rgb()).r,e.g,e.b,e.opacity):new ps}function fs(e,t,r,n){return 1===arguments.length?ms(e):new ps(e,t,r,null==n?1:n)}function ps(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function hs(){return"#"+gs(this.r)+gs(this.g)+gs(this.b)}function ys(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function gs(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function vs(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new xs(e,t,r,n)}function bs(e){if(e instanceof xs)return new xs(e.h,e.s,e.l,e.opacity);if(e instanceof Ga||(e=us(e)),!e)return new xs;if(e instanceof xs)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new xs(a,s,l,e.opacity)}function xs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Ms(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}Ya(Ga,us,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ss,formatHex:ss,formatHsl:function(){return bs(this).formatHsl()},formatRgb:ls,toString:ls}),Ya(ps,fs,Wa(Ga,{brighter:function(e){return e=null==e?Ka:Math.pow(Ka,e),new ps(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new ps(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hs,formatHex:hs,formatRgb:ys,toString:ys})),Ya(xs,(function(e,t,r,n){return 1===arguments.length?bs(e):new xs(e,t,r,null==n?1:n)}),Wa(Ga,{brighter:function(e){return e=null==e?Ka:Math.pow(Ka,e),new xs(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new xs(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ps(Ms(e>=240?e-240:e+120,i,n),Ms(e,i,n),Ms(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ss=Math.PI/180,Es=180/Math.PI,Cs=4/29,qs=6/29,Os=3*qs*qs;function As(e){if(e instanceof Ds)return new Ds(e.l,e.a,e.b,e.opacity);if(e instanceof Rs)return ks(e);e instanceof ps||(e=ms(e));var t,r,n=ws(e.r),i=ws(e.g),o=ws(e.b),a=Ns((.2225045*n+.7168786*i+.0606169*o)/1);return n===i&&i===o?t=r=a:(t=Ns((.4360747*n+.3850649*i+.1430804*o)/.96422),r=Ns((.0139322*n+.0971045*i+.7141733*o)/.82521)),new Ds(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Ds(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Ns(e){return e>.008856451679035631?Math.pow(e,1/3):e/Os+Cs}function Is(e){return e>qs?e*e*e:Os*(e-Cs)}function Ts(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ws(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ls(e){if(e instanceof Rs)return new Rs(e.h,e.c,e.l,e.opacity);if(e instanceof Ds||(e=As(e)),0===e.a&&0===e.b)return new Rs(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Es;return new Rs(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Rs(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function ks(e){if(isNaN(e.h))return new Ds(e.l,0,0,e.opacity);var t=e.h*Ss;return new Ds(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Ps(e){return function(){return e}}function js(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Ps(isNaN(e)?t:e)}Ya(Ds,(function(e,t,r,n){return 1===arguments.length?As(e):new Ds(e,t,r,null==n?1:n)}),Wa(Ga,{brighter:function(e){return new Ds(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Ds(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new ps(Ts(3.1338561*(t=.96422*Is(t))-1.6168667*(e=1*Is(e))-.4906146*(r=.82521*Is(r))),Ts(-.9787684*t+1.9161415*e+.033454*r),Ts(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),Ya(Rs,(function(e,t,r,n){return 1===arguments.length?Ls(e):new Rs(e,t,r,null==n?1:n)}),Wa(Ga,{brighter:function(e){return new Rs(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Rs(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return ks(this).rgb()}}));var Fs=function e(t){var r=function(e){return 1==(e=+e)?js:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Ps(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=fs(e)).r,(t=fs(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=js(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1),Vs=/^class(-pyramid)?/,_s=function(e,t,r,n){var i=void 0!==r.min?r.min:n.min(),o=void 0!==r.max?r.max:n.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Na(c))),o=Math.max.apply(Math,[o].concat(Na(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,r=e.max,n=e.limits,i=e.range,o=[],a=[];if(n.length)if(n[n.length-1]<t)a.push(t,r),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(n[0]>r)a.push(t,r),o.push(i[0],i[0],i[0]);else{if(n[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<n.length;s++)if(t<n[s]){o.push(i[s]);break}}for(var l=0;l<n.length;l++)t<n[l]&&n[l]<r&&(a.push(n[l]),o.push(i[l]));if(n[n.length-1]<r)a.push(r),o.push(i[n.length]),o.push(i[n.length]);else{a.push(r);for(var u=0;u<n.length;u++)if(n[u]>r){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:r,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var m=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var f=0;f<c.length;f+=1)if(m[f]){var p=d[f],h=d[f+1],y=Fs(p,h)(.5);u.range.push(y),u.domain.push(c[f]),f<c.length-1&&m[f+1]&&(u.range.push(d[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(d[f]),u.range.push(d[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function Bs(e,t,r,n,i){var o,a,s,l=0,u=[],c=(e-t)/(n+1);if(0===c)return 1;for(o=0;o<r.length;o+=1)a=.99*(r[o]-t),s=r[o]>e?Math.floor(e/c):r[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=n||l>=i?Math.max(l,n):Bs(e,t,r,n+1,i)}var Hs=function(e,t,r,n){var i,o,a=t.theme,s=t.hc,l=n.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:r.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=r.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=r.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Na(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===r.input.autoMinMax){if(u.min=r.input.measureMin,u.max=r.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Na(c)),u.max=Math.max.apply(Math,Na(c))}if(r.input.measureScheme&&(u.palettes={quant:r.input.measureScheme}),a){var m=a.getDataColorScales().filter((function(e){return e.key===r.input.measureScheme}))[0];u.type=m&&Vs.test(m.type)?"categorical":"continuous","categorical"===u.type&&(o=m.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Na(m.colors.map((function(e){return e?e.length:0})))):m.colors.length)}if("categorical"===u.type){for(var f=d?Bs(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,h=[],y=0;y<f+1;y+=1)h.push(u.min+p*y);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),r=Math.max(1,Math.floor(t.length/f)),n=[],i=0;i<f;i+=1)n.push(t[i*r]);return[n[0]].concat(n,[n[n.length-1]])}}return u};function $s(e,t){var r;return t.activeMeasureIndex>=0?r=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?r=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(r=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),r||(r=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(r=e.pic.fields().filter((function(e){return"measure"===e.type()}))[r.raw().matchMeasure]),r}function zs(e){var t,r=e.cm,n=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,r){var n=r.primary;return void 0!==t.paletteColor&&t.paletteColor&&(n=e.resolveUIColor(t.paletteColor)),Oa(Oa({},r),{},{mode:"constant",type:"constant",primary:n})}(r,o,n):"byExpression"===s?function(e,t,r){var n="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(n)&&"colorByMeasureExpression"===e.raw().id})),o=i;return Oa(Oa({},r),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:r.nil})}(i,a,n):null}function Us(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Ys(e,t){for(var r=(null==t?void 0:t.domain)||[],n=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=r.indexOf(o);-1===s?(r.push(o),n.push(a.primary)):n[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=r.indexOf(o);-1!==l&&(r.splice(l,1),n.splice(l,1))}}return{domain:r,range:n,exclude:i}}function Ws(e,t,r,n){var i,o=function(e,t,r,n){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,r){var n=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?$s:o,s=r.input.byMeasureDef||{activeMeasureIndex:0},l=a(r,s),u=Hs(0,{theme:n,hc:i},r,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=r.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=r.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),r.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&_a(u,_s(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,r,t);if("byDimension"===t.input.mode)return function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.getCDef,o=void 0===i?za:i,a=n.getCByField,s=void 0===a?Ua:a,l=n.getPersistence,u=void 0===l?$a:l,c=o(t,r),d=s(r,c),m=d?d.raw():{},f=r&&r.pic?r.pic.raw():{};if(m.qError||m.qSize&&0===m.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:m.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===m.labelExpRef&&(p.label=r.input.altLabel)),!p.label&&d&&(p.label=d.title()),r.input.dimensionScheme&&(p.palettes={categorical:r.input.dimensionScheme}),r.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),_a(p,u(t,r,c,d,{byRow:Ha,byElemNo:Ba})),p}(e,r,t);if("byExpression"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!(s&&s.raw().qFallbackTitle&&(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||r.input.expressionIsColor)))return{mode:"constant",type:"constant",primary:n.nil};if(r.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Hs(0,{hc:i,theme:o},r,{f:s});return l.invalid||(l.label=r.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,r,t,n);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.input.useBaseColors;if(("byMultiple"===r.input.mode||"primary"===r.input.mode&&"measure"===r.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===r.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(n.primary):u.push(i)}}));var c=r.input.dimensionScheme?{categorical:r.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===r.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var m=[],f=[];return i.qDimensionInfo.forEach((function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){m.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(n.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:m.length?m[0]:void 0,explicit:m.length?{domain:m,range:f}:void 0}}var p=n.primary;if(void 0!==r.input.paletteColor)r.input.paletteColor&&(p=e.resolveUIColor(r.input.paletteColor));else{var h=r.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,r,t,n)}return{}}(e,t,r,n);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(r,i){return zs({cm:e,input:r,defaults:n,index:i,pic:t.pic})})),function(e,t){var r,n,i,o=t.translator;if(Us(e),1===(null===(r=e.measureOverrides)||void 0===r?void 0:r.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Ys(e.measureOverrides,e.explicit),Us(e)),null!==(n=e.measureOverrides)&&void 0!==n&&n.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Ys(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,r)):o}function Gs(e){var t=Oa({hc:null,colorProps:null,layout:null,theme:null},e),r={},n={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(n.auto=e,i):n.auto},getDimensionColorMap:function(e){return e?(n.getDimensionColorMap=e,i):n.getDimensionColorMap},getAttributeDimension:function(e){return e?(n.getAttributeDimension=e,i):n.getAttributeDimension},getMeasure:function(e){return e?(n.getMeasure=e,i):n.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(_a(t,e),(r={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=n.auto(e.layout);r.input=_a(!0,{},r.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(r.input.dimensionScheme=a[0].key);var s=0;r.input.byDimDef&&+r.input.byDimDef.activeDimensionIndex>=0&&(s=+r.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&r.input.byDimDef&&(r.input.byDimDef.type="libraryItem",r.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=r.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(r.input=_a(!1,{},r.input,{measureOverrides:null}))},palettes:function(){if(!r.palettes){var e=t.theme,n=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){n.push({key:"ui",colors:e.colors})})),r.palettes=n}return r.palettes},getAuxiliaryData:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=e.auxiliary||{},o=i.key;if("measure"===e.fieldType)return n.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(r,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?n.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?n.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,n){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,n).then((function(n){if(!n)return{};if("measure"===e.fieldType){if(n.coloring&&n.coloring.gradient){var o=r.pic.field(e.field);return _s(i,n.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=n[0],l=n[1]?n[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[r.pic.field(e.field).raw(),r.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,r,n){var i=n.external,o=n.field,a=Oa({},e);_a(a,Ba(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=r.resolveUIColor(t.nul)),t.oth&&(a.others=r.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,_a(a,Ba(o)))):!1===t.autoFill&&t.single?a.range=[r.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),_a(a,Ba(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,r){for(var n={},i=0;i<e.length;i+=1)n[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;n[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(n[u])))}return a.push(-3,-2),o.push(r.others),o.push(r.nil),a},range:function(){return o}}}(t.colors,r,a)),a}(a,l,i,{external:t,field:r.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===r.uiPalette&&(r.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!r.uiPalette)return e.color;var t="none"===r.uiPalette.colors[0]?e.index:e.index-1;return void 0===r.uiPalette.colors[t]?e.color:r.uiPalette.colors[t]},settings:function(){if(this.palettes(),!r.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},n=t.theme;n&&(e=Oa(Oa({},e),n.getDataColorSpecials())),r.settings=_a(e,Ws(this,r,t,e))}return r.settings}};return i}var Ks=function(e,t){var r=e.fieldType,n={};if(t)if("measure"===r){var i=t.coloring;i&&(n.measureGradient=i.gradient)}else if("dimension"===r){var o=t[0],a=t[1];o&&(n.legendDataPage=o),a&&(n.dimValsData=a.colorMap)}return n},Xs=function(e){throw e.isHandled=!0,e},Js=function(e,t){var r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:r.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},Zs=function(e,t){var r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:r.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},Qs=function(e,t){var r=t.layout,n=t.model,i=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.legendDataPage?Promise.resolve(r.snapshotData.content.chartData.legendDataPage):Promise.reject():n&&n.session&&i?n.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Xs):Promise.reject()};function el(e){var t=e.hc,r=e.source,n=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:r,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}function tl(e){return function(t){return"object"===Ma(t.datum[e])?t.datum[e].value:void 0}}function rl(e){return"object"===Ma(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function nl(e){return-3===e.datum.value}var il=function(e,t,r){var n=e&&e.dock||void 0;if("auto"!==n)return n||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return r?"left":"right"},ol=function(e,t,r){return!(r.invalid||"color"===r.type||"measure"===r.mode&&t.qMeasureInfo.length<=1||"dimension"===r.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function al(e,t){var r=e.styleReference,n=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:il(o,n,i)},show:"function"==typeof o.show?function(){return ol(o,l,a)}:ol(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(r,"legend.title","color"):void 0,fontSize:s?s.getStyle(r,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(r,"legend.title","fontFamily"):"QlikView Sans, sans-serif"}}}}function sl(e,t,r){var n=[],i=[],o=function(e,t,r){return"categorical"===t.coloring.type?function(e,t,r){var n=al(e,t);if(!n.show)return!1;var i=e.key,o=e.styleReference,a=e.viewState,s=e.rtl,l=e.settings,u=e.style,c=t.scaleKey,d=t.theme,m=t.scales,f={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"},p="".concat(c,"Legend");return _a(!0,n,{type:"legend-cat",key:"".concat(i,"-cat"),scale:p in m?p:c,settings:{layout:{scrollOffset:function(){return a?a.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(n.layout.dock)?2:1,direction:s?"rtl":"ltr",horizontal:20},item:{show:function(e){return-2!==e.datum.value},label:{fill:d?d.getStyle(o,"legend.label","color"):void 0,fontSize:d?d.getStyle(o,"legend.label","fontSize"):void 0,fontFamily:d?d.getStyle(o,"legend.label","fontFamily"):"QlikView Sans, sans-serif"}},navigation:{disabled:r,button:{content:function(e,t){var r=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:f[r]})])])}}}},brush:{consume:[{context:"selection",data:["",i],style:{inactive:{opacity:.3}}}]}},{settings:l,style:u})}(e,t,r):"continuous"===t.coloring.type&&function(e,t){var r=e.key,n=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=al(e,t);return!!u.show&&_a(!0,u,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(n,"legend.label","color"):void 0,fontSize:l?l.getStyle(n,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(n,"legend.label","fontFamily"):"QlikView Sans, sans-serif"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}(e,t,r&&r.navigationDisabled);return n.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,r=e.requireFailure,n=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:r,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,r){var n;if(!r)return!0;if(null!=i&&null!==(n=i.interact)&&void 0!==n&&n.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=r.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,r)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.eventName,n=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:r,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===r||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:(e={},Ca(e,"".concat(r,"start"),(function(e){e.preventDefault(),this.started!==r&&(this.started=r,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),Ca(e,"".concat(r,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),Ca(e,"".concat(r,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,r))),{interactions:i,components:n}}var ll=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function ul(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,r=Gs(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var r=t.layout,n=t.app;return Js(e,{layout:r,app:n})})).getMeasure((function(e,t){var r=t.layout,n=t.app;return Zs(e,{layout:r,app:n})})).getAttributeDimension((function(e,t){var r=t.layout,n=t.model,i=t.app;return Qs(e,{layout:r,model:n,app:i})}));return r.getSnapshotData=Ks,r}({resources:e}),r={},n={},i=function(e){return n.settings||(e||console.warn("settings() called before auxiliarySettings()"),n.settings=t.settings()),n.settings},o={config:function(i){if(r=Oa({},i),n={},!r.key)throw new Error("Missing key");t.set(Oa(Oa({},e),r))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return n.auxiliarySettings?Promise.resolve(n.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return n.auxiliarySettings=e||{},n.settings=Oa(Oa({},n.settings),n.auxiliarySettings),n.scales=void 0,n.color=void 0,n.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var r=i();return t.getAuxiliaryData(r,e).then((function(e){return t.getSnapshotData(r,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var r=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||r)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,r=e.coloring,n=e.theme,i=[];if(r&&r.palettes&&n){var o=r.palettes.categorical||t.dimensionScheme,a=n.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||n.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=r.palettes.metric||t.measureScheme,l=n.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Na(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:r.colorProps,theme:r.theme})},scales:function(){return n.scales=n.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,r=e.coloring,n=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(r){var u={override:!0,domain:r.explicit&&"function"==typeof r.explicit.domain?r.explicit.domain:[].concat(Na((r.explicit||{}).domain||[]),[-3,-2]),range:r.explicit&&"function"==typeof r.explicit.range?r.explicit.range:[].concat(Na((r.explicit||{}).range||[]),[r.others,r.nil])};if("field"===r.mode){if("dimension"===r.fieldType){var c,d=el({hc:t,source:o,coloring:r}).data;if(r.legendDataset){var m=0,f={};a.data("q")({data:t}).extract({field:r.field,trackBy:r.valueAccessor,reduce:function(e){var t=e[0];return f[t]=m++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:d,range:r.range,domain:r.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=Oa(Oa({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===r.fieldType){var h={data:{field:r.field},min:r.min,max:r.max};s[l]=_a({},h,{type:"categorical"===r.type?"threshold-color":"sequential-color",range:r.range,domain:r.domain,invert:r.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=_a({},h,{invert:!!n}))}else if("color"!==r.type)throw new Error("UNUSED FIELD")}else if("dimension"===r.mode){var y={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}else if("measure"===r.mode){var g={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,n;return!(null!==(t=r.explicit)&&void 0!==t&&null!==(n=t.exclude)&&void 0!==n&&n.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}}return s}({hc:r.hc,coloring:i(),key:r.key,source:r.source,picasso:e.picasso}),n.scales},color:function(){return n.color=n.color||function(e){var t=e.coloring,r=e.scales,n=e.key,i=tl(n),o=tl("".concat(n,"IsAnOther")),a=function(e,t){var n=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return nl(e)||o(e)?u:l}:r[t]?function(e){return nl(e)?u:rl(e)||-2===i(e)&&"dimension"===n||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return nl(e)||o(e)?u:rl(e)?l:c}:"color"===d?function(e){return nl(e)||o(e)?u:rl(e)?l:i(e)||u}:null},s=a(t,n);if(t.measureOverrides){var l=tl("".concat(n,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:r.key}),n.color},datumProps:function(e){return function(e){var t,r,n=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(r={field:t,reduce:"first"},"color"===i.type&&(r.value=function(e){return"NaN"!==e.qNum?ll(e.qNum):e.qText&&us(e.qText)?e.qText:c})):"dimension"===i.mode?r=void 0!==i.field?i.field:n.qDimensionInfo.length-1:"measure"===i.mode&&(r=l);var d=Ca({},u,r);return n.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:n.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:r.key,hc:r.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:r.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,d=void 0===c?{}:c,m=e.style,f=void 0===m?{}:m,p=arguments.length>1?arguments[1]:void 0;return sl({eventName:t,key:n,rtl:s,viewState:o,chart:a,styleReference:u,settings:d,style:f},{legendProps:r.legendProps,scaleKey:r.key,coloring:i(),theme:r.theme,hc:r.hc,scales:this.scales()},p)}};return o}var cl=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function dl(e){var t=e.qHyperCube,r=t.qDimensionInfo,n=t.qMeasureInfo,i=r.some(cl),o=n.some(cl),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function ml(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Oa(Oa(Oa({},e),t),{},{colorProps:Oa(Oa({},e.colorProps),t.colorProps||{})});return r}var fl=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function pl(e){var t,r=e.qHyperCube.qDimensionInfo.some(fl),n=e.qHyperCube.qMeasureInfo.some(fl),i=r?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:n?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var hl=function(){};function yl(e){var t=e.chart,r=e.logicalSize;if(r)return r;var n=t?t.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}var gl=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function vl(e){var t=e.width,r=e.height,n=gl.filter((function(e){return t>=e.size.width&&r>=e.size.height})).shift();return n?n.key:"SPARK"}var bl={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function xl(e){var t=e.orientation,r=e.dock,n=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(r):function(e,t){var r="left"===e||"near"===e?"left":"right";return t?bl[r]:r}(r,i),a=function(e,t,r){return"vertical"===e?t?"bottom":"top":r?"right":"left"}(t,n,i);return{current:o,opposite:bl[o],start:a,end:bl[a]}}function Ml(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=vl(e);var t=xl({orientation:"horizontal",dock:r.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),n=t.current,i=t.opposite;u.x.dock=n,u.x.opposite=i,u.x.size=e.width;var o=xl({orientation:"vertical",dock:r.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(yl({chart:t,logicalSize:a})),c}var Sl="vertical",El="horizontal";function Cl(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===Sl?Sl:El,m=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",meta:p,update:function(e){p.chart.orientation=r.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=vl(e),p.major.orientation=function(e){var t=e.chartOrientation,r=e.invert;return e.layoutService.meta.isContinuous?El:r?t===Sl?El:Sl:t}({layoutService:r,chartOrientation:p.chart.orientation,invert:m});var t=xl({orientation:p.major.orientation,dock:r.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),n=t.current,i=t.opposite;p.major.dock=n,p.major.opposite=i,p.major.size=p.major.orientation===Sl?e.height:e.width,f.forEach((function(t){var n={};n.orientation=p.major.orientation===Sl?El:Sl;var i=xl({orientation:n.orientation,dock:r.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;n.dock=o,n.opposite=a,n.start=s,n.end=l,n.size=n.orientation===Sl?e.height:e.width,p[t.name]=n}))}};return h.update(yl({chart:t,logicalSize:l})),h}function ql(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?Ml:Cl)({chart:t,layoutService:r,config:i,typeConfig:a})}function Ol(e,t,r){if(void 0===e||void 0===t)return r;for(var n=t.split("."),i=e,o=0;o<n.length;++o){var a=n[o];if(void 0===i[a])return r;i=i[a]}return i}function Al(e,t,r){if(void 0!==e&&void 0!==t){for(var n=t.split("."),i=n[n.length-1],o=e,a=0;a<n.length-1;++a){var s=n[a];void 0===o[s]&&(o[s]=Number.isNaN(+n[a+1])?{}:[]),o=o[s]}void 0!==r?o[i]=r:delete o[i]}}function Dl(){var e={};return{get:function(t){return e[t]},set:function(t,r){return e[t]=r,r},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function Nl(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=function(){return e.apply(n,o)};clearTimeout(t),t=setTimeout(s,r)}}function Il(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];r=s;var u=Date.now()-o,c=function(){o=Date.now(),n=0,e.apply(t,r)};n||(u>=i?c():n=setTimeout(c,i-u))}}function Tl(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,r=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(r)return r;var n=e.qStateCounts||{},i=n.qLocked,o=void 0===i?0:i,a=n.qOption,s=void 0===a?0:a,l=n.qSelected;return o+s+(void 0===l?0:l)}))}function wl(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Tl(e)}}}(e);case"K":return function(e){var t=Tl(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=Tl(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Ll(e){var t=e.originalArray,r=e.newArray,n=e.matchKey;return Array.isArray(t)&&t.length?(r.forEach((function(e){var r=-1;t.some((function(t,i){return t[n]&&t[n]===e[n]&&(r=i),r})),r>-1?t[r]=e:t.push(e)})),t):r}function Rl(e){return(Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jl(e,t,r){return t&&Pl(e.prototype,t),r&&Pl(e,r),e}function Fl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vl(Object(r),!0).forEach((function(t){Fl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bl(e,t){return(Bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hl(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function $l(e,t,r){return($l=Hl()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Bl(i,r.prototype),i}).apply(null,arguments)}function zl(e){return function(e){if(Array.isArray(e))return Yl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ul(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 Ul(e,t){if(e){if("string"==typeof e)return Yl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yl(e,t):void 0}}function Yl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wl=Object.prototype.hasOwnProperty,Gl=Object.prototype.toString,Kl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,Jl=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Gl.call(e)},Zl=function(e){if(!e||"[object Object]"!==Gl.call(e))return!1;var t,r=Wl.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Wl.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||Wl.call(e,t)},Ql=function(e,t){Kl&&"__proto__"===t.name?Kl(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},eu=function(e,t){if("__proto__"===t){if(!Wl.call(e,t))return;if(Xl)return Xl(e,t).value}return e[t]},tu=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(r in t)n=eu(s,r),s!==(i=eu(t,r))&&(c&&i&&(Zl(i)||(o=Jl(i)))?(o?(o=!1,a=n&&Jl(n)?n:[]):a=n&&Zl(n)?n:{},Ql(s,{name:r,newValue:e(c,a,i)})):void 0!==i&&Ql(s,{name:r,newValue:i}));return s};function ru(e,t,r){if(!e)return-1;var n=r.cache,i=e.origin?e.origin():null;i&&(e=i);var o=n.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<n.wrappedFields.length;l++)if(s=n.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=n.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function nu(e,t,r){var n=r.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:n,field:e.field.key()}),i}function iu(e){var t=e.cache,r=e.f,n=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=n;if(i.field&&i.field!==r){var m=ru(i.field,o,{cache:t});if(-1===m)return;d=tu({qRow:a},m(s))}u[c]=nu(i,d,{key:l})}function ou(e,t,r,n){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===Rl(i[a].field)?i[a].field:t.field(i[a].field),c=n.normalizeConfig(i[a],t),d=c.props,m=c.main,f=Object.keys(d),p=!!i[a].trackBy,h=Rl(i[a].trackBy),y={},g=[],v=[],b=0;b<s.qDataPages.length;b++){var x=ru(u,s.qDataPages[b],{cache:r});if(-1!==x)for(var M=0;M<s.qDataPages[b].qMatrix.length;M++){var S=s.qDataPages[b].qArea.qTop+M,E=tu({qRow:S},x(s.qDataPages[b].qMatrix[M])),C=nu(m,E,{key:l});if(!m.filter||m.filter(E)){for(var q=0;q<f.length;q++){var O=d[f[q]],A=O.fields||[O];O.fields&&(C[f[q]]=[]);for(var D=0;D<A.length;D++)iu({cache:r,f:u,mainCell:E,p:A[D],prop:f[q],props:d,page:s.qDataPages[b],rowIdx:S,row:s.qDataPages[b].qMatrix[M],sourceKey:l,target:O.fields?C[f[q]]:C,targetProp:O.fields?D:f[q]});if(O.fields){var N=C[f[q]].map((function(e){return e.value})),I=C[f[q]].map((function(e){return e.label}));C[f[q]]={value:"function"==typeof O.value?O.value(N):void 0!==O.value?O.value:N,label:"function"==typeof O.label?O.label(I):void 0!==O.label?String(O.label):String(C[f[q]].value)}}}p&&n.track({cfg:i[a],itemData:E,obj:C,target:g,tracker:y,trackType:h}),v.push(C)}}}p?o.push.apply(o,zl(n.collect(g,{main:m,propsArr:f,props:d}))):o.push.apply(o,v)}return o}function au(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function su(e,t){var r,n,i,o,a,s=new du(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=lu);r=u.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(a=i.length))for(r.children=new Array(a),o=a-1;o>=0;--o)u.push(n=r.children[o]=new du(i[o])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(cu)}function lu(e){return e.children}function uu(e){e.data=e.data.data}function cu(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function du(e){this.data=e,this.depth=this.height=0,this.parent=null}function mu(e){if("function"!=typeof e)throw new Error;return e}du.prototype=su.prototype={constructor:du,count:function(){return this.eachAfter(au)},each:function(e){var t,r,n,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),r=o.children)for(n=0,i=r.length;n<i;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(r=0,n=t.length;r<n;++r)o.push(t[r]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,r,n=this,i=[n];n=i.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return su(this).eachBefore(uu)}};var fu={depth:-1},pu={};function hu(e){return e.id}function yu(e){return e.parentId}function gu(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var r,n=e.split("/"),i=t,o=0;o<n.length;o++){if("*"===n[o]&&Array.isArray(i)){var a=[];r=n.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=gu(r,i[s]);Array.isArray(l)?a.push.apply(a,zl(l)):a.push(l)}return a}if(!n[o]&&Array.isArray(i)){var u=new Array(i.length);r=n.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=gu(r,i[c]);return u}n[o]in i&&(i=i[n[o]])}return i}function vu(e,t,r){var n=[];if(!e||!e.length)return n;if(t<=0){var i=r>=0?[e[r]]:e;n.push.apply(n,zl(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&n.push.apply(n,zl(vu(e[o].children,t-1,r)));return n}function bu(e,t,r){if(e===t)return function(e){return e};if(e>t){var n=Math.max(0,Math.min(100,e-t)),i=zl(Array(n)).map(String.prototype.valueOf,"parent").join(".");return Function("node","return node.".concat(i,";"))}if(t>e){var o=Math.max(0,Math.min(100,t-e));return function(e){return vu(e.children,o-1,r)}}return!1}function xu(e,t){var r=t.cache;if("number"==typeof e)return r.fields[e];var n=r.allFields;if("function"==typeof e){for(var i=0;i<n.length;i++)if(e(n[i]))return n[i];return!1}if("string"==typeof e){for(var o=0;o<n.length;o++)if(n[o].key()===e||n[o].title()===e)return n[o]}else if(e&&-1!==n.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var Mu=/^qDimensionInfo(?:\/(\d+))?/,Su=/^\/?qMeasureInfo\/(\d+)/,Eu=/\/qAttrExprInfo\/(\d+)/,Cu=/\/qAttrDimInfo\/(\d+)/;function qu(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function Ou(e,t){var r=t.cube;if(!e)return-1;var n=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=n,d=r.qEffectiveInterColumnSortOrder,m=qu(r);return Mu.test(c)&&(i=!0,o=+Mu.exec(c)[1],c=n.replace(Mu,"")),Su.test(c)&&("K"===r.qMode?l=+Su.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+Su.exec(c)[1],u=0):u=+Su.exec(c)[1],c=c.replace(Su,"")),c&&(Cu.exec(c)?s=+Cu.exec(c)[1]:Eu.exec(c)&&(a=+Eu.exec(c)[1])),{fieldDepth:(i?"S"===r.qMode?m[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):r.qDimensionInfo.length-("K"===r.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function Au(e,t){var r,n,i=bu(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return r=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?n=function(e){var r;return null==e||null===(r=e.qAttrDims)||void 0===r?void 0:r.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(n=function(e){var r;return null==e||null===(r=e.qAttrExps)||void 0===r?void 0:r.qValues[t.attrIdx]}),{nodeFn:i,attrFn:n,valueFn:r}}function Du(e,t,r){var n=r.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:n,field:e.field.key()}),i}function Nu(e){for(var t=e.propsArr,r=e.props,n=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=r[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var m=function(e){var r=u[e],m=void 0,f=void 0,p=void 0,h=void 0,y=void 0,g=void 0;if("primitive"===r.type?(p=r.value,g=String(r.value)):("function"==typeof r.value&&(m=function(e){return r.value(e,n)}),"function"==typeof r.label&&(f=function(e){return r.label(e,n)}),r.accessor?(h=r.accessor(n),Array.isArray(h)?(y=h.map(r.valueAccessor),r.attrAccessor&&(y=y.map(r.attrAccessor)),m&&(p=y.map(m),m=null),f&&(g=y.map(f),f=null),p=r.reduce?r.reduce(p):p,g=r.reduceLabel?r.reduceLabel(g,p):String(p)):g=p=r.attrAccessor?r.attrAccessor(r.valueAccessor(h)):r.valueAccessor(h)):(p=i,g=i)),l.fields){var v=m?m(p):p;c.push(v),d.push(f&&null!=g?f(g):null!=g?g:String(v))}else{var b=m?m(p):p;o[t[s]]={value:b,label:f?f(g):null!=g?g:String(b)},r.field&&(o[t[s]].source={field:r.field.key(),key:a})}},f=0;f<u.length;f++)m(f);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,n):c,label:"function"==typeof l.label?l.label(d,n):d})}}var Iu=function(e,t,r){var n="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=gu(n,e);return o&&o[0]?(t.tree=su(o[0],r.children||function(e){return e[i]}),t.tree):null};function Tu(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){var t=e.raw().qColumnOrder,r=e.fields();return t&&t.length===r.length?t:r.map((function(e,t){return t}))}(e),n=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return r.indexOf(n.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return r.indexOf(n.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var m=l[i[d]],f="".concat(u,"__").concat(m.qText);a[f]||(a[f]=_l({__id:f,__parent:u,qValues:[]},m),c=!0),u=f}if(c)for(var p=0;p<o.length;p++){var h=l[o[p]];a[u].qValues.push(h)}}var y=Object.keys(a).map((function(e){return a[e]}));return function(){var e=hu,t=yu;function r(r){var n,i,o,a,s,l,u,c=r.length,d=new Array(c),m={};for(i=0;i<c;++i)n=r[i],s=d[i]=new du(n),null!=(l=e(n,i,r))&&(l+="")&&(m[u="$"+(s.id=l)]=u in m?pu:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(r[i],i,r))&&(l+="")){if(!(a=m["$"+l]))throw new Error("missing: "+l);if(a===pu)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=fu,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(cu),o.parent=null,c>0)throw new Error("cycle");return o}return r.id=function(t){return arguments.length?(e=mu(t),r):e},r.parentId=function(e){return arguments.length?(t=mu(e),r):t},r}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(y)}var wu=function(e){for(var t=e.propsArr,r=e.props,n=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=r[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var m=Au(o,Ou(d.field,{cube:n,cache:i}));d.accessor=m.nodeFn,d.valueAccessor=m.valueFn,d.attrAccessor=m.attrFn}}};function Lu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?Tu(t):Iu(i,r,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=qu(i),m=d[u-1];c=r.fields[m]}else{var f=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(f=i.qDimensionInfo.length),c=r.fields[f]}var p=n.normalizeConfig(_l(_l({},e),{},{field:c?c.key():void 0}),t),h=p.props,y=p.main,g=Object.keys(h);l[u]={propsArr:g,props:h,main:y};var v=c?Ou(c,{cube:i,cache:r}):{fieldDepth:0};wu({propsArr:g,props:h,cube:i,cache:r,itemDepthObject:v,f:c})}for(var b=a.copy(),x=b.descendants(),M=a.descendants(),S=0;S<M.length;S++){var E=l[M[S].depth].propsArr,C=l[M[S].depth].props,q=l[M[S].depth].main,O=x[S],A=O.data,D=Du(q,A,{key:o});Nu({propsArr:E,props:C,item:O,itemData:A,ret:D,sourceKey:o,isTree:!0}),M[S].data=D}return a}function Ru(e,t,r,n){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!Iu(s,r,e))continue;var u="object"===Rl(i[a].field)?i[a].field:t.field(i[a].field),c=n.normalizeConfig(i[a],t),d=c.props,m=c.main,f=Object.keys(d),p=Ou(u,{cube:s,cache:r}),h=Au({fieldDepth:0},p),y=h.nodeFn,g=h.attrFn,v=h.valueFn;wu({propsArr:f,props:d,cube:s,cache:r,itemDepthObject:p,f:u});for(var b=!!i[a].trackBy,x=Rl(i[a].trackBy),M={},S=[],E=y(r.tree),C=[],q=0;q<E.length;q++){var O=E[q],A=g?g(v(O)):v(O);if(!m.filter||m.filter(A)){var D=Du(m,A,{key:l});Nu({propsArr:f,props:d,item:O,itemData:A,ret:D,sourceKey:l}),b&&n.track({cfg:i[a],itemData:A,obj:D,target:S,tracker:M,trackType:x}),C.push(D)}}b?o.push.apply(o,zl(n.collect(S,{main:m,propsArr:f,props:d}))):o.push.apply(o,C)}return o}var ku,Pu=(function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var r,n,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=m-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,m):"";if(r=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",o=n&&n[1]&&n[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",g=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-g+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),p+(r?"-":"")+n+x}}(dd={exports:{}}),dd.exports);function fd(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var pd={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},hd=/%$/,yd=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,gd=/^\(oct\)/i,vd=/^\(dec\)/i,bd=/^\(hex\)/i,xd=/^\(bin\)/i,Md=/^\(rom\)/i,Sd=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ed=/#|0/g;function Cd(e,t,r,n){return e=e.toString(t),r[1]===r[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",n||".")}function qd(e,t,r){var n=fd(e);return r?n:new RegExp(n||"",t)}function Od(e,t,r){var n,i,o,a,s,l,u,c,d,m,f,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),m=t,(f=r)&&(f=fd(f)),m&&(m=fd(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(f,"[#0]+)?")),a=(o=(o=p.match(d))?o[0]:"")?p.substr(0,p.indexOf(o)):p,s=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===r&&(i=(n=o.split(r)).pop(),o=n.join("")+r+i,t=""),l=t,t=/,/.test(r)?"¤":",",l&&(o=o.replace(qd(l,"g"),t)),u=r,r=".",u&&(o=o.replace(qd(u,"g"),r)),c=(c=o.match(/#/g))?c.length:0;var h,y=p.split(u);y[1]&&(h=y[1].match(Ed)),e.prefix=a||"",e.postfix=s||"",e.pattern=p,e.maxPrecision=h?h.length:2,e.percentage=hd.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(qd(t,null,!0),"|").concat(qd(r,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=r,e.temp=c}var Ad=function(){function e(t,r,n,i,o){dc(this,e),this.localeInfo=t,this.pattern=r,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return pd;var r={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(r[t[0]]=t[1])})),r}(t,this.patternSeparator),this.prepare()}return fc(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,r,n){return this.prepare(t,r,n),this.formatValue(e)}},{key:"prepare",value:function(e,t,r){var n;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===r&&(r=this.decimalDelimiter),e?(this._prepared={positive:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},n=this._prepared,e=e.split(this.patternSeparator),n.positive.pattern=e[0],n.negative.pattern=e[1],n.zero.pattern=e[2],Sd.test(e[0])&&(n.positive.isFunctional=!0),e[1]?Sd.test(e[1])&&(n.negative.isFunctional=!0):n.negative=!1,e[2]?Sd.test(e[2])&&(n.zero.isFunctional=!0):n.zero=!1,n.positive.isFunctional||Od(n.positive,t,r),n.negative&&!n.negative.isFunctional&&Od(n.negative,t,r),n.zero&&!n.zero.isFunctional&&Od(n.zero,t,r)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,r,n,i,o,a,s,l,u,c=this._prepared,d="",m="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,r){var n;return yd.test(t)?e=Cd(e,Number(/\d{2}/.exec(t)[0]),t,r):gd.test(t)?e=Cd(e,8,t,r):vd.test(t)?e=Cd(e,10,t,r):bd.test(t)?e=Cd(e,16,t,r):xd.test(t)?e=Cd(e,2,t,r):Md.test(t)&&(n="",e<0&&(n="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?n+(e=function(e,t){for(var r,n="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(r=0;r<a.length;r++)if(a[r]<=i){n+=s[r],i-=a[r];break}for(r=0;r<o;r++)n="M".concat(n);return t[1]!==t[1].toUpperCase()&&(n=n.toLowerCase()),n}(e,t)):t+n+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,h,y=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),g=y[0];for(s=0,r=Number(Number(e).toExponential().split("e")[1]);g<=r&&s<y.length;)g=y[++s];s>0&&(p=y[s-1]),p&&r>0&&p>0?h=p:(r<0&&p<0||!p)&&(g<0&&g-r<=c.maxPrecision?h=g:p<=r&&!(g>0&&-r<=c.maxPrecision)&&(h=p)),h&&(d=this.abbreviations[h],e/=Math.pow(10,h))}if(n=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(n>=1e15||n>0&&n<=1e-14)e=n?n.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=md(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),M=u.replace(/#+$/,"").length,S=("I"===this.type?0:n%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=S.length;s<M;s++)S+="0";S&&(e+=o+S)}else 0===v&&(i=0)}else if(n>=Math.pow(10,t)||n<1||n<1e-4)0===e?e="0":n<1e-4||n>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),m=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(n)/Math.log(10)))),s=0;s<t;s++)l+="#";e=md(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+m+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function Dd(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.size,o=void 0===i?5e3:i,a=n.multipleArguments,s=void 0!==a&&a,l=n.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),d=Object.create(null),m=0,f=0;return(t=s?function(){return r=u.apply(void 0,arguments),t.has(r)?t.get(r):t.set(r,e.apply(void 0,arguments))}:function(n){return r=u(n),t.has(r)?t.get(r):t.set(r,e(n))}).set=function(e,t){return m>=o&&(delete c[d[f]],delete d[f],m--,f++),c[e]=t,d[m]=e,m++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),d=Object.create(null),m=0,f=0},t.size=function(){return m},t}function Nd(e,t,r,n,i){var o=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return bc(Ad,t)}(i,e,t,r,n),a=Dd(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,r,n){return a.clear(),o.format(t,e,r,n)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Id=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Td=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],wd=["January","February","March","April","May","June","July","August","September","October","November","December"],Ld=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Rd(e,t){for(var r=e.length;r<t;r++)e="0".concat(e);return e}function kd(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}var Pd=function(){function e(t,r,n){dc(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Id,qDayNames:Td,qLongMonthNames:wd,qMonthNames:Ld}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),r||(r=(pc(i={},"T",o.qTimeFmt||"hh:mm:ss"),pc(i,"D",o.qDateFmt||"YYYY-MM-DD"),pc(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[n]),this.pattern=r}return fc(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var r,n,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(n=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=n.getUTCDay()-1)<0&&(a=6),r={year:n.getUTCFullYear(),month:n.getUTCMonth(),day:a,date:n.getUTCDate(),h:o,m:n.getUTCMinutes(),s:n.getUTCSeconds(),f:n.getUTCMilliseconds(),t:n.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){var r,n=function(e){var t=e,r=24*kd(t),n=60*kd(r),i=60*kd(n),o=1e3*kd(i);return{d:Math.floor(t),h:Math.floor(r),m:Math.floor(n),s:Math.floor(i),f:Math.round(o)}}(e),i=n.d,o=n.h,a=n.m,s=n.s,l=n.f,u=0;/w+|t+/gi.test(t)&&(r=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(r.getTime())&&(r=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=r?r.getDay()-1:0)<0&&(u=6);var c="";return r&&(c=r.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Rd("".concat(t.year).slice(-2),2),YYY:Rd("".concat(t.year).slice(-3),3),def:function(e){return Rd("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Rd("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Rd("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Rd("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Rd("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Rd("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Rd("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var r="".concat(t.f),n=e.length-r.length;if(n>0)for(var i=0;i<n;i++)r+="0";else n<0&&(r=r.slice(0,e.length));return r}},"t{1,2}|T{1,2}":{def:function(e){var r=t.t;return e[0].toUpperCase()===e[0]&&(r=r.toUpperCase()),r.slice(0,e.length)}}}}(this,r),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var d=new RegExp(u.join("|"),"g");return t.replace(d,(function(e){var t,r,n;for(r in l)if(Object.prototype.hasOwnProperty.call(l,r)&&(t=new RegExp(r)).test(e))break;if(!t)return"";for(var i in l[r])if(i===e||i.toLowerCase()===e){void 0===(n=l[r][i])&&(n=l[r][i.toLowerCase()]);break}return void 0===n&&(n=l[r].def),"function"==typeof n&&(n=n(e)),n}))}}]),e}();function jd(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return bc(Pd,t)}function Fd(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function Vd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=jd(r,e,t),i=Dd(n.format.bind(n),{toKey:function(e){return"object"===cc(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return"IV"!==t?Fd(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(r){return n=jd(r,e,t),i=Dd(n.format.bind(n),{toKey:function(e){return"object"===cc(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function _d(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Vd(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var r="#",n=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(r=e.qNumFormat.qFmt||r,n=e.qNumFormat.qThou||n,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(r="#".concat(i,"##A"),o="U"),Nd(r,n,i,o,t)}function zd(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.meta,n=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),d=function(e){return e.qText||""},m="dimension"===l?"first":"avg",f=_d(r,o),p="dimension"===l?"first":function(e,t){return f(t)},h={id:function(){return n},key:function(){return i},raw:function(){return r},title:function(){return r.qFallbackTitle||r.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(h)),e},min:function(){return r.qMin},max:function(){return r.qMax},value:c,label:d,reduce:m,reduceLabel:p,formatter:function(){return f},tags:function(){return r.qTags}};return h}function Hd(e,t,r,n,i){return(t[e]||[]).map((function(t,o){var a="".concat(n?"".concat(n,"/"):"").concat(e,"/").concat(o),s={instance:zd(Tc({id:"".concat(r?"".concat(r,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Hd("qAttrDimInfo",t,r,a,Tc({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=Hd("qAttrExprInfo",t,r,a,Tc({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=Hd("qMeasureInfo",t,r,a,Tc({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function $d(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.key,o=n.data,a=n.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=$d.util,d={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},m={key:function(){return i},raw:function(){return u},field:function(e){return Xc(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,m,l,c)},hierarchy:function(e){return d.hierarchy(e,m,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(d.extractor=cd,d.hierarchy=ud,d.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(d.extractor=kc,d.pages=u.qDataPages,d.hierarchy=ud):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},m,l,c)};var f="S"===u.qMode?function(e){return e.qElemNumber}:void 0,p="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,xc(Hd("qDimensionInfo",u,i,"",Tc({},d,{value:f,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,xc(Hd("qMeasureInfo",u,i,"",Tc({},d,{value:p,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var h=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return h(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=m.field(e.from),r=zd(yc({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},m,l,c)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(r)})),(r=l.allFields).push.apply(r,xc(l.virtualFields)),m}var Bd=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Ud=/\/qDimensionInfo(?:\/(\d+))?/,Yd=/\/qMeasureInfo\/(\d+)/,Wd=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Gd=/\/qAttrExprInfo\/(\d+)/,Kd=/\/?qHyperCube/,Xd=/\/?qTreeData/,Jd=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},Zd=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function Qd(e,t){var r=e,n=-1,i=-1,o="",a=function(e){return e};Kd.test(e)?(o="".concat(r.substr(0,r.indexOf("qHyperCube")+10)),a=Jd):Xd.test(e)&&(o="".concat(r.substr(0,r.indexOf("qTreeData")+9)),a=Zd);var s=!0;if(Ud.test(e)&&(n=+Ud.exec(e)[1]),Yd.test(e)&&(i=+Yd.exec(e)[1]),Wd.test(e)){i=-1,n=0;var l=+Wd.exec(r)[2];isNaN(l)||(n=l,r=r.replace(/\/\d+$/,"")),s=!1}if(Gd.test(e)){var u=i;if(t){i=0;var c=Wc(o,t);i+=(c.qMeasureInfo||[]).length,n>-1?(i=c.qDimensionInfo.slice(0,n).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),n=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+Gd.exec(r)[1]}else n>-1?(n=-1,i=+Gd.exec(r)[1]):i+=+Gd.exec(r)[1]+1}return Bd.forEach((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||Mc(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=t[0],i=t[1];r=r.replace(n,i)})),s&&(r=a(r)),r&&"/"!==r[0]&&(r="/".concat(r)),{measureIdx:i,dimensionIdx:n,path:r}}function em(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=r.byCells,o=r.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=Qd(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var r=e.brush.ranges();r.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),r.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){var d=n.qHyperCube,m=d.qNoOfLeftDims,f=d.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===m||f>=m)&&m>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:f-m})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var h=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!h.length,a.push({params:[t.path,t.dimensionIdx,h,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=r.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function tm(e){$d.util=e.data("matrix").util,e.data("q",$d),e.formatter("q-number",Nd),e.formatter("q-time",Vd)}function rm(e){var t=rc(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var r=t.qIsOneAndOnlyOne;return void 0!==r&&r}function nm(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===ml(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function im(e){var t=e.brush,r=e.colorField,n=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!r||/qAttrDimInfo/.test(r)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&t.removeKeyAlias(n),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(r))):o&&t.addKeyAlias(n,"qHyperCube/".concat(r))}tm.qBrushHelper=em,tm.selections=em;function om(e){var t=e.brush,r=e.getConfig;return{interceptor:function(e){var n=t.brushes(),i=r(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;n.forEach((function(r){var n,i,a;("range"===r.type||null!==(n=e[0])&&void 0!==n&&n.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==r.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));return l.length>1?function(e){var t=e.layout,r=void 0===t?{}:t,n=e.values,i=void 0===n?[]:n;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=rm({layout:r,path:e}),n=i.filter((function(t){return t.key===e})),o=t?[n.pop()]:n;a.push.apply(a,xl(o))})),a.filter(Boolean)}({layout:s,values:l}):l},rangeInterceptor:function(e){var n=t.brushes(),i=r().allowSimultaneous;return n.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(n.forEach((function(r){var n=r.id===e[0].key||i.includes(r.id)&&i.includes(e[0].key);"range"!==r.type||n||t.clear([])})),e)}}}var am=[],sm=0,lm=function(e){var t=am.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},um=function(){document.addEventListener("keyup",lm)},cm=function(){document.removeEventListener("keyup",lm)},dm=function(e,t){Object.keys(t).forEach((function(r){e.on(r,t[r])}))},mm=function(e,t){Object.keys(t).forEach((function(r){e.removeListener(r,t[r])}))};function fm(e,t,r){if(t&&void 0!==r&&"selectHyperCubeContinuousRange"===e.method){var n=e.params;if(n&&n[1]&&n[1][0]){var i=n[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=r&&(a.qMaxInclEq=!0)}}}function pm(e){var t=e.chart,r=e.document,n=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=n.event===i,d=r.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var m=t.component(o);return!!m&&(m.emit(u),"string"==typeof s&&t.brush(s).clear(),m)}function hm(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return pm({selectionInfo:t,chart:r,document:n,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}function ym(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return pm({selectionInfo:t,chart:r,document:n,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}function gm(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=pm({selectionInfo:t,chart:r,document:n,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var m=d.settings.settings,f=m.scale,p=m.brush,h=r.scale(f).data().fields.map((function(e){return e.id()})),y=r.brush(p),g=y.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));y&&g.length&&g.forEach((function(e){y.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}function vm(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;pm({selectionInfo:t,chart:r,document:n,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}function bm(e){var t=e.chart,r=e.selectionInfo,n=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(r&&o.includes(r.event)){var l=r.currentComponent;r.previousComponent!==l&&(n.clear(),s.forEach((function(e){return t.brush(e).end()})))}}function xm(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;pm({selectionInfo:t,chart:r,document:n,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}var Mm=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=vl(e,["chart","document","selections","selectionInfo"]);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function Sm(e){var t,r=e.lasso;null!=r&&null!==(t=r.active)&&void 0!==t&&t.call(r)&&(null==r||r.action(!1))}function Em(e){var t,r=e.chart,n=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=(a||{}).lasso,c=void 0!==u&&u,d=i.reset,m=void 0===d?Sm:d,f=i.clear,p=!1!==f&&function(e){var t=e.clear,r=void 0===t?Mm:t,n=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:n,selectionInfo:i,chart:o,document:document,cleared:e};return r(gl({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hm(gl(gl({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ym(gl(gl({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gm(gl(gl({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vm(gl(gl({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return bm(gl(gl({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xm(gl(gl({},t),e))}},t))}}({clear:f,selections:s,selectionInfo:n,chart:r}),h=function(e){var t=e.chart,r=e.lasso,n=e.reset,i=e.clear,o=!1,a={deactivated:function(e){n({e:e,lasso:r})},canceled:function(e){n({e:e,lasso:r}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===n&&delete a.deactivated,!1===i&&delete a.cleared,!1===n&&!1===i&&delete a.canceled,a}({chart:r,clear:p,reset:m,lasso:c}),y={};Object.entries(h).forEach((function(e){var t=bl(e,2),r=t[0],n=t[1];y[r]=function(e,t){return t?function(r){return t({event:r,defaultFunc:e})}:e}(n,l[r])}));var g=function(e){var t=e.selectionEvents,r=e.selections,n=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:r,selectionInfo:n,chart:o,document:a},u=function(e){return Object.assign(n,e||{})},c=function(e){var t=e.event,r=e.components;return function(){return function(e){var t=e.selectionInfo,r=e.clear,n=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(gl(gl({},void 0===t?{}:t),{},{event:n,components:o.map((function(e){return e.key})).filter(Boolean)})),r()}({event:t,components:r,clear:i,chart:o,selectionInfo:n,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(gl(gl({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:n,clear:p,chart:r,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",g),Object.entries(y).forEach((function(e){var t=bl(e,2),r=t[0],n=t[1];null==s||s.on(r,n)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",g),Object.entries(y).forEach((function(e){var t=bl(e,2),r=t[0],n=t[1];null==s||s.removeListener(r,n)}))}}var Cm=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function qm(e){var t=e.chart,r=e.actions,n=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=(c=void 0===c?{}:c).clear,m=c.reset,f=o.selectionEvents,p=void 0===f?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:f,h=o.brushEvents,y=void 0===h?{}:h,g=o.brushName,v=void 0===g?"selection":g,b=o.brushMaxListeners,x=void 0===b?20:b,M=o.brushRanges,S=void 0!==M&&M,E=o.interceptors,C=void 0===E?{}:E,q=o.selectionsFn,O=void 0===q?i.selections:q,A=t.brush(v);if("number"==typeof x&&A.setMaxListeners(x),S){var D=!0===S?Cm:S;A.configure({ranges:D})}var N={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,singleSelectDims:[],selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.selections,n=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!r)return{layout:function(){},allowSimultaneous:function(){},release:function(){}};var u=++sm,c=null,d=[],m={};r.on=r.on.bind(r),r.isActive=r.isActive.bind(r),r.addListener=r.addListener.bind(r),r.removeListener=r.removeListener.bind(r);var f=om({brush:n,getConfig:function(){return{layout:c,allowSimultaneous:d}}}),p=f.rangeInterceptor,h=f.interceptor;n.intercept("set-ranges",p),n.intercept("toggle-ranges",p),n.intercept("toggle-values",h),n.intercept("set-values",h),n.intercept("add-values",h),n.on("start",(function(){return r.begin(l)}));var y={activate:function(){},deactivated:function(){return n.end()},cleared:function(){return n.clear()},canceled:function(){return n.end()}};dm(r,y);var g=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;n.start(),"function"==typeof o.select.getBrushOptions&&(m=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){a(n,m,c).forEach((function(e){fm(e,o.select.brushSelectionIncludeMax,g),r.select(e)}))}))):n.on("update",(function(){a(n,m,c).forEach((function(e){return r.select(e)}))})),0===am.length&&um(),am.push({key:u,selections:r}),{layout:function(e){c=e},allowSimultaneous:function(e){d=e},release:function(){c=null;var e=am.indexOf(am.filter((function(e){return e.key===u}))[0]);-1!==e&&am.splice(e,1),am.length||cm(),mm(r,y)}}}({brush:A,majorScale:u,actions:r,selections:n,picassoQ:i,selectionsFn:O});!function(e){var t=e.brush,r=e.interceptors,n=void 0===r?{}:r;Object.entries(n).forEach((function(e){var r=bl(e,2),n=r[0],i=r[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(n,e)}))}))}({brush:A,interceptors:C});var T=function(e){var t=e.chart,r=e.selectionActions,n=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,r=e.chart,n=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=bl(e,2),o=i[0],a=i[1],s=function(){return a({chart:r,selectionInfo:n})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var r=bl(e,2),n=r[0],i=r[1];t.removeListener(n,i)}))}}({brush:n,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=Em({chart:t,selectionInfo:o,selectionActions:r,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var r=!1,n=function(e){r||"Shift"!==e.key||(t.lasso.action(!0),r=!0)},i=function(e){"Shift"===e.key&&(t.lasso.action(!1),r=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:A,actions:r,selections:n,selectionInfo:N.selectionInfo,selectionActions:{clear:d,reset:m},selectionEvents:p,brushEvents:y});if(s){var w=!0===s?xl(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;I.allowSimultaneous(w)}return{unbindEvents:T,state:N,picassoSelections:I,brush:A}}function Om(e){var t=e.chart,r=e.selections,n=e.actions,i=void 0!==n&&n,o=e.config,a=void 0===o?{}:o,s=qm({chart:t,actions:i,selections:r,picassoQ:tm,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,m=a.custom,f=void 0===m?{}:m,p=a.legendAlias,h=void 0===p?void 0:p,y=a.setBrushAliases,g=void 0===y?im:y;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==r||null===(t=r.isLocked)||void 0===t?void 0:t.call(r))&&void 0!==e?e:nm(n)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,r,n,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(r=null==a?void 0:a.qHyperCube)&&void 0!==r?r:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return rm({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,r=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,n=void 0===r?[]:r;return null!==(t=n.map((function(e,t){var r;return!(e.qLocked||(null===(r=e.qCardinalities)||void 0===r?void 0:r.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(n.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(n=u[0])||void 0===n||!n.qLocked),s}({selections:r,picassoSelections:c,layout:e});Object.assign(u,t)},setBrushAliases:function(e){var t=e.colorField,r=e.useLegendCube,n=void 0!==r&&r,i=vl(e,["colorField","useLegendCube"]),o=gl({useLegendCube:n,colorField:t,brush:d,legendAlias:h},i);g(gl(gl({},o),{},{defaultFunc:function(){return im(o)}}))},destroy:function(){l(),c.release()},custom:gl({},f)}}var Am="QlikView Sans, sans-serif",Dm="#737373",Nm="#cccccc",Im="#e6e6e6";function Tm(e){var t={};return[].concat(xl(e),xl([["","","color"],["object","axis.title","fontFamily",Am],["object","axis.title","fontSize","13px"],["object","axis.title","color"],["object","axis.label.name","fontFamily",Am],["object","axis.label.name","fontSize","12px"],["object","axis.label.name","color","#595959"],["object","axis.line.major","color",Nm],["object","axis.line.minor","color",Im],["object","grid.line.major","color",Nm],["object","grid.line.minor","color",Im],["object","grid.line.highContrast","color",Im],["object","referenceLine.label.name","fontFamily",Am],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.label.name","color","#333333"],["object","referenceLine.outOfBounds","fontFamily",Am],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","color",Im],["object","referenceLine.outOfBounds","backgroundColor",Dm,function(e){return"transparent"===e?Dm:e}]])).reduce((function(e,r){var n="".concat(r[0],"-").concat(r[1],"-").concat(r[2],"}");return t[n]||(t[n]=!0,e.push(r)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}function wm(e,t){var r={};return e.forEach((function(e){var n=bl(e,5),i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],u=(void 0===l?function(e){return e}:l)(function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(!e||!1===t)return i;var o=e.getStyle(t,r,n);return void 0===o?i:o}(t,i,o,a,s));nc(r,[o,a].filter(Boolean).join("."),u)})),r}const Lm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Rm({chart:e,models:t,viewState:r,viewCache:n,axis:i}){const o=ic(),{dockService:a}=t;return({data:t})=>(({items:t})=>{const{rect:r}=e.component(`${ea.COMPONENT.BAR}-${i}`)||{};return(!t.length||!r)&&2})(t)||(()=>{const{min:e,max:t}=r.get("zoom");return o.get([e,t])||o.empty()&&!1})()||(()=>{const e=Lm[a.meta.chart.mode];return 0===Math.abs(n.get("continuousMax")-n.get("continuousMin"))&&e})()||(()=>{const{min:e,max:t}=r.get("zoom"),i=Math.abs(n.get("continuousMax")-n.get("continuousMin")),s=Math.abs(t-e),l=Lm[a.meta.chart.mode],u=function(e,t,r){return e*(1-r)+t*r}(2,l,1-Math.min(s/i/.2,1));return o.set([e,t],Math.max(2,Math.min(l,u)))})()}const km=({isContinuous:e,isBarSeriesGrouped:t,styleModel:r,discreteModel:n,isBarSeriesStackedInBothAxis:i})=>e?1:r.query.bar.getHasStyling()?r.query.bar.getHasStrokeWidth()?function(){const e=r.query.bar.getStrokeWidth()/n.query.getItemSize(),t=r.query.bar.getWidthFn()(),i=t+e;return i>1?t-(i-1):t}:r.query.bar.getWidthFn():t||i?.9:.7;function Pm(e){return Math.min(Math.max(0,e),1)}const jm=({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c,primaryExtremumModel:d,secondaryExtremumModel:m}=t,{isContinuous:f,isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:y}=o.meta,g=e=>e.datum.start?e.datum.start.value:e.scale.min(),v=i?ra.PRIMARY:ra.SECONDARY,b=i?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY;if(!(i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount))return!1;const x=p?{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return Pm(e.scale(t))}},end:{ref:"end",fn:e=>{const t=(e=>e.datum.end?e.datum.end.value:g(e))(e);return Pm(e.scale(t))}}}:{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return Pm(e.scale(t))}},end:{ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?g(e):e.datum.end.value;return Pm(e.scale(r))}}},M=(i?d:m).query.getExtrema(),S=p?({start:e,end:t})=>il(e.value,t.value,M):({end:e})=>sl(e.value,M);return{type:"box",key:`${ea.COMPONENT.BAR}-${v}`,data:{filter:(()=>{if(p)return;const e=l.query.series(ta.BAR).filter((e=>e.isPrimary===i)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:p?i?ea.COLLECTION.STACKED_PRIMARY:ea.COLLECTION.STACKED_SECONDARY:i?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY},preferredSize:f?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,settings:{orientation:a.meta.minor.orientation,major:{scale:ea.SCALE.MAJOR,fn:Ns({layoutService:o,axis:v}),ref:f?{start:"major",end:"major"}:void 0},minor:x,box:{width:km({isContinuous:f,isBarSeriesGrouped:h,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:y}),minWidthPx:f?Rm({chart:e,models:t,viewState:r,viewCache:n,axis:v}):void 0,fill:s.getColor(),strokeWidth:u.query.bar.getStrokeWidth(),stroke:u.query.bar.getStrokeColor(),minHeightPx:.3,opacity:e=>{var t,r;return!0===(null===(t=e.datum)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)||S(e.datum)?0:1}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:Ts({layoutService:o,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:Es}}})}},Fm=({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c}=t,{isBarSeriesStacked:d,isContinuous:m,isBarSeriesGrouped:f,isBarSeriesStackedInBothAxis:p}=o.meta,h=i?ra.PRIMARY:ra.SECONDARY,y=i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount;if(!d||0===y)return!1;return{key:`${ea.COMPONENT.STACK_BAR}-${h}`,type:"box",data:{collection:i?ea.COLLECTION.STACKED_TOTAL_PRIMARY:ea.COLLECTION.STACKED_TOTAL_SECONDARY},settings:{major:{scale:ea.SCALE.MAJOR,fn:Ns({layoutService:o,axis:h}),ref:m?{start:"timeStart",end:"timeEnd"}:void 0},minor:{scale:i?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:a.meta.minor.orientation,box:{width:km({isContinuous:m,isBarSeriesGrouped:f,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:p}),minWidthPx:m?Rm({chart:e,models:t,viewState:r,viewCache:n,axis:h}):2,opacity:0,fill:s.getColor()},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function Vm({style:e,simplifiedPlacement:t}){return r=>lt.isDark(t.background?t.background.fill:r.node.attrs.fill)?e.lightColor:e.darkColor}function _m(e,t){const r="horizontal"===e.dockService.meta.major.orientation;return{placements:t.simplifiedPlacements.map((e=>function({simplifiedPlacement:e,style:t,isHorizontal:r}){const n=e.padding||{left:r?0:4,right:r?0:4,top:r?4:0,bottom:r?4:0};return{position:e.position,justify:e.justify,fill:e.onBackground?t.color:Vm({style:t,simplifiedPlacement:e}),overflow:e.overflow,background:e.background,padding:n}}({simplifiedPlacement:e,style:t.style,isHorizontal:r}))),label:t.label}}function zm(e,t,r,n){const i=function(e,t){return function(e,t){if(t&&0===e){const{min:e,max:r}=t;return 0===r&&0===e?1:r<=0?-1:e>=0||r>=-e?1:-1}return e>=0?1:-1}(e,t)}(e,n);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!r||i<0&&r?"right":"left"),o}const Hm=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:r,isContinuous:n}=t;return!r||!n},$m=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:r,isContinuous:n}=t;return!!r&&(!!n||!1!==e)};function Bm(e,t,r,n){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:n}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:r}),i}const Um=({models:e,environment:t,isPrimary:r})=>{const{layoutService:n,seriesModel:i}=e,{meta:o}=n,a="rtl"===t.options.direction,s=e.themeService.getStyles(),l=e.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),u=r?ra.PRIMARY:ra.SECONDARY;if(!(r?i.meta.primaryBarSeriesCount:i.meta.secondaryBarSeriesCount)||!Hm(l,o))return!1;let c;!o.isBarSeriesStacked&&(c=o.isBarSeriesStacked?1:0);const d={label:e=>Xs(e.data,e),simplifiedPlacements:Bm(c,0===c?1:0,o.isBarSeriesStacked?.5:1,o.isContinuous),style:s.label.value},m=[_m(e,d)],f=[{component:`${ea.COMPONENT.BAR}-${u}`,selector:"rect",strategy:{type:"bar",settings:{direction:t=>zm(t.data.end.value,e.dockService.meta.minor.orientation,a,0),labels:m,fontSize:s.label.value.numFontSize,fontFamily:s.label.value.fontFamily}}}];return{type:"labels",key:`${ea.COMPONENT.BAR_LABEL}-${u}`,layout:{minimumLayoutMode:xs.VALUE_LABEL},settings:{sources:f}}};function Ym(e,t,r){const n=[{position:e,onBackground:!0,justify:0,overflow:r}];return t&&n.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:{fill:"#cce6e6e6",padding:{left:2,right:2,top:2,bottom:2}}}),n}function Wm({chart:e,models:t,environment:r,isPrimary:n}){const{meta:i}=t.layoutService,o="rtl"===r.options.direction,a=t.themeService.getStyles(),s=t.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),l=n?ra.PRIMARY:ra.SECONDARY;if(0===(n?t.seriesModel.meta.primaryBarSeriesCount:t.seriesModel.meta.secondaryBarSeriesCount)||!$m(s,i))return!1;const u=e.formatter(n?ea.FORMATTER.PRIMARY:ea.FORMATTER.SECONDARY)||(e=>e),c=e=>0===e?"":u(e),d={label:e=>c(e.data.sumOfPositives.value),simplifiedPlacements:Ym("outside",true,i.isContinuous),style:a.label.value},m={label:e=>c(e.data.sumOfNegatives.value),simplifiedPlacements:Ym("opposite",true,i.isContinuous),style:a.label.value},f=[_m(t,d),_m(t,m)];return{type:"labels",key:`${ea.COMPONENT.STACK_BAR_LABEL}-${l}`,layout:{displayOrder:2,minimumLayoutMode:xs.VALUE_LABEL},settings:{sources:[{component:`${ea.COMPONENT.STACK_BAR}-${l}`,selector:"rect",strategy:{type:"bar",settings:{direction:e=>zm(e.data.sumOfPositives.value,t.dockService.meta.minor.orientation,o),labels:f,fontSize:a.label.value.numFontSize,fontFamily:a.label.value.fontFamily}}}]}}}var Gm=Object.freeze({__proto__:null,hasMaxHat:function(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n&&n>0},hasMinHat:function(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n&&n<0}});const Km={min:"Min",max:"Max"};function Xm({chart:e,models:t,type:r,viewCache:n,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,styleModel:c,discreteModel:d}=t,{isBarSeriesStacked:m,isContinuous:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h}=a.meta,y=m?Fm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}):jm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}),g=o?l.query.getExtrema():u.query.getExtrema(),v=r===ws,b=o?ra.PRIMARY:ra.SECONDARY;if(!y)return!1;if(function(e,t){return!e.meta["hasExplicit"+Km[t]]}(g,r)||function(e,t,r){const n=r?e.implicit.bar.max:e.implicit.bar.min,i=Number(n.toFixed(13));return!Gm[`has${Km[t]}Hat`](i,e)}(g,r,v)||function(e,t,r){const n=r?e=>e<0:e=>e>0;return e.meta["hasExplicit"+Km[t]]&&n(e.explicit[t])}(g,r,v))return!1;let x="end";m&&(x=v?"sumOfPositives":"sumOfNegatives");const M=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.scale(o?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY)[r]()));const S=(({chart:e,type:t,isPrimary:r,dock:n})=>{let i=n;const o=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),a=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`);return o&&a&&(i=r?n:`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),i})({chart:e,type:r,isPrimary:o,dock:v?s.meta.minor.end:s.meta.minor.start});return{type:"box-sliced-hat",key:`${ea.COMPONENT.SLICED_HAT}-${r}-${b}`,layout:{dock:S},data:y.data,settings:{orientation:y.settings.orientation,major:y.settings.major,minor:y.settings.minor,hat:U({},y.settings.box,{fill:m?"#999":y.settings.box.fill,alignment:1,opacity:1,show:function(e){const t=M(),r=function(e){if("number"!=typeof e)return e;const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e}(e.datum[x].value);return v?r>t:r<t},width:km({isContinuous:f,isBarSeriesGrouped:p,styleModel:c,discreteModel:d,isBarSeriesStackedInBothAxis:h}),strokeWidth:c.query.bar.getStrokeWidth(),stroke:c.query.bar.getStrokeColor()})},brush:Ts({layoutService:a})}}const Jm={min:"Min",max:"Max"},Zm={sumOfPositives:"sumOfNegatives",sumOfNegatives:"sumOfPositives"};function Qm({chart:e,models:t,type:r,viewCache:n,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,themeService:c}=t,{end:d,start:m}=s.meta.minor,{isBarSeriesStacked:f}=a.meta,p=f?Fm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}):jm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}),h=o?l.query.getExtrema():u.query.getExtrema(),y=r===ws?h.implicit.bar.max:h.implicit.bar.min,g=Number(y.toFixed(13)),v=o?ra.PRIMARY:ra.SECONDARY;if(!p)return!1;if(!ul[`is${Jm[r]}OutOfBounds`](g,h))return!1;const b=(({chart:e,type:t,end:r,start:n,isPrimary:i})=>{let o=t===ws?r:n;const a=e.component(ea.COMPONENT.LABEL_SPACE),s=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),l=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`),u=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`),c=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`);return s?o=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`:l?o=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`:u&&c&&!i?o=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`:a&&t===ws&&(o="@"+ea.COMPONENT.LABEL_SPACE),o})({chart:e,type:r,end:d,start:m,isPrimary:o});let x="end";f&&(x=r===ws?"sumOfPositives":"sumOfNegatives");return{type:"box-out-of-bounds",key:`${ea.COMPONENT.BAR_OOB}-${r}-${v}`,layout:{dock:b},data:p.data,settings:{orientation:p.settings.orientation,major:p.settings.major,minor:p.settings.minor,dockValue:le.getDockValue(r===ws?d:m),oob:U({},p.settings.box,{fill:c.getStyles().outOfRange.color,alignment:1,opacity:1,show:function(e){var t;if(!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value))return!1;const n=f&&0===e.datum[x].value,i=ul[`is${Jm[r]}OutOfBounds`](e.datum[x].value,h,r);return(!n||function({type:e,item:t,prop:r,extrema:n}){const i=t.datum[Zm[r]].value;return 0!==i&&ul[`is${Jm[e]}OutOfBounds`](i,n,e)}({type:r,item:e,prop:x,extrema:h}))&&i}})},brush:Ts({layoutService:a})}}function ef(e){return Math.min(Math.max(0,e),1)}const tf=({chart:e,models:t,type:r,isPrimary:n})=>{const{discreteModel:i,styleModel:o,seriesModel:a,layoutService:s}=t;if(!(n?a.meta.primaryBarSeriesCount:a.meta.secondaryBarSeriesCount))return!1;const{isBarSeriesStacked:l,isContinuous:u,isBarSeriesGrouped:c,isBarSeriesStackedInBothAxis:d}=s.meta,m=e.scale(n?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY),f=n?ra.PRIMARY:ra.SECONDARY,p=n?t.primaryExtremumModel.query.getExtrema():t.secondaryExtremumModel.query.getExtrema(),h=r===ws;if(!ll({extrema:p,type:r}))return!1;const y=e=>e.datum.start?e.datum.start.value:e.scale.min(),g=(e,t="end")=>e.datum[t]?e.datum[t].value:y(e);return{type:"box",key:`${ea.COMPONENT.GHOST_BAR_OOB}-${r}-${f}`,data:{filter:(()=>{if(l)return;const e=a.query.series(ta.BAR).filter((e=>e.isPrimary===n)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:l?n?ea.COLLECTION.STACKED_TOTAL_PRIMARY:ea.COLLECTION.STACKED_TOTAL_SECONDARY:n?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY},settings:{orientation:t.dockService.meta.minor.orientation,major:{scale:ea.SCALE.MAJOR,fn:Ns({layoutService:s,axis:f}),ref:u?{start:"major",end:"major"}:void 0},minor:{scale:n?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,start:{ref:"start",fn:e=>{const t=y(e);return ef(e.scale(t))}},end:l?"max"===r?{ref:"sumOfPositives",fn:e=>{const t=g(e,"sumOfPositives");return ef(e.scale(t))}}:{ref:"sumOfNegatives",fn:e=>{const t=g(e,"sumOfNegatives");return ef(e.scale(t))}}:{ref:"end",fn:e=>{const t=g(e);return ef(e.scale(t))}}},box:{width:km({isContinuous:u,isBarSeriesGrouped:c,styleModel:o,discreteModel:i,isBarSeriesStackedInBothAxis:d}),stroke:"transparent",fill:"none",opacity:0,show:e=>{let t="end";l&&(t=h?"sumOfPositives":"sumOfNegatives");const r=e.datum[t]?e.datum[t].value:m.max();return h?r>m.max():r<m.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function rf(e,t,r,n,i){const o=[{position:e,justify:0,overflow:r,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&o.push({position:"inside",onBackground:!1,justify:n||i?0:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}const nf=({chart:e,models:t,type:r,environment:n,isPrimary:i})=>{const{layoutService:o,dockService:a,primaryExtremumModel:s,secondaryExtremumModel:l,themeService:u,seriesModel:c}=t,d=u.getStyles(),{meta:m}=o,{isBarSeriesStacked:f}=m,p=e.formatter(i?ea.FORMATTER.PRIMARY:ea.FORMATTER.SECONDARY),h=o.getLayoutValue("dataPoint.showBarLabels",!1),y="horizontal"===a.meta.major.orientation,g="rtl"===n.options.direction;if(!(i?c.meta.primaryBarSeriesCount:c.meta.secondaryBarSeriesCount)||!f&&!Hm(h,m)||f&&!$m(h,m))return!1;const v=i?s.query.getExtrema():l.query.getExtrema();if(!v.meta.hasExplicit)return!1;const b=r===ws?v.implicit.bar.max:v.implicit.bar.min;if(!(r===ws?ol(b,v):al(b,v)))return!1;let x=e=>Xs(e.data,e);m.isBarSeriesStacked&&(x=r===ws?function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(ol(e.data.sumOfPositives.value,v)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value;return p?p(t):t}return""}:function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(al(e.data.sumOfNegatives.value,v)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value;return p?p(t):t}return""});const M={label:x,simplifiedPlacements:rf("outside",true,m.isContinuous,y,g),style:d.label.value},S={label:x,simplifiedPlacements:rf("opposite",true,m.isContinuous,y,g),style:d.label.value},E=[_m(t,M),_m(t,S)],C=i?ra.PRIMARY:ra.SECONDARY,q="horizontal"===a.meta.major.orientation?"down":"right",O=[{component:`${ea.COMPONENT.GHOST_BAR_OOB}-${r}-${C}`,selector:"rect",strategy:{type:"bar",settings:{direction:q,labels:E,fontSize:d.label.value.numFontSize,fontFamily:d.label.value.fontFamily}}}];return{key:`${ea.COMPONENT.BAR_OOB_LABEL}-${r}-${C}`,type:"labels",layout:{minimumLayoutMode:xs.VALUE_LABEL},settings:{sources:O}}},of=({chart:e,models:t,viewState:r,viewCache:n})=>[jm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),jm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1})],af=({chart:e,models:t,viewState:r,viewCache:n})=>[Fm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),Fm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1})],sf=({chart:e,models:t,environment:r})=>{const{isBarSeriesStacked:n}=t.layoutService.meta;if(n){return[Wm({chart:e,models:t,environment:r,isPrimary:!0}),Wm({chart:e,models:t,environment:r,isPrimary:!1})]}return[Um({models:t,environment:r,isPrimary:!0}),Um({models:t,environment:r,isPrimary:!1})]},lf=({chart:e,models:t,viewCache:r,viewState:n})=>[Xm({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!0}),Xm({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!0}),Xm({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!1}),Xm({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!1})],uf=({chart:e,models:t,viewCache:r,viewState:n})=>[Qm({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!0}),Qm({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!0}),Qm({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!1}),Qm({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!1})],cf=({chart:e,models:t})=>[tf({chart:e,models:t,type:"max",isPrimary:!0}),tf({chart:e,models:t,type:"min",isPrimary:!0}),tf({chart:e,models:t,type:"max",isPrimary:!1}),tf({chart:e,models:t,type:"min",isPrimary:!1})],df=({chart:e,models:t,environment:r})=>[nf({chart:e,models:t,type:"max",environment:r,isPrimary:!0}),nf({chart:e,models:t,type:"min",environment:r,isPrimary:!0}),nf({chart:e,models:t,type:"max",environment:r,isPrimary:!1}),nf({chart:e,models:t,type:"min",environment:r,isPrimary:!1})],mf=({chart:e,environment:t,models:r,viewState:n,viewCache:i})=>{const{seriesModel:o}=r,a=o.query.series(ta.BAR).slice(-1),s=o.query.series(ta.LINE),l=o.query.series(ta.MARKER);return[...of({chart:e,models:r,viewState:n,viewCache:i}),...af({chart:e,models:r,viewState:n,viewCache:i}),...s.map((e=>Bs({models:r,environment:t,series:e}))),...s.map((e=>Ks({models:r,series:e,environment:t}))),...l.map((n=>zs({chart:e,models:r,series:n,environment:t}))),...s.map((n=>Js({chart:e,models:r,environment:t,series:n,lineSeries:s}))),...sf({chart:e,models:r,environment:t}),...lf({chart:e,models:r,viewCache:i,viewState:n}),...uf({chart:e,models:r,viewCache:i,viewState:n}),...cf({chart:e,models:r}),...df({chart:e,models:r,environment:t}),dl({chart:e,models:r,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"max"}),dl({chart:e,models:r,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"min"}),el({chart:e,models:r,environment:t,lineSeries:s})]},ff=0,pf=1,hf=3;function yf({models:e}){const{dockService:t,seriesModel:r,layoutService:n,themeService:i}=e,{auto:o,spacing:a}=n.getLayoutValue("gridLine",{});if(!o&&a===ff)return!1;const s=i.getStyles(),l=r.meta.primarySeries.length>0;return{key:ea.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:xs.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!o&&a===pf)||((e,t)=>t%2==0),stroke:s.grid.line.major.color},minorTicks:{show:!o&&a===hf,stroke:s.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:l?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY}}function gf({models:e}){const{primaryExtremumModel:t,primaryTickModel:r,themeService:n,dockService:i,seriesModel:o}=e,a=t.query.getExtrema();return!!(o.meta.primarySeries.length>0&&a.meta.includesZero)&&{key:ea.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:xs.GRID_LINE},show:()=>r.query.getMin()<=0&&r.query.getMax()>=0,lines:{["horizontal"===i.meta.minor.orientation?"x":"y"]:[{value:0,scale:ea.SCALE.MINOR.PRIMARY,line:{stroke:n.getStyles().grid.line.highContrast.color}}]}}}function vf({models:e}){const{layoutService:t,themeService:r}=e,{isContinuous:n,isTime:i}=t.meta;if(!n)return[];const o=r.getStyles(),a={type:"grid-line",layout:{minimumLayoutMode:xs.GRID_LINE},ticks:{stroke:o.grid.line.major.color},minorTicks:{show:!1,stroke:o.grid.line.minor.color}};return i?[U(!0,{},a,{key:"time-inner-grid",x:{scale:ea.SCALE.MAJOR_INNER},ticks:{stroke:o.grid.line.minor.color}}),U(!0,{},a,{key:"time-outer-grid",x:{scale:ea.SCALE.MAJOR}})]:[U(!0,{},a,{key:"continuous-grid",x:{scale:ea.SCALE.MAJOR},minorTicks:{show:!0}})]}function bf({models:e}){return[yf({models:e}),gf({models:e}),...vf({models:e})]}function xf({models:e,environment:t,actions:r}){const{layoutService:n,dockService:i,propertiesModel:o,appModel:a,genericObjectModel:s,themeService:l}=e,u=o.query.getProperties(),c=n.getLayoutValue("dimensionAxis");if(!c)return!1;const{show:d}=c;if("all"!==d&&"title"!==d)return!1;const{orientation:m}=i.meta.major,f=l.getStyles();return{type:"data-title",key:ea.COMPONENT.AXIS_TITLE.MAJOR,layout:{dock:i.meta.major.dock,minimumLayoutMode:xs.AXIS_TITLE.MAJOR[m.toUpperCase()]},settings:{hyperCube:n.getHyperCube(),hyperCubeDef:u&&u.qHyperCubeDef,isDimension:!0,disabled:()=>!r.interact.enabled(),model:s,app:a,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0},style:{fontFamily:f.axis.title.fontFamily,fontSize:f.axis.title.fontSize,color:f.axis.title.color}}}const Mf=(e,t,r)=>e.query.seriesByAxis(r).map((e=>({...t[e.refIndex],explicitColumn:e.refIndex})));function Sf({models:e,environment:t,actions:r}){const{layoutService:n,dockService:i,seriesModel:o,propertiesModel:a,appModel:s,genericObjectModel:l,themeService:u}=e,c=a.query.getProperties(),d=n.getLayoutValue("measureAxes");if(!d||!d.length)return!1;const m=u.getStyles(),{measureAxes:f}=o.meta;return f.filter((e=>e.isPrimary?"all"===d[0].show||"title"===d[0].show:"all"===d[1].show||"title"===d[1].show)).map((e=>{const a=n.getHyperCube(),{isPrimary:u}=e,d=o.query.seriesByAxis(u).length>1,f={type:"data-title",key:u?ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY:ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,layout:{dock:u?i.meta.minor.dock:i.meta.minorSecondary.dock,minimumLayoutMode:xs.AXIS_TITLE.MINOR},settings:{hyperCube:a,hyperCubeDef:c&&c.qHyperCubeDef,isDimension:!1,explicitItemInfos:Mf(o,a.qMeasureInfo,u),onChangeToAlternative:({oldItem:e,newItem:t})=>{t.qDef.series=e.qDef.series;const r=e.qAttributeExpressions.findIndex((e=>"colorByExpression"===e.id));if(-1!==r){const n=e.qAttributeExpressions.splice(r,1)[0];t.qAttributeExpressions.unshift(n)}},disabled:()=>!r.interact.enabled(),model:l,app:s,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0,skipAttributeExpressions:!0},style:{fontFamily:m.axis.title.fontFamily,fontSize:m.axis.title.fontSize,color:m.axis.title.color}};return d&&(f.settings.padding="0",f.settings.minWidth="auto"),f}))}function Ef({models:e,environment:t,actions:r}){return[xf({models:e,environment:t,actions:r}),...Sf({models:e,environment:t,actions:r})]}function Cf({models:e,environment:t,viewState:r,viewCache:n}){const{discreteModel:i,layoutService:o,dockService:a,continuousModel:s,themeService:l}=e,{isSnapshot:u,isDiscrete:c,isContinuous:d}=o.meta,m="rtl"===t.options.direction;return!(u&&!d)&&function({layoutService:e,dockService:t,discrete:r,continuousDataModel:n,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Na({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,f={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?n.getDimensionCardinality()>1:r.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Aa({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(f.settings.style="slim",f.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(f.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(f.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&&(f.settings.injections=()=>[Oa({layoutService:e,discrete:r})]),f}({viewState:r,viewCache:n,discrete:i,continuousDataModel:s,layoutService:o,dockService:a,themeService:l,rtl:m,scrollbarOverride:{predicate:()=>c,value:qa.OPTIONS.BAR.value},deviceType:t.deviceType})}function qf({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i}){const{layoutService:o}=t,a=jm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i});if(!a)return!1;const s=i?ra.PRIMARY:ra.SECONDARY;return a.key=`${ea.COMPONENT.MINI_CHART.BAR}-${s}`,a.data.collection=o.meta.isBarSeriesStacked?i?ea.COLLECTION.REDUCED_STACKED_PRIMARY:ea.COLLECTION.REDUCED_STACKED_SECONDARY:i?ea.COLLECTION.REDUCED_PRIMARY:ea.COLLECTION.REDUCED_SECONDARY,a.settings.box.minWidthPx=void 0,a.settings.minor.scale=i?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,a.settings.major.scale=ea.SCALE.REDUCED,a.layout={dock:"@scrollbar"},a}function Of({environment:e,models:t}){const r=t.styleModel.query.line.getStrokeDasharrayFn();return t.seriesModel.query.series(ta.LINE).map((n=>{const i=Bs({models:t,environment:e,series:n});return i.key=ks(ea.COMPONENT.MINI_CHART.LINE,n),i.data.collection=ea.COLLECTION.REDUCED,i.settings.coordinates.minor.scale=n.isPrimary?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,i.settings.coordinates.major.scale=ea.SCALE.REDUCED,i.settings.layers.line.strokeWidth=1,i.settings.layers.line.strokeDasharray=(...e)=>void 0===r(...e)?void 0:"1, 1",i.layout={dock:"@scrollbar"},i}))}function Af({models:e,environment:t}){return e.seriesModel.query.series(ta.MARKER).map((r=>{const n=zs({models:e,environment:t,series:r});return n.key=ks(ea.COMPONENT.MINI_CHART.MARKER,r),n.data.collection=ea.COLLECTION.REDUCED,n.settings.y.scale=r.isPrimary?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,n.settings.x.scale=ea.SCALE.REDUCED,n.layout={dock:"@scrollbar"},n}))}function Df({chart:e,models:t,viewState:r,viewCache:n,environment:i}){return as(t)?[qf({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),qf({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1}),...Of({environment:i,models:t}),...Af({models:t,environment:i})]:[]}function Nf({models:e,environment:t}){const{type:r}=e.colorService.getSettings();if("categorical"!==r)return!1;const n=de({key:ea.COMPONENT.LEGEND_TOOLTIP,rtl:"rtl"===t.options.direction}),i=e.themeService.getStyles();return U(!0,n,{settings:{filter:e=>function({nodes:e}){return e.filter((e=>e.data&&e.key===ea.COMPONENT.LEGEND_CATEGORICAL))}({nodes:e}),extract:e=>function({context:e}){return[[{content:e.node.data.label,style:{"font-weight":"bold","text-align":"left"},colspan:2}]]}({context:e}),placement:"pointer"},scale:ea.SCALE.COLOR,style:{content:{fontFamily:i.fontFamily}}})}function If({colorSettings:e,nodes:t}){let r=t.filter((e=>e.data[ea.SCALE.COLOR]&&(e=>e.data[ea.SCALE.COLOR].value===e.data.end.value)(e)))[0];return r||(null!=e&&e.field&&([r]=t.filter((t=>{var r,n;return(null===(r=t.data[ea.SCALE.COLOR])||void 0===r||null===(n=r.source)||void 0===n?void 0:n.field)===e.field}))),r||t[0])}const Tf=({models:e,rtl:t})=>{const{detectTextDirection:r}=he,n=e.colorService.getSettings();return function({context:e,nodes:i}){const o=If({colorSettings:n,nodes:i}),a=function({colorSettings:e,context:t,node:r}){const{color:n}=r.data;if("color"===e.type||!n||!e.fieldType)return;const{value:i,label:o}=n,{key:a,field:s}=n.source,{dataset:l}=t.resources,u=l(a).field(s).formatter();if(u&&"measure"===e.fieldType)return Number.isNaN(i)?"-":u(n.value);const c=o||i;return Number.isNaN(c)||"NaN"===c?"-":c}({colorSettings:n,context:e,node:o});if(void 0===a)return!1;const s=function({colorSettings:e,context:t,node:r}){if(e.label)return e.label;const{color:n}=r.data;if("color"!==e.type&&n){const{dataset:e}=t.resources,{key:r,field:i}=n.source;return e(r).field(i).title()}}({colorSettings:n,context:e,node:o}),l=function({node:e}){const{data:t,attrs:r}=e;return t.fillColor?t.fillColor:r&&r.fill?r.fill:void 0}({node:o}),u=e.h("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{label:t?[":",s]:[s,":"],value:t?[a,u]:[u,a],labelDirection:r(s),valueDirection:r(a)}}};function wf({chart:e,models:t,rtl:r,translator:n}){const{detectTextDirection:i}=he,{tooltipModel:o,layoutService:a}=t,s=Tf({models:t,rtl:r}),l=function({rtl:e}){const{detectTextDirection:t}=he;return function({node:r,dataset:n}){var i,o;const{segment:a,end:s}=r.data,{value:l,label:u,source:c}=a||s,{key:d,field:m}=c,f=n(d).field(m),p=f.title();let h;return h=f.raw().isCustomFormatted?u:""===l||Number.isNaN(l)||!0===(null===(i=r.data)||void 0===i||null===(o=i.null)||void 0===o?void 0:o.value)?"-":f.formatter()(l),{label:e?[":",p]:[p,":"],value:h,labelDirection:t(p),valueDirection:t(l)}}}({rtl:r});return function({context:t}){const u=t.node.childrenNodes,{data:c}=u[0],{dataset:d}=t.resources,m=c.label,f=s({context:t,nodes:u}),p={dataId:c.value,title:{label:m,direction:i(m)},color:f},h=u.map((t=>l({chart:e,node:t,dataset:d}))).filter(((e,t,r)=>t===r.findIndex((t=>t.label[0]===e.label[0]&&t.value===e.value))));if(p.measures=f?h.filter((e=>e.label[0]!==f.label[0]||e.value!==f.value[1])):h,o.query.useCustomTooltip()){var y,g;const e=a.getLayout();e.tooltip.hideBasic&&(p.measures=[],p.color=void 0);const{customTooltipInfoAttrExpsArr:s,customTooltipAttrExpsArr:l}=xa({nodes:[u[0]],layout:e,dataset:d});if([p.customTitle]=s.filter((e=>e.id===ia.CUSTOM.TITLE)).map((e=>{const t=e;return t.direction=i(p.customTitle),t})),[p.customDescription]=s.filter((e=>e.id===ia.CUSTOM.DESCRIPTION)).map((e=>{const t=e;return t.direction=i(p.customDescription),t})),p.customMeasures=l.map((e=>{const t=e;return t.label=r?[":",t.label]:[t.label,":"],t.value=""===t.value||"NaN"===t.value?"-":t.value,t.valueDirection=i(e.value),t.labelDirection=i(e.label),e})),null!==(y=(g=o.query).useTooltipChart)&&void 0!==y&&y.call(g))if(o.query.hasChartLimitation()){ma.destroyVisualization({customTooltipModel:o.query.getCustomTooltipModel()});const e=n.get("properties.tooltip.notselectedmessage");p.customLimitation=e}else{const r=ma.createContainer({ctx:t,layout:e});p.customChart=r}let c=[];u.forEach((e=>{var t,r;(null===(t=e.data)||void 0===t||null===(r=t.customTooltipImages)||void 0===r?void 0:r.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(c=e.data.customTooltipImages)})),c.length>0&&(p.customImages=c)}return p}}function Lf(e){return(null==e?void 0:e.type)||ta.BAR}const Rf={circle:"circle",square:"rect",diamond:"path",triangle:"path",bar:"rect"},kf=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`];const Pf=({chart:e,seriesModel:t,value:r})=>{const n=function({value:e,chart:t,seriesModel:r}){const n=r.meta.allSeries,i=[];return n.forEach((r=>{const n=Lf(r);n===ta.BAR?i.push(...t.findShapes("rect").filter((t=>-1!==kf.indexOf(t.key)&&t.data.typeIndex.value===r.typeIndex&&t.data.major.value===e))):n===ta.LINE?i.push(...t.findShapes("circle").filter((t=>t.key===`${ea.COMPONENT.POINT}-${r.id}`&&t.data.major.value===e))):i.push(...t.findShapes(Rf[r.options.marker]).filter((t=>t.key===`${ea.COMPONENT.MARKER}-${r.id}`&&t.data.major.value===e)))})),i}({chart:e,seriesModel:t,value:r});if(0===n.lenght)return null;return{bounds:Qo.combineBounds(n.map((e=>e.bounds))),data:n.map((e=>e.data)),childrenNodes:n,key:n[0].key}},jf=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${ws}`,`${ea.COMPONENT.BAR_OOB}-${Ls}`,`${ea.COMPONENT.BAR_OOB}-${ws}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${Ls}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${ws}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${Ls}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${ws}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}`,`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.SECONDARY}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${ws}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${Ls}`,ea.COMPONENT.AXIS.MAJOR],Ff=({chart:e,models:t,nodes:r})=>{const{seriesModel:n}=t,{pointComponentKeys:i,markerComponentKeys:o}=n.meta,a=[...i,...o],s=[...jf,...a];return r.length?(({chart:e,nodes:t,seriesModel:r})=>{const n=[],i=[];for(let o=0;o<t.length;++o){const{value:a}=t[o].data||{};if(void 0!==a&&-1===i.indexOf(a)){i.push(a);const t=Pf({chart:e,seriesModel:r,value:a});t&&n.push(t)}}return n})({chart:e,nodes:r.filter((e=>(({node:e})=>s.map((t=>-1!==e.key.indexOf(t))).some((e=>!0===e)))({node:e}))),seriesModel:n}):[]};function Vf({chart:e,models:t,environment:r}){const n=t.seriesModel.query.all(),i="rtl"===r.options.direction,{translator:o}=r,{appModel:a,tooltipModel:s,propertiesModel:l}=t,u=null==s?void 0:s.query.getCustomTooltipModel(),c=null==l?void 0:l.query.getProperties(),d=de({key:ea.COMPONENT.TOOLTIP,rtl:i}),m=function({chart:e,models:t,rtl:r,translator:n}){const i=wf({chart:e,models:t,rtl:r,translator:n});return function({context:e}){const t=i({context:e}),{dataId:n,title:o,color:a,measures:s,customTitle:l,customDescription:u,customMeasures:c,customImages:d,customChart:m,customLimitation:f}=t,p={dataId:n,title:[{content:o.label,style:{"font-weight":"bold","text-align":r?"right":"left",direction:o.direction},colspan:2}],color:void 0,measures:[]};return a&&(p.color=[{content:a.label,style:{"text-align":r?"right":"left",direction:a.labelDirection}},{content:a.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:a.valueDirection}}]),p.measures=s.map((e=>[{content:e.label,style:{"text-align":r?"right":"left",direction:e.labelDirection}},{content:e.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:e.valueDirection}}])),(l||u)&&0===c.length&&0===s.length&&(p.title=[]),l&&(p.customTitle=[{content:l.title,style:{"font-weight":"bold","text-align":r?"right":"left",direction:l.direction},colspan:2}]),u&&(p.customDescription=[{content:u.value,style:{"text-align":r?"right":"left",direction:u.direction},colspan:2}]),c&&(p.customMeasures=c.map((e=>[{content:e.label,style:{"text-align":r?"right":"left",direction:e.labelDirection}},{content:e.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:e.valueDirection}}]))),m&&(p.customChart=m),f&&(p.customLimitation=ya.getFooterRow(f,e)),d&&(p.customImages=d.map((t=>ya.getImageRow(t,e)))),p}}({chart:e,models:t,rtl:i,translator:o,series:n});let f=[];return U(!0,d,{settings:{filter:r=>Ff({chart:e,models:t,nodes:r}),extract:e=>{var r,n,i;if(e&&(f=null!==(r=e.node)&&void 0!==r&&r.childrenNodes?[...e.node.childrenNodes]:[e.node],null!==(n=t.layoutService)&&void 0!==n&&null!==(i=n.meta)&&void 0!==i&&i.isContinuous)){const e=[];for(let t=0;t<f.length;t++){var o,a;null!==(o=f[t].data)&&void 0!==o&&null!==(a=o.selectionDimension)&&void 0!==a&&a.value&&(e[t]={data:{value:f[t].data.selectionDimension.value}})}f=e}return m({context:e})},content:({h:e,data:t,style:r})=>{const n=t,{visible:a,hidden:s}=function({sections:e}){const t={visible:[],hidden:[]};return e.reduce(((e,r)=>((e<7?t.visible:t.hidden).push(r),((e,t)=>{const r=void 0===t.color?0:1,{length:n}=t.measures;return e+1+r+n+(t.customLimitation||t.customChart||t.customImages&&t.customImages.length>0?7:0)})(e,r))),0),t}({sections:n}),l=a.reduce(((e,t)=>{const{title:r,color:n,measures:i,customTitle:o,customDescription:a,customMeasures:s,customImages:l,customChart:u,customLimitation:c}=t;return o&&e.push(o),a&&e.push(a),e.push(r),n&&e.push(n),e.push(...i),s&&e.push(...s),u&&e.push(u),c&&e.push(c),l&&e.push(...l),e}),[]);return s.length&&l.push(function({count:e,translator:t,rtl:r}){const{detectTextDirection:n}=he,i=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:i,style:{"font-weight":"bold","text-align":r?"right":"left",direction:n(i)},colspan:2}]}({count:s.length,rtl:i,translator:o})),l.map((t=>e("tr",{},function(e,{h:t,style:r}){return e.map((e=>{const n={style:{...r.cell||{},...e.style||{}},class:e.class};return e.colspan&&(n.colspan=e.colspan),t("td",n,e.content)}))}(t,{h:e,style:r}))))},placement:"bounds",afterShow:()=>{s.query.useTooltipChart()&&s.query.useCustomTooltip()&&!s.query.hasChartLimitation()&&ma.show({app:a,properties:c,selectedNodes:f,customTooltipModel:u,rtl:i})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function _f({chart:e,models:t,environment:r}){return[Nf({models:t,environment:r}),Vf({chart:e,models:t,environment:r})]}function zf({models:e}){const{layoutService:t,dockService:r}=e,{isContinuous:n,isTime:i}=t.meta,o=t.getLayoutValue("dimensionAxis");if(!o||"none"===o.show||"title"===o.show)return[!1];if(!n)return[!1];const a=xs.AXIS.MAJOR[r.meta.major.orientation.toUpperCase()];return i?[{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,scale:ea.SCALE.MAJOR_INNER,layout:{dock:"@"+ea.COMPONENT.AXIS.TIME_INNER,minimumLayoutMode:a}},{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,scale:ea.SCALE.MAJOR,layout:{dock:"@"+ea.COMPONENT.AXIS.TIME_OUTER,minimumLayoutMode:a}}]:[{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,scale:ea.SCALE.MAJOR,layout:{dock:"@"+ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,minimumLayoutMode:a}}]}function Hf({chart:e,models:t,environment:r}){const{refLineModel:n,layoutService:i,colorService:o,dockService:a,themeService:s,appLayoutModel:l,seriesModel:u}=t,c=l.qLocaleInfo,{options:d,theme:m}=r,f="rtl"===d.direction,p=u.query.series(ta.BAR).filter((e=>e.isPrimary)),h=u.query.series(ta.BAR).filter((e=>!e.isPrimary)),y=u.query.series(ta.LINE),g=u.query.series(ta.MARKER),v=u.query.all(),b=v.some((e=>e.isPrimary)),x=v.some((e=>!e.isPrimary)),M=b&&x,S={resolveUIColor:o.getPaletteColor},E=b?Jo({refLineModel:n,layoutService:i,colorModel:S,dock:M?a.meta.minor.dock:a.meta.minor.opposite,scale:ea.SCALE.MINOR.PRIMARY,style:s.getStyles(),formatter:ea.FORMATTER.PRIMARY,theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE_LABEL}):[],C=x?Jo({refLineModel:n,layoutService:i,colorModel:S,dock:M?a.meta.minor.opposite:a.meta.minor.dock,scale:ea.SCALE.MINOR.SECONDARY,style:s.getStyles(),formatter:ea.FORMATTER.SECONDARY,theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE_LABEL,path:"refLine.refLines2"}):[];return[!!b&&Ko({refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MINOR.PRIMARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ea.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE,minimumLayoutMode:xs.REFERENCE_LINE}),!!x&&Ko({refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MINOR.SECONDARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ea.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE,path:"refLine.refLines2",minimumLayoutMode:xs.REFERENCE_LINE}),Ko({isDimension:!0,refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MAJOR,axis:"horizontal"===a.meta.major.orientation?"x":"y",rtl:f,key:ea.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:p.length?`${ea.COMPONENT.BAR}-${ra.PRIMARY}`:h.length?`${ea.COMPONENT.BAR}-${ra.SECONDARY}`:y.length?`${ea.COMPONENT.LINE}-${y[0].id}`:g.length?`${ea.COMPONENT.MARKER}-${g[0].id}`:`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,minimumLayoutMode:xs.REFERENCE_LINE}),...E,...C,...Jo({isDimension:!0,refLineModel:n,layoutService:i,colorModel:S,dock:a.meta.major.opposite,scale:ea.SCALE.MAJOR,style:s.getStyles(),theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function $f(e){return"NaN"===e.qMin&&"NaN"===e.qMax}var Bf=[{key:"NoDataExist",alignment:"center",condition:({layoutService:e})=>{const{x:t,y:r}=e.meta.size;return t*r==0}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>{const{isContinuous:t}=e.meta;if(!t)return!1;const r=e.getHyperCubeValue("qDimensionInfo.0");return r&&(r.qMax<r.qMin||"NaN"===r.qMax)}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>e.getHyperCubeValue("qMeasureInfo").every($f)},{key:"DataRangeIncludingZero",alignment:"bottom",condition:({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n})=>{if(!1===e.getLayout().showDisclaimer&&n.isEnabled("SHOW_DISCLAIMER"))return!1;const i=e.getLayoutValue("measureAxis.logarithmic",!1),o=t.query.getExtrema(),a=r.query.getExtrema();return i&&(o.meta.includesZero||a.meta.includesZero)}}];function Uf({environment:e,models:t}){const{flags:r,translator:n,options:i}=e,{layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=function({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n}){let i,o;for(let a=0,s=Bf.length;a<s;a++){i=Bf[a];try{o=i.condition({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n})}catch(e){throw Error("failing disclaimer condition",e)}if(o)return i}return!1}({layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,flags:r});if(!l)return!1;return function(e,t,r){if(!e)return!1;const{translator:n}=t,{rtl:i}=r;return{key:"disclaimer",type:"disclaimer",layout:{dock:G[e].alignment},settings:{label:n.get("Object.Disclaimer."+e),rtl:i}}}(l.key,{translator:n},{rtl:"rtl"===i.direction})}function Yf({layoutService:e}){return!!as({layoutService:e})&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:ea.SCALE.REDUCED,brush:"selection",fill:"#6CB33F",opacity:.2}}}function Wf({models:e,environment:t}){const{layoutService:r,colorService:n,dockService:i,seriesModel:o,selectionService:a}=e,{hasLineSeries:s,isContinuous:l,hasMultipleMeasures:u,isGroupedByMeasure:c}=r.meta;if(!s)return!1;const{options:d}=t,m=r.getLayoutValue("color",{}),f=e=>e.filter((e=>Lf(e)===ta.LINE)).map((e=>({key:ks(ea.COMPONENT.LINE,e),typeIndex:e.typeIndex}))),p=!m.auto&&"byMeasure"===m.mode&&m.byMeasureDef&&void 0!==m.byMeasureDef.activeMeasureIndex,h=r.getHyperCubeValue("qMeasureInfo").map((e=>{var t;return null===(t=e.color)||void 0===t?void 0:t.on}));return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:ea.COLLECTION.LINE},settings:{getSelectionInfo:()=>{var e;return(null==a||null===(e=a.getSelectionInfo)||void 0===e?void 0:e.call(a))||{}},seriesInfo:{primary:f(o.meta.primarySeries),secondary:f(o.meta.secondarySeries)},selectionValues:{"qHyperCube/qDimensionInfo/0":l?e=>e.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value,"qHyperCube/qMeasureInfo/X":e=>e.end.value},colorSettings:e=>n.getSettingsForMeasure(e),colorByData:e=>!h[e]&&p,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:o.meta.barSeriesCount,orientation:i.meta.major.orientation,rtl:"rtl"===d.direction}}}function Gf({models:{fieldModel:e}}){return{[ea.FORMATTER.PRIMARY]:{data:{fields:e.main.minorsPrimary}},[ea.FORMATTER.SECONDARY]:{data:{fields:e.main.minorsSecondary}}}}function Kf({model:e,layoutService:t,definitionPath:r="/qHyperCubeDef"}){return{fetch(t,n){const i={qStart:t,qEnd:n,qNbrPoints:this.computeNbrOfBins(),qMaxNbrTicks:300,qMaxNumberLines:this.computeMaxNumberLines()};return e.getHyperCubeContinuousData(r,i,!1)},shouldFetchReduced(){const{qHyperCube:e}=t.getLayout();return e.qSize.qcy*e.qMeasureInfo.length>=2e3},computeNbrOfBins(){const{qHyperCube:e}=t.getLayout();if(!this.shouldFetchReduced())return 2e3;let r=e.qMeasureInfo.length||1,n=4+2*(r-1);return e.qDimensionInfo.length>1&&(r=Math.max(1,Math.min(12,t.meta.size.dimensions[1])),n=4),Math.ceil(2e3/(r*n))},computeMaxNumberLines(){const{qHyperCube:e}=t.getLayout();return e.qDimensionInfo.length>1&&!this.shouldFetchReduced()?t.meta.size.dimensions[1]+1:12}}}function Xf(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function Jf({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:r}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:r})},getSnapshotData(){const r=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in r&&"min"in r.zoom&&"max"in r.zoom?function({zoom:e}){return{zoom:e}}(r):function({scrollOffset:e=0,viewRange:t=0},r){let n=r+e,i=n+t;return 1===t&&0===e&&(n=r-.5,i=r+.5),{zoom:{min:n,max:i}}}(r,t.get("continuousMin"))}}}function Zf(){const e=()=>{},t=[],r={};return e.set=(e,n)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),r[e]=n},e.forEach=e=>{t.forEach(((t,n)=>e(r[t],n)))},e.has=e=>e in r,e}function Qf(e,t,r){return r[0]&&r[0][1]&&r[0][1].qElemNumber>-1?function({start:e,end:t,matrix:r}){const n=[],i=Zf(),o=Zf();for(let a=0;a<r.length;a++){const s=r[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&&n.push(s)}return i.forEach(((e,t)=>n.splice(t,0,e))),o.forEach((e=>n.push(e))),n}({start:e,end:t,matrix:r}):function({start:e,end:t,matrix:r}){const n=[];let i,o;for(let a=0;a<r.length;a++){const s=r[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&n.push(s)}return i&&n.unshift(i),o&&n.push(o),n}({start:e,end:t,matrix:r})}function ep(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function tp(e,t,r){const n={qDataPages:(r.qDataPages||[]).map((r=>{const n=Qf(e,t,r.qMatrix),i=ep(r.qArea,n);return{...r,qArea:i,qMatrix:n}}))};return r.qAxisData&&r.qAxisData.qAxis&&(n.qAxisData=function(e,t,r){return{qAxis:r.qAxis.map((r=>({qName:r.qName,qTags:r.qTags,qTicks:r.qTicks.reduce(((r,n)=>((n.qStart>=e&&n.qStart<=t||n.qEnd>=e&&n.qEnd<=t||n.qStart<e&&n.qEnd>t)&&r.push(n),r)),[])})))}}(e,t,r.qAxisData)),n}function rp(e){return e.qIsOtherCell}function np({qDataPages:e=[]}={},t={}){const r=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(rp)){const r=e[0].qElemNumber;t[r]=void 0}})),Object.keys(t).length}(r):function(e){let t=0;return e.forEach((e=>{e.some(rp)||t++})),t}(r)}const ip={command:{processDataPage:()=>{}}};var op={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[,r]=e.domain();for(let e=0;e<t.length;e++){const n=t[e],i=t[e+1];n.data={},i||1===n.end?i?(n.data.start=n.value,n.data.end=i.value,n.end=i.position):(n.data.start=n.value,n.data.end=n.value):(n.data.start=n.value,n.data.end=r,n.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,r=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 n=t[0];r.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],n.data.start]},x:0,y:0,width:n.start*this.rect.width,height:this.rect.height})}return r}};function ap(e,t=1){if(t%2==0)return e;let r=Math.round(e);return e-r>0?r+=.5:r-=.5,r}function sp(e,t){const{localProps:{size:r},props:{anchor:n}}=t,i=function({props:e,localProps:{size:t},style:r,renderer:n}){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=>n.measureText({text:e,fontSize:r.label.fontSize,fontFamily:r.label.fontFamily});return{resolve:(e,n)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=n;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const m={x:c+i,y:i,width:d-2*i,height:t.height-2*i},f=s(l[0]+"…").width,p=Math.max(0,m.width-u.width),h=Math.max(0,m.height-u.height),y=o*p,g=a*h;return{show:m.width>=Math.min(f,u.width),text:l,dx:y,dy:g,rect:m,style:r.label,segment:{x:c+y,width:u.width+2*i}}}}}(t),o=function({localProps:{size:e},style:t,scale:r,props:n}){const[i,o]=r.domain(),a=Math.max(0,Math.min(1,n.guideLine.major.justify));return{resolve:(r,n)=>{const s=a*n.width,l=ap(n.x+s,t.majorGuideLine.strokeWidth);return{show:r.value>=i&&r.value<=o,x1:l,y1:0,x2:l,y2:ap(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine}}}}(t),a=e.map((e=>{const t=function(e,t,r){const n=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[r],0)*t.width,y:0,width:n,height:t.height}}(e,r,n);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const r=e.length;if(r<2)return;const n=e[r-1],i=t[r-1].label;if(n&&n.start===n.end)for(let e=r-2;e>-1;e--){const r=t[e].label;r.show=r.show&&(o=r.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 lp(e,t){const r=function({localProps:{size:e},props:t,style:r}){return{resolve:n=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=ap(n.position*e.width,r.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:ap(i,r.minorGuideLine.strokeWidth),x2:o,y2:ap(t.guideLine.minor.size+i,r.minorGuideLine.strokeWidth),style:r.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(r.resolve):[]}function up(e){return e.filter((e=>e.show)).map((e=>U({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2})))}var cp={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}),r=t.filter((e=>!e.isMinor)),n=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:r}){const n=ap(1,t.line.strokeWidth);return{show:r.line.show,x1:ap(0,t.line.strokeWidth),y1:n,x2:ap(e.width,t.line.strokeWidth),y2:n,style:t.line}}(this),this.state.major=sp(r,this),this.state.minor=lp(n,this)},render(){return[...up([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>U({},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"})))),...up(this.state.major.map((e=>e.guideLine))),...up(this.state.minor.map((e=>e.guideLine)))];var e}};function dp(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,r)=>e.qStart===t.qTicks[r].qStart&&e.qEnd===t.qTicks[r].qEnd))}function mp(e){return e.qTags.indexOf("$qualified")>-1}function fp({qAxis:e}){const t=[],r=[];for(let n=0;n<e.length;n++){const i=n+1,o=e[n],a=e[i];dp(o,a)?(mp(a)?(t.push(i),r.push(n)):(t.push(n),r.push(i)),n++):(t.push(n),r.push(n))}return{qualified:t,nonQualified:r}}function pp({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(r){let n,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(r)){const e=t[l+1];if(i=u.index,n=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(r)){o="auto",s=!0;break}if(e&&e.queries.inner(r)){o=e.index;const n=t[l+2];n&&n.queries.minor(r)&&(a=n.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[n+1];e&&e.queries.minor(r)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function hp({qTicks:e,measureText:t=(()=>({width:0})),cache:r={},scale:n}){const i=r;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(n(e.qStart)-n(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const r=n.clamp();return n.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(n(e.qStart)-n(e.qEnd)),width:t(""+e.qText).width+16}))),n.clamp(r),i.rangeAndWidth}}}function yp({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:r})=>e>r*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:r})=>e>r*t)),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:r=>r>=t*e.count()}}function gp({qualified:e,nonQualified:t,qAxis:r,measureText:n,reqAutoFitWidth:i,scale:o},{attributesFactory:a=hp,queryFactory:s=yp}={attributesFactory:hp,queryFactory:yp}){const l=r.map(((e,t)=>function(e,t){const{qTicks:r}=e,l=a({qTicks:r,measureText:n,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 vp({qAxis:e=[],measureText:t=(()=>({width:0})),cache:r={},reqAutoFitWidth:n=0,scale:i},{metaFactory:o=gp,mapper:a=fp,resolver:s=pp}={metaFactory:gp,mapper:fp,resolver:pp}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:n,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const n=r.key({distance:t});if(r.get(n))return r.get(n);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=m.resolve(t);return r.set(n,i),i}}}function bp(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const xp=bp(0).getTime();function Mp(e){return(e.getTime()-xp)/86400/1e3}var Sp=new Date,Ep=new Date;function Cp(e,t,r,n){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(r){return e(r=new Date(r-1)),t(r,1),e(r),r},i.round=function(e){var t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=function(e,r){return t(e=new Date(+e),null==r?1:Math.floor(r)),e},i.range=function(r,n,o){var a,s=[];if(r=i.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return s;do{s.push(a=new Date(+r)),t(r,o),e(r)}while(a<r&&r<n);return s},i.filter=function(r){return Cp((function(t){if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(i.count=function(t,n){return Sp.setTime(+t),Ep.setTime(+n),e(Sp),e(Ep),Math.floor(r(Sp,Ep))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(n?function(t){return n(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var qp=Cp((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()})),Op=Cp((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()})),Ap=Cp((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()})),Dp=Cp((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 Np(e){return Cp((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}))}var Ip=Np(0);Np(1),Np(2),Np(3),Np(4),Np(5),Np(6);var Tp=Cp((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()})),wp=Cp((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()}));wp.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Cp((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var Lp=wp;const Rp=1,kp=2,Pp=3,jp=4,Fp=5,Vp=6;function _p({timeScale:e,labels:t,distance:r,isDayOrShorter:n,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:r});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,r,n,i,o){function a(e){return Lp.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=qp.count(e,t),l=Op.count(e,t),u=Ap.count(e,t),c=Dp.count(e,t),d=Ip.count(e,t),m=Tp.count(e,t),f=Lp.count(e,t),p=r/n.second.width-1,h=r/n.minute.width-1,y=r/n.date.width-1,g=r/n.year.width-1,v={type:"year",desc:"year",count:f,interval:Lp.every(1),formatter:n.year.formatter,offset:e=>Lp.offset(e,-1),floor:Lp.floor};if(s<=p)v.type=Rp,v.desc="second",v.count=s,v.interval=qp.every(1),v.formatter=n.second.formatter,v.offset=e=>qp.offset(e,-1),v.floor=qp.floor;else if(s/2<=p)v.type=Rp,v.desc="every other second",v.count=s/2,v.interval=qp.every(2),v.formatter=n.second.formatter,v.offset=e=>qp.offset(e,-2),v.floor=qp.floor;else if(s/5<=p)v.type=Rp,v.desc="every 5 second",v.count=s/5,v.interval=qp.every(5),v.formatter=n.second.formatter,v.offset=e=>qp.offset(e,-5),v.floor=qp.floor;else if(s/15<=p)v.type=Rp,v.desc="every 15 second",v.count=s/15,v.interval=qp.every(15),v.formatter=n.second.formatter,v.offset=e=>qp.offset(e,-15),v.floor=qp.floor;else if(s/30<=p)v.type=Rp,v.desc="every 30 second",v.count=s/30,v.interval=qp.every(30),v.formatter=n.second.formatter,v.offset=e=>qp.offset(e,-30),v.floor=qp.floor;else if(l<=h)v.type=kp,v.desc="minute",v.count=l,v.interval=Op.every(1),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-1),v.floor=Op.floor;else if(l/2<=h)v.type=kp,v.desc="every 2 minute",v.count=l/2,v.interval=Op.every(2),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-2),v.floor=Op.floor;else if(l/5<=h)v.type=kp,v.desc="every 5 minute",v.count=l/5,v.interval=Op.every(5),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-5),v.floor=Op.floor;else if(l/10<=h)v.type=kp,v.desc="every 10 minute",v.count=l/10,v.interval=Op.every(10),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-10),v.floor=Op.floor;else if(l/15<=h)v.type=kp,v.desc="every 15 minute",v.count=l/15,v.interval=Op.every(15),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-15),v.floor=Op.floor;else if(l/30<=h)v.type=kp,v.desc="every 30 minute",v.count=l/30,v.interval=Op.every(30),v.formatter=n.minute.formatter,v.offset=e=>Op.offset(e,-30),v.floor=Op.floor;else if(u<=h)v.type=Pp,v.desc="hour",v.count=u,v.interval=Ap.every(1),v.formatter=n.minute.formatter,v.offset=e=>Ap.offset(e,-1),v.floor=Ap.floor;else if(u/2<=h)v.type=Pp,v.desc="every 2 hour",v.count=u/2,v.interval=Ap.every(2),v.formatter=n.minute.formatter,v.offset=e=>Ap.offset(e,-2),v.floor=Ap.floor;else if(u/3<=h)v.type=Pp,v.desc="every 3 hour",v.count=u/3,v.interval=Ap.every(3),v.formatter=n.minute.formatter,v.offset=e=>Ap.offset(e,-3),v.floor=Ap.floor;else if(u/6<=h)v.type=Pp,v.desc="every 6 hour",v.count=u/6,v.interval=Ap.every(6),v.formatter=n.minute.formatter,v.offset=e=>Ap.offset(e,-6),v.floor=Ap.floor;else if(u/12<=h||i)v.type=Pp,v.desc="every 12 hour",v.count=u/12,v.interval=Ap.every(12),v.formatter=n.minute.formatter,v.offset=e=>Ap.offset(e,-12),v.floor=Ap.floor;else if(c<=y)v.type=jp,v.desc="day",v.count=c,v.interval=Dp.every(1),v.formatter=n.date.formatter,v.offset=e=>Dp.offset(e,-1),v.floor=Dp.floor;else if(c/2<=y)v.type=jp,v.desc="every 2 day",v.count=c/2,v.interval=Dp.every(2),v.formatter=n.date.formatter,v.offset=e=>Dp.offset(e,-2),v.floor=Dp.floor;else if(c/3<=y)v.type=jp,v.desc="every 3 day",v.count=c/3,v.interval=Dp.every(3),v.formatter=n.date.formatter,v.offset=e=>Dp.offset(e,-3),v.floor=Dp.floor;else if(d<=y)v.type=jp,v.desc="week",v.count=d,v.interval=Ip.every(1),v.formatter=n.date.formatter,v.offset=e=>Ip.offset(e,-1),v.floor=Dp.floor;else if(d/2<=y)v.type=jp,v.desc="every 2 week",v.count=d/2,v.interval=Ip.every(2),v.formatter=n.date.formatter,v.offset=e=>Ip.offset(e,-2),v.floor=Dp.floor;else if(m<=y)v.type=Fp,v.desc="month",v.count=m,v.interval=Tp.every(1),v.formatter=n.date.formatter,v.offset=e=>Tp.offset(e,-1),v.floor=Dp.floor;else if(m/3<=y)v.type=Fp,v.desc="quarter",v.count=m/3,v.interval=Tp.every(3),v.formatter=n.date.formatter,v.offset=e=>Tp.offset(e,-3),v.floor=Dp.floor;else if(m/6<=y)v.type=Fp,v.desc="half year",v.count=m/6,v.interval=Tp.every(6),v.formatter=n.date.formatter,v.offset=e=>Tp.offset(e,-6),v.floor=Dp.floor;else if(f<=g)v.type=Vp,v.desc="year",v.count=f,v.interval=Lp.every(1),v.formatter=n.year.formatter,v.offset=e=>Lp.offset(e,-1),v.floor=Lp.floor;else if(f/2<=g)v.type=Vp,v.desc="every 2 year",v.count=f/2,v.interval=a(2),v.formatter=n.year.formatter,v.offset=e=>Lp.offset(e,-2),v.floor=Lp.floor;else if(f/5<=g)v.type=Vp,v.desc="every 5 year",v.count=f/5,v.interval=a(5),v.formatter=n.year.formatter,v.offset=e=>Lp.offset(e,-5),v.floor=Lp.floor;else if(f/10<=g)v.type=Vp,v.desc="every 10 year",v.count=f/10,v.interval=a(10),v.formatter=n.year.formatter,v.offset=e=>Lp.offset(e,-10),v.floor=Lp.floor;else{const e=Math.floor(f/g);v.type=Vp,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=n.year.formatter,v.offset=t=>Lp.offset(t,-e),v.floor=Lp.floor}return v}(s,l,r,t.all(),n,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 m=d.map(((e,t,r)=>{const n=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+n),formatter:c.formatter}}));let f=[];if(!o&&c.type<=Pp){const r=t.getFormat("date"),n=e.ticks(Dp.every(1));n.length&&s.getUTCDate()!==n[0].getUTCDate()&&n.unshift(Dp.offset(n[0],-1)),f=(n.length?n:[Dp.floor(s)]).map(((e,t,n)=>{const i=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:r.formatter}}))}return{inner:m,outer:f}}const zp={};function Hp(e,t,r,n){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...r)),formatter:n}}function $p(e,t,r){const{generator:n,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=function(){return gt.apply($i(Cn,En,xn,vn,gn,yn,un,ln,Nn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}().domain([bp(l),bp(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof n?n:{type:n};let m;m="d3"===d.type?(e,i)=>_p({timeScale:c,labels:r,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:bp(n.initialMin)}):e=>function(e,t,r,n,i,o=!1){if(zp[[t,r,n,n,o]])return zp[[t,r,n,n,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=bp(r),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=n-r,m=t/(i-n),f=m/1440,p=m/86400,h=366*m,y=3*m*30,g=a.second.width/p,v=a.minute.width/f,b=a.date.width/y,x=a.year.width/h;let M,S,E,C=0,q=0,O=null,A=null,D=null,N=null,I=null,T=null;const w={outer:[],inner:[]};for(g<1?(O=1,q=1/86400):g<2?(O=2,q=1/86400*2):g<5?(O=5,q=1/86400*5):g<10?(O=10,q=1/86400*10):g<30?(O=30,q=1/86400*30):v<1?(A=1,q=1/1440):v<2?(A=2,q=1/1440*2):v<5?(A=5,q=1/1440*5):v<10?(A=10,q=1/1440*10):v<30?(A=30,q=1/1440*30):v<60?(D=1,q=1/24):v<120?(D=2,q=2/24):v<360?(D=6,q=.25):v<720?(D=12,q=.5):b<1/90?(q=1,N=1):b<2/90?(q=2,N=2):b<7/90?(q=7,N=7):b<31/90?(I=1,q=31):b<1?(I=3,q=90):x<1?(T=1,q=366):x<2?(T=2,q=732):x<5?(T=5,q=1826.25):(T=10,q=3652.5),S=Math.floor((d+r%1)/q);C<i;){E=S+1,M=T?Hp("year",[l+S*T,0,1],[l+E*T,0,1],a.year.formatter):I?Hp("month",[l,u+S*I,1],[l,u+E*I,1],a.date.formatter):N?Hp("day",[l,u,c+S*N],[l,u,c+E*N],a.date.formatter):D?Hp("hour",[l,u,c,0+S*D],[l,u,c,0+E*D],a.minute.formatter):A?Hp("minute",[l,u,c,0,0+S*A],[l,u,c,0,0+E*A],a.minute.formatter):Hp("second",[l,u,c,0,0,0+S*O],[l,u,c,0,0,0+E*O],a.second.formatter),C=Mp(M.start),w.inner.push(M);const e=Math.floor(C);if(!(o||T||I||N)){const t={type:"day",start:bp(e),end:bp(e+1),formatter:a.date.formatter,qStart:e};w.outer[w.outer.length-1]&&w.outer[w.outer.length-1].qStart===t.qStart||w.outer.push(t)}S++}return w.min=n,w.max=i,zp[[t,r,n,n,o]]=w,w}(r,e,d.min,l,u,"T"===s.qType);const f={transform:(t=[],{isMinor:r=!1}={})=>t.map((t=>{let n;n="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();r&&e.clamp(!1);const a=e(n),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:n,position:a,start:s,end:l,label:t.qText,isMinor:r,data:r?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,r)=>m(t,r)[a].map((t=>{let r;return r="start"===i?Mp(t.start):"end"===i?Mp(t.end):(Mp(t.start)+Mp(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:r,label:t.formatter(r),isMinor:!1,data:{start:Mp(t.start),end:Mp(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return f}const Bp=/t+/i;const Up={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 Yp(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 Wp="continuousPan";var Gp={model:function({model:e,layoutService:t,dataProcessorModel:r=ip,viewCache:n,viewState:i,definitionPath:o},a={}){const{engineFetcherFactory:s=Kf,snapshotFetcherFactory:l=Jf,cacheFetcherFactory:u=Xf,cache:c={initial:{},merged:{}}}=a,d=s({model:e,layoutService:t,definitionPath:o}),m=l({layoutService:t,viewCache:n}),f=u({cache:c}),p=e=>{throw e.isHandled=!0,e};let h,y,g;return{update(e){var r,o;({initialMin:y,initialMax:g}=function(e={}){let{qMin:t,qMax:r}=e;return t=Number.isNaN(+t)?0:t,r=Number.isNaN(+r)?0:r,{initialMin:t,initialMax:r}}(e.qHyperCube.qDimensionInfo[0])),n.set("continuousMin",y),n.set("continuousMax",g),n.set("minimiumZoomSpan",(r=y,o=g,Math.max(1e-6,2.3841857910156157e-7*(o-r)))),h=t.meta.isSnapshot?m:d,t.meta.isSnapshot&&({zoom:{min:y,max:g}}=m.getSnapshotData()),i.preventSet("zoom",{min:y,max:g})},updateLayout(e){const{qDataPages:r,qAxisData:n}=e;return t.setHyperCubeValue("qDataPages",r),t.setHyperCubeValue("qAxisData",n),t.setHyperCubeValue("qMode","S"),e},initialFetch(){return h.fetch(y,g).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=ep(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),c.initial=t,c.merged=t,e})).then((e=>tp(y,g,e))).then((e=>this.updateLayout(e))).catch(p)},fetch:(e,t)=>h.fetch(e,t).then((e=>function(e,t){const r={};return r.qDataPages=(e.qDataPages||[]).map(((e,r)=>{const n=function(e,t){if(!t||!t.length||!t[0].length)return e;const r=t[0][0].qNum,n=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<r?i.push(e[t]):a.qNum>n&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[r].qMatrix),i=ep(e.qArea,n);return{...e,qArea:i,qMatrix:n}})),e.qAxisData&&e.qAxisData.qAxis&&(r.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const r=t.qAxis.map((e=>e.qName)),n=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=r.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=n[a];for(let r=0,n=o.qTicks.length;r<n;r++){const n=o.qTicks[r];n.qStart<e?s.push(n):n.qStart>t&&l.push(n)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),r}(c.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),c.merged=e,e))).then((r=>tp(e,t,r))).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then((r=>tp(e,t,r))),fetchMinMaxData:()=>Promise.resolve(c.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return U({},e,{...c.initial})},getInitialLayout(){const e=this.getInitialCube();return U({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>np(c.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e;t.qDataPages=c.merged.qDataPages,t.qAxisData=c.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:r,continuousDataModel:n}=e;function i(e,r,i){return n[e](r,i).then((e=>(n.updateLayout(e),t(),e)))}const o=oc(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:n,max:a})=>!r.meta.isContinuous||e===n&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((r=>(o(e,t),r)))},onZoomIntercept:function({viewCache:e}){let t=NaN,r=NaN,n=NaN;return(i,o)=>(t=e.get("continuousMin"),r=e.get("continuousMax"),n=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<n?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(r,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:r},{threshold:n=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return ac(((e,n)=>{const l=(e=>r.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,r){let{x:n}=e;return n-=t.element.getBoundingClientRect().left,n-=r.rect.x,Math.max(0,Math.min(1,n/r.rect.width))}(e,r,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),f=m-(n>0?.7071067811865475:1.4142135623730951)*m,p=c+f*u,h=d-f*(1-u),y=p<a?a-p:0,g=h>s?h-s:0;t.set("zoom",{min:Math.max(p-g,a),max:Math.min(h+y,s)})}}),n)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:r,viewState:n,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Wp,pointers:1,threshold:10,enable(n,i){return this.started===Wp||!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{continuousPanstart(r){r.preventDefault(),this.started=Wp;const{min:i,max:o}=n.get("zoom");this[Wp]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},continuousPanmove(e){e.preventDefault();const{span:t,min:r,max:o,size:a}=this[Wp],s=-e.deltaX/a;n.set("zoom",{min:Math.min(r+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:op,timeAxis:cp},picassoScales:{time:function e(t,r={}){const n=function(e,t,r){const n={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?n[i]=o(r):"object"!==a||Array.isArray(o)?n[i]="undefined"===a?t[i]:o:n[i]=U(!0,{},t[i],o)})),n}(t,Up,r),{qAxis:i}=n,o=nn(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let r=+e.min,n=+e.max;return Number.isNaN(r)&&Number.isNaN(n)&&Array.isArray(t)&&t.length&&(r=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),n=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),r===n&&(r-=.5,n+=.5),{min:Number.isNaN(+r)?0:r,max:Number.isNaN(+n)?1:n}}(n,i);let u,c,d=[];const m=function(e){return Number.isNaN(+e)?NaN:o(e)};m.ticks=({distance:e,resolve:t=u.resolve}={})=>{const r=t(e),o=r[n.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+r.minor)){const e=c.transform(i[r.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,r.isDayOrShorter)),d},m.invert=e=>o.invert(e),m.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),m.range=e=>Array.isArray(e)?o.range(e):o.range(),m.norm=e=>(Yp(a,m),a.instance(e)),m.normInvert=e=>(Yp(a,m),a.instance.invert(e)),m.copy=()=>e(t,r),m.clamp=(e=!0)=>(o.clamp(e),o.clamp()),m.min=()=>Math.min(s,l),m.max=()=>Math.max(s,l),o.range(n.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=n.invert;const f=function(e){const t={},{measureText:r,fn:n,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&&Bp.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=n(o[e].pattern),o[e].width=Math.max(o[e].width,r(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:r}=t;if(!r)return o.date;const n=bp(t[0].data.start),i=bp(t[r-1].data.start);return Dp.count(n,i)/r>=1?o.date:Ap.count(n,i)/r>0?o.minute:Op.count(n,i)/r>0?o.second:o.date},t}(n);return c=$p(o.copy(),n,f),u=vp({qAxis:i,measureText:n.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:n.cache,scale:m}),m.data=()=>({fields:[{formatter:m.formatter,id:()=>"qHyperCube/"+n.field,key:()=>n.field,raw:rc(r,"fields.0.raw",(()=>({})))}]}),m.formatter=()=>f.getFormatFromTicks(d).formatter,m}}};const Kp=e=>e.meta.seriesComponentKeys[0];const{event:{onZoom:Xp}}=Gp,Jp=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${ws}`,`${ea.COMPONENT.BAR_OOB}-${Ls}`,`${ea.COMPONENT.BAR_OOB}-${ws}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${Ls}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${ws}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${Ls}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${ws}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}`,`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${ws}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${Ls}-${ra.SECONDARY}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${ws}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${Ls}`,ea.COMPONENT.AXIS.MAJOR];function Zp({chart:e,models:t,actions:r,viewState:n,viewCache:i,environment:o}){const{appModel:a,layoutService:s,seriesModel:l,tooltipModel:u,flags:c}=t,{pointComponentKeys:d,markerComponentKeys:m,barComponentKeys:f}=l.meta,p=[...d,...m],h=[...f],y=[...Jp,...p],g=u.query.getCustomTooltipModel(),v=Kp(l),b=g.utils,x=oc(b.displayTooltip,b.DEBOUNCE_THRESHOLD),M=s.meta.isContinuous?Xp({chart:e,viewState:n,viewCache:i},{rtl:"rtl"===o.options.direction,threshold:50,targetKey:v}):()=>{},S=()=>e.component(ea.COMPONENT.LEGEND_TOOLTIP),E=()=>e.component(ea.COMPONENT.TOOLTIP),C=()=>{(()=>{const e=S();e&&e.show&&e.emit("hide")})(),(()=>{const e=E();e&&e.show&&(e.emit("hide"),u.query.useCustomTooltip()&&x&&x({},e,{nodes:[],opts:{app:a,flags:c},customTooltipModel:g,hide:!0}))})()};return{type:"native",events:{wheel(t){const n={x:t.clientX,y:t.clientY},i=e.componentsFromPoint(n);if(r.interact.enabled()){const[e]=i.filter((e=>e.key===ea.COMPONENT.LEGEND_CATEGORICAL));((e,t)=>{if(t){const r=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;t.emit(r>=0?"next":"prev"),e.preventDefault()}})(t,e)}if(r.scroll.enabled()){const[e]=i.filter((e=>e.key===v));e&&(M(n,Math.sign(-t.deltaY)),t.preventDefault())}C()},mousemove(n){if(!r.tooltip.enabled())return;const i=e.componentsFromPoint({x:n.clientX,y:n.clientY}),o=S();o&&o.show&&(i.some((e=>e.key===ea.COMPONENT.LEGEND_CATEGORICAL))?o.emit("show",n):o.emit("hide"));const s=E();if(s&&s.show)if(i.some((e=>-1!==y.indexOf(e.key)))){const r=[],{x:o,y:d}=function({chart:e,e:t}){const{left:r,top:n}=e.element.getBoundingClientRect();return{x:(t.center?t.center.x:t.clientX)-r,y:(t.center?t.center.y:t.clientY)-n}}({chart:e,e:n});if(i.some((e=>p.indexOf(e.key)>-1))&&r.push(...e.shapesAt({cx:o,cy:d,r:3},{components:p.map((e=>({key:e})))})),i.some((e=>h.indexOf(e.key)>-1))&&r.push(...e.shapesAt({x:o,y:d},{components:h.map((e=>({key:e})))})),u.query.useCustomTooltip()&&b.checkIfPromisesExist({customTooltipModel:g})){let i=[];if(0===r.length&&(r.push(...b.getNodes(n,e)),1===r.length&&r[0].key===ea.COMPONENT.AXIS.MAJOR)){var l;const n=Ff({chart:e,models:t,nodes:r});null!=n&&n.length&&null!==(l=n[0].childrenNodes)&&void 0!==l&&l.length&&(i=n[0].childrenNodes)}x(n,s,{nodes:r,extractedNodes:i,opts:{app:a,flags:c},customTooltipModel:g})}else s.emit("show",n,r.length?{nodes:r}:void 0)}else s.emit("hide")},mouseup(e){2===e.button&&C()},mouseleave(){C()}}}}const Qp=Gp.interactions.areaPan;function eh({chart:e,models:t,environment:r,viewState:n,viewCache:i,actions:o,selectables:a}){const{layoutService:s,dockService:l,discreteModel:u,colorService:c}=t,d="rtl"===r.options.direction,m=function({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...Fa({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:Va({componentKey:e,chart:t,actions:r,layoutService:o})}}({componentKey:"scrollbar",chart:e,actions:o,viewState:n,viewCache:i,discrete:u,layoutService:s,dockService:l,rtl:d}),f={type:"hammer",enable:!0,gestures:[...c.custom.legendInteractions(),...a.gestures.sort(((e,t)=>(t.prio||0)-(e.prio||0))),...m.gestures]},p=[Zp({chart:e,models:t,actions:o,viewState:n,viewCache:i,environment:r}),m.native];return s.meta.isDiscrete&&(f.gestures.push(...u.interactions.gestures),p.push(u.interactions.native)),s.meta.isContinuous&&f.gestures.push(Qp({targetKey:Kp(t.seriesModel),chart:e,actions:o,viewState:n,viewCache:i}),function({targetKey:e,chart:t,actions:r,viewState:n,viewCache:i,rtl:o}){const a={last:0,diff:0},s=Gp.event.onZoom({viewCache:i,viewState:n,chart:t},{threshold:100,rtl:o,targetKey:e});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:"continuousPinchZoom",pointers:2,threshold:0,enable:(n,i)=>!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{continuousPinchZoomstart(e){a.last=e.scale,e.preventDefault()},continuousPinchZoommove(e){const t=e.scale-a.last;Math.abs(t)>.01&&s(e.center,t>0?1:-1),a.last=e.scale,e.preventDefault()}}}}({targetKey:Kp(t.seriesModel),chart:e,actions:o,viewState:n,viewCache:i,rtl:d})),[f,...p]}const th=({key:e,componentTargetKey:t,requireFailure:r,recognizeWith:n},i)=>({key:"event:"+e,type:"Pan",requireFailure:r,recognizeWith:n,options:{event:"lasso",enable(e,r){if("lasso"===this.started||!r)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:r.center.x,y:r.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)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end","lasso")}}});const rh=({targets:e,requireFailure:t,recognizeWith:r,components:n,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:r,options:{event:i,interval:10,pointers:1,enable(t,r){return!r||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const r=function(e,t){const r=t.element.getBoundingClientRect();let n,i;return e.center?(({x:n}=e.center),({y:i}=e.center)):(n=e.clientX,i=e.clientY),{x:n-r.left,y:i-r.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:r.x,cy:r.y,r:u}:r,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),m=this.chart.component("tooltip"),f="mouse"!==t.pointerType&&m&&m.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),r=e.some((e=>"legend-cat"===e.type));if(!d.length&&r||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&n){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof n?n(t,d):n;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i)}}if(m&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const r=s.getNodes(t,this.chart);l(t,m,{nodes:r,opts:o,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else f&&m.emit("hide")}}}};const nh=({key:e,requireFailure:t,recognizeWith:r,eventName:n="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:r,options:{event:`${n}-${e}-tap`,interval:10,pointers:1,enable:(t,r)=>!!r&&(!!i.actions.select.enabled()&&(!(!r.target||"INPUT"!==r.target.nodeName)||!(!r.target||!r.target.hasAttribute("data-other-value"))&&(r.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${n}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const ih=({eventName:e,key:t,fillTargets:r=[],requireFailure:n,recognizeWith:i},o,a)=>({key:"event:"+t,type:"Pan",requireFailure:n,recognizeWith:i,options:{event:e,enable(n,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!==r.indexOf(e.key)));return 0===a.length&&function(e,t){const{target:r}=e.srcEvent;return!(!r||0!==(r.getAttribute("data-key")||"").indexOf(t+"-"))}(i,t)?(this.started=e,!0):a.length>0}},events:{[e+"start"](r){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),r.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(a+"Start",r),this.started=e},[e+"move"](e){e.preventDefault(),this.chart.component(t).emit(a+"Move",e)},[e+"end"](r){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),r.preventDefault(),this.chart.component(t).emit(a+"End",r),o.actions.select.emit("end",e),this.started=!1}}});function oh(e,t){const r=function(e){const{key:t,targets:r,fillTargets:n,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:r.map((e=>"@"+e)).join(",")},on:m?{bubbleEnd(){m()}}:{},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:n,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),n=ih(e,t,"range");return{interactions:[e.onEdited?nh(e,t):null,n].filter(Boolean),components:[r]}}const ah=/axis|legend/;function sh({actions:e,models:t}){const{seriesModel:r,layoutService:n,colorService:i,tooltipModel:o,flags:a}=t,s=n.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1);return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[rh(e,t)],components:[]}}({targets:[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...r.query.series(ta.MARKER).map((e=>ks(ea.COMPONENT.MARKER,e))),...r.query.series(ta.LINE).map((e=>ks(ea.COMPONENT.POINT,e))),ea.COMPONENT.AXIS.MAJOR,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.LEGEND_CATEGORICAL],components:(e,t)=>{const[r]=t,{key:n}=r,i={key:n,action:e.srcEvent.ctrlKey||s?"set":"toggle",contexts:["selection"]};return-1===[ea.COMPONENT.AXIS.MAJOR,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.LEGEND_CATEGORICAL].indexOf(n)&&(i.data=["selectionDimension"]),[i]}},{actions:e,isLocked:e=>e.some((e=>"legend-cat"===e.type))?i.isSelectionLocked({isMeasureSelectionLocked:n.meta.isDimensionLocked}):n.meta.isDimensionLocked,hitRadius:e=>(e=>e.some((e=>ah.test(e.type))))(e)?0:3,customTooltipModel:o.query.getCustomTooltipModel(),debouncer:oc,flags:a})}function lh({actions:e,models:t}){const{layoutService:r,dockService:n,seriesModel:i}=t,{isDiscrete:o,isDimensionLocked:a}=r.meta;if(!o||a)return!1;const s=[...i.meta.seriesComponentKeys,ea.COMPONENT.AXIS.MAJOR];return function(e,t){const r=function(e){const{key:t,targets:r,components:n,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:r.map((e=>"@"+e)).join(",")},settings:{multiple:!0,brush:{components:n},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:[ih(e,t,"area")],components:[r]}}({eventName:"discreteRange",key:"discrete-range-brush",components:[{key:s[0],contexts:["selection"],action:"set",data:["selectionDimension"]}],targets:s,fillTargets:[ea.COMPONENT.AXIS.MAJOR],dock:n.meta.major.dock},{actions:e})}const uh={components:[],interactions:[]};function ch({actions:e,chart:t,models:r}){const n=function({actions:e,models:t}){const{dockService:r,seriesModel:n,layoutService:i}=t;return!i.meta.isDimensionLocked&&!i.meta.isBarSeriesStacked&&oh({eventName:"minorRange",key:"minor-range-brush",targets:[ea.COMPONENT.AXIS.MINOR.PRIMARY,`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,...n.query.series(ta.MARKER).filter((e=>e.isPrimary)).map((e=>ks(ea.COMPONENT.MARKER,e))),...n.query.series(ta.LINE).filter((e=>e.isPrimary)).map((e=>ks(ea.COMPONENT.POINT,e)))],fillTargets:[ea.COMPONENT.AXIS.MINOR.PRIMARY],dock:r.meta.minor.dock,scale:ea.SCALE.MINOR.PRIMARY,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:e,models:r})||uh,i=function({actions:e,models:t}){const{dockService:r,seriesModel:n,layoutService:i}=t;return!i.meta.isDimensionLocked&&!i.meta.isBarSeriesStacked&&oh({eventName:"minorRange-secondary",key:"minor-secondary-range-brush",targets:[ea.COMPONENT.AXIS.MINOR.SECONDARY,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...n.query.series(ta.MARKER).filter((e=>!e.isPrimary)).map((e=>ks(ea.COMPONENT.MARKER,e))),...n.query.series(ta.LINE).filter((e=>!e.isPrimary)).map((e=>ks(ea.COMPONENT.POINT,e)))],fillTargets:[ea.COMPONENT.AXIS.MINOR.SECONDARY],dock:r.meta.minorSecondary.dock,scale:ea.SCALE.MINOR.SECONDARY,onEdited(){e.select.emit("end","minorRange-secondary")}},{actions:e})}({actions:e,models:r})||uh,o=lh({actions:e,models:r})||uh,a=function({actions:e,chart:t,models:r}){const{layoutService:n,dockService:i,seriesModel:o}=r,{isContinuous:a,isTime:s}=n.meta;if(!a)return!1;const l=s?[ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER]:[ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS];return oh({eventName:"continuousRange",key:"continuous-range-brush",targets:[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...o.query.series(ta.MARKER).map((e=>ks(ea.COMPONENT.MARKER,e))),...o.query.series(ta.LINE).map((e=>ks(ea.COMPONENT.POINT,e))),...l],fillTargets:l,dock:i.meta.major.dock,scale:s?ea.SCALE.MAJOR_INNER:ea.SCALE.MAJOR,observeBrush:!0,multiple:!0,toLabel({datum:e,data:r,scale:n}){const i=s?n.formatter():t.formatter(ea.FORMATTER.PRIMARY),o=t.scale(ea.SCALE.MAJOR).max(),a=t.brushSelectionIncludeMax&&e===o;return`${e!==Math.max(...r)||a?"":"<"}${i(e)}`}},{actions:e})}({actions:e,chart:t,models:r})||uh,s=function({actions:e,models:t}){const{colorService:r,layoutService:n}=t,[i]=r.custom.legendComponents(),o=r.custom.wrappedScales(),{isDimensionLocked:a}=n.meta;if(a||!i)return!1;const s=ea.SCALE.COLOR+"Range",{type:l,key:u}=i,c=o[s];return!("legend-seq"!==l||!c||c.min>=c.max)&&oh({eventName:"legendRange",key:"legend-range-brush",targets:[u],fillTargets:[u],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:i.layout.dock,scale:s,bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e})}({actions:e,models:r})||uh;return{components:[...n.components,...i.components,...o.components,...a.components,...s.components],interactions:[...n.interactions,...i.interactions,...o.interactions,...a.interactions,...s.interactions]}}function dh({actions:e,models:t}){const{layoutService:r,seriesModel:n}=t,{seriesComponentKeys:i}=n.meta;if(r.meta.isDimensionLocked)return{components:[],interactions:[]};return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const r={key:"lasso",...e},n=(({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}}}))(r);return{interactions:[th(r,t)],components:[n]}}({key:"lasso",componentTargetKey:i[0],components:i.map((e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]})))},{actions:e})}function mh({picasso:e,chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a}){const{colorService:s,pluginService:l}=r,u=r.layoutService.getLayout(),{options:c}=n,d=function(e,t){return{layoutModes:J.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}(0,{logicalSize: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:u,options:c}),minCenterRatio:0}),m=function({chart:e,models:t,environment:r,viewState:n,viewCache:i,actions:o}){var a;const{colorService:s,layoutService:l,dockService:u}=t,c=Uf({environment:r,models:t});return"center"===(null==c||null===(a=c.layout)||void 0===a?void 0:a.dock)?[c]:[...bf({models:t}),...Ss({models:t}),...mf({chart:e,models:t,environment:r,viewState:n,viewCache:i}),Wf({models:t,environment:r}),...Ds({models:t,environment:r}),...Ef({models:t,environment:r,actions:o}),Wi({viewState:n,viewCache:i,layoutService:l,dockService:u}),...zf({models:t}),...Hf({chart:e,models:t,environment:r}),Cf({models:t,environment:r,viewState:n,viewCache:i}),...s.custom.legendComponents(),Yf(t),...Df({chart:e,models:t,viewState:n,viewCache:i,environment:r}),..._f({chart:e,models:t,environment:r}),c].filter(Boolean)}({chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a}),f=function({actions:e,chart:t,models:r}){const{layoutService:n}=r,i=n.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),o=sh({actions:e,models:r});if(i)return{components:[...o.components],gestures:[...o.interactions]};const a=ch({actions:e,chart:t,models:r}),s=dh({actions:e,models:r});return{components:[...o.components,...a.components,...s.components],gestures:[...o.interactions,...a.interactions,...s.interactions]}}({actions:a,chart:t,models:r}),p=l.extendComponents([...m,...f.components]);return{collections:ss({models:r}),scales:bs({picasso:e,models:r,viewState:i,viewCache:o,environment:n}),components:p,formatters:Gf({models:r}),interactions:eh({chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a,selectables:f}),strategy:d,palettes:s.getPalettes()}}const fh=({models:{layoutService:e,fieldModel:t,appLayoutModel:r}})=>({type:"q",key:ea.DATA.MAIN,data:e.getHyperCube(),config:{virtualFields:t.virtuals,localeInfo:r.qLocaleInfo}}),ph=({models:{layoutService:e,fieldModel:t,continuousModel:r,appLayoutModel:n}})=>e.meta.isContinuous?[{type:"q",key:ea.DATA.REDUCED,data:r.getInitialCube(),config:{virtualFields:t.virtuals,localeInfo:n.qLocaleInfo}}]:[],{event:{onZoomIntercept:hh,onZoomChange:yh}}=Gp,gh=[ea.COMPONENT.AXIS_TITLE.MAJOR,ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,ea.COMPONENT.GRID_LINE,ea.COMPONENT.ZERO_LINE],vh=({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l})=>{(({chart:e,models:t,viewState:n,viewCache:i})=>{r((()=>{if(!t||!n||!i)return;const{layoutService:r,continuousModel:o,refLineModel:a,seriesModel:s}=t,{miniComponentKeys:l}=s.meta,u=()=>{a&&a.update(),e.update({partialData:!0,excludeFromUpdate:[...gh,...l]})};n.onChanged("scrollOffset",u),r.meta.isContinuous&&(n.onChanged("zoom",yh({layoutService:r,continuousDataModel:o},u)),n.intercept("zoom",hh({viewCache:i})))}),[t,n,i])})({chart:t,models:n,viewState:a,viewCache:s}),(({picasso:e,chart:t,models:r,environment:n,viewState:o,viewCache:a,actions:s})=>{const[,l]=i((async()=>{if(null==t||!t.update||!r||!n)return;const{layoutService:i,colorService:l,discreteModel:u}=r;function c(i=!1){t.update({settings:mh({picasso:e,chart:t,models:r,environment:n,viewState:o,viewCache:a,actions:s}),data:i&&[fh({models:r}),...ph({models:r}),...l.getData()]})}const d=i.getDataPages();i.setDataPages([]),c(!0),i.setDataPages(d),i.meta.isContinuous||await u.command.initialize(),c(!1)}),[null==t?void 0:t.update,r,n]);if(l)throw l})({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l})};function bh(){return(bh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var xh={exports:{}};function Mh(){}function Sh(){}Sh.resetWarningCache=Mh;xh.exports=function(){function e(e,t,r,n,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Sh,resetWarningCache:Mh};return r.PropTypes=r,r}();var Eh=xh.exports;function Ch(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function qh({d:e,size:t,style:r={},viewBox:n="0 0 16 16"}){const i={fontSize:Ch(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...r};return q.createElement("i",{style:i},q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:n,fill:"currentColor"},q.createElement("path",{d:e})))}const Oh={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},Ah={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},Dh="M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z",Nh={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},Ih={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function Th(e,t,r){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:r}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(r,"qHyperCubeDef.");let n=Qi.generate(t,r);n&&n.length&&(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(n,!0))}))}function wh(e,t,r,n,i,o){e.getEffectiveProperties().then((a=>{const s=U(!0,{},a),l=s.qHyperCubeDef[n][t],u=s.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[n][r];u.qAttributeDimensions=l.qAttributeDimensions,l.qAttributeDimensions=[],o||(u.qAttributeExpressions=l.qAttributeExpressions,l.qAttributeExpressions=[]),s.qHyperCubeDef[n][t]=u,s.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[n][r]=l,i&&i({oldItem:l,newItem:u,oldProperties:a,newProperties:s,model:e}),Th(e,a,s)}))}function Lh({dir:e,dock:t,altList:r,model:n,translator:i,app:o,onChange:a}){return 0===r.length?null:{dir:e,dock:t,getAlternatives(){const e=r.map((e=>function(e,t,r){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:r.get("Object.ErrorMessage.MissingDimension")));const n=e.qDef.qLabelExpression;if(n)return t.evaluate(n);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t})))));return Promise.all(e)},changeTo(e,t){wh(n,e,t,"qDimensions",a)}}}function Rh(e,t,r,n="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){r.drillUp(n,t,e)}};var i}function kh({altList:e,app:t,dir:r,dock:n,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:r,dock:n,getAlternatives(){const r=e.map((e=>function(e,t,r){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:r.get("Object.ErrorMessage.MissingMeasure")));const n=e.qDef.qLabelExpression;if(n)return t.evaluate(n);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t})))));return Promise.all(r)},changeTo(e,t){wh(i,e,t,"qMeasures",o,a)}}}function Ph(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle}}const jh={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},Fh=({children:e,...t})=>q.createElement(O,bh({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e);function Vh(){function e({title:e,selected:t,onClick:r}){const n=he.detectTextDirection(e);return q.createElement(N,{button:!0,onClick:r,style:{textAlign:"start"}},q.createElement(I,{style:{minWidth:32}},q.createElement(qh,{d:t?Dh:""})),q.createElement(T,{primaryTypographyProps:{dir:n}},e))}function t({alignTo:t,changeTo:r,current:n,dir:i,dock:o,list:a,onClose:s,show:l}){const u=a.map(((t,n)=>q.createElement(e,{key:t.id,title:t.title,onClick:()=>r(n)})));return q.createElement(A,bh({anchorEl:t,open:l,onClose:s},jh[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),q.createElement(D,{dense:!0,dir:i,component:"nav"},q.createElement(e,{title:n,selected:!0,onClick:s}),u))}e.propTypes={title:Eh.string.isRequired,selected:Eh.bool,onClick:Eh.func.isRequired},e.defaultProps={selected:!1},t.propTypes={alignTo:Eh.any,changeTo:Eh.func.isRequired,current:Eh.string.isRequired,dir:Eh.string.isRequired,dock:Eh.string.isRequired,list:Eh.array,onClose:Eh.func.isRequired,show:Eh.bool.isRequired},t.defaultProps={list:[],alignTo:null};class r extends q.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive()},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=q.createRef()}componentDidMount(){const{selections:e}=this.props;e&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),e.addListener("activated",this.onSelectionsActivated),e.addListener("deactivated",this.onSelectionsDeactivated),e.addListener("canceled",this.onSelectionsDeactivated))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.index,e),this.closePopover()}openPopover(){this.state.closeTime&&Date.now()-this.state.closeTime<20||this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e})}))}closePopover(){this.setState({open:!1,closeTime:Date.now()})}render(){const{titleData:e,popover:r,translator:n,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l}=this.props,u={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",...this.props.style},c=e.breadcrumbs.length,d=i||this.state.inSelection,m=e.breadcrumbs.map(((t,r)=>q.createElement(Fh,{style:{display:"flex",alignItems:"center",color:d&&"rgba(89, 89, 89, 0.8)",pointerEvents:d?"none":"auto"},key:r,onClick:()=>d?void 0:e.drillUp(c-r),title:t},q.createElement("span",{style:u},t),q.createElement(qh,bh({},Ih,{size:"small",style:{margin:"0 8px"}}))))),f=r&&!this.state.open?this.openPopover:this.closePopover,p=!r||i||this.state.inSelection,h={display:"flex",alignItems:"center",width:"100%",color:p&&"rgba(89, 89, 89, 0.8)",height:!o&&p&&"20px",lineHeight:!o&&p&&"20px",border:!o&&p&&"none"};a&&(h.padding=a),s&&(h.minWidth=s);const y=he.detectTextDirection(e.text),g=q.createElement(Fh,{style:h,onClick:p?void 0:f,title:e.text,tabIndex:"-1"},e.locked&&q.createElement(qh,bh({},Ah,{size:"small",title:n.get("Tooltip.selections.locked")})),q.createElement("span",{style:u,dir:y},e.text),r&&q.createElement(qh,bh({},Nh,{size:"small",style:{margin:"0 8px"}})));return q.createElement(q.Fragment,null,e.drilldown&&q.createElement(qh,bh({},Oh,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),m,q.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:l?"auto":"none"}},g),r&&q.createElement(t,{dock:r.dock,dir:r.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo}))}}function n(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function i(e){return!e.isDimension&&te(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return r.propTypes={disabled:Eh.bool.isRequired,padding:Eh.string,minWidth:Eh.string,titleData:Eh.shape({breadcrumbs:Eh.arrayOf(Eh.string).isRequired,drilldown:Eh.bool.isRequired,index:Eh.number.isRequired,locked:Eh.bool.isRequired,text:Eh.string.isRequired,popoverText:Eh.string.isRequired,drillUp:Eh.func}).isRequired,popover:Eh.shape({dir:Eh.string.isRequired,dock:Eh.string.isRequired,changeTo:Eh.func.isRequired,getAlternatives:Eh.func.isRequired}),translator:Eh.shape({get:Eh.func.isRequired}).isRequired,selections:Eh.shape({isActive:Eh.func,addListener:Eh.func,removeListener:Eh.func}),style:Eh.shape({fontSize:Eh.string,color:Eh.string,fontFamily:Eh.string}).isRequired,isDimension:Eh.bool.isRequired,hasAlternative:Eh.bool.isRequired},r.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){return this.settings.settings.isDimension||i(this.settings.settings)?28:20},render(){const{settings:{app:e,disabled:t,explicitItemInfos:o,hyperCube:a,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:m,rtl:f,selections:p,skipAttributeExpressions:h,translator:y},layout:{dock:g}}=this.settings,v="top"!==g&&"bottom"!==g||!f?"ltr":"rtl",b=function(e,t){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center"};return"left"===e?(r.width=t.height+"px",r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left"):"right"===e&&(r.width=t.height+"px",r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left"),r}(g,this.rect),x=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,M=x&&x[l?"qDimensions":"qMeasures"]||[],S=o||a[l?"qDimensionInfo":"qMeasureInfo"],E=l?Lh:kh,C=l?Rh:Ph,O=c&&c.colorSupport&&c.modifiers&&E({altList:M,app:e,dir:f?"rtl":"ltr",dock:n(g),model:c,onChange:d,skipAttributeExpressions:h,translator:y}),A=(D=this.settings.settings).isDimension&&te(D,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||i(this.settings.settings);var D;const N=S.map(((e,n)=>{const i="number"==typeof e.explicitColumn?e.explicitColumn:n,o=C(e,i,c),a=n===S.length-1;return q.createElement(q.Fragment,{key:e.cId},q.createElement(r,{popover:O,titleData:o,model:c,translator:y,selections:p,disabled:t(),style:this.style,isDimension:l,padding:m,minWidth:u,hasAlternative:A}),!a&&q.createElement("span",null,", "))}));return q.createElement("div",{style:b,dir:v},N)}}}function _h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e<t?t:e>r?r:e}function zh(e){if(e.type)return e;if("#"===e.charAt(0))return zh(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length/3,"}"),"g"),r=e.match(t);return r&&1===r[0].length&&(r=r.map((function(e){return e+e}))),r?"rgb(".concat(r.map((function(e){return parseInt(e,16)})).join(", "),")"):""}(e));var t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(r))throw new Error(["Material-UI: unsupported `".concat(e,"` color."),"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()."].join("\n"));var n=e.substring(t+1,e.length-1).split(",");return{type:r,values:n=n.map((function(e){return parseFloat(e)}))}}function Hh(e){var t=e.type,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),"".concat(t,"(").concat(r.join(", "),")")}function $h(e){var t="hsl"===(e=zh(e)).type?zh(function(e){var t=(e=zh(e)).values,r=t[0],n=t[1]/100,i=t[2]/100,o=n*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),Hh({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uh(){return(Uh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Yh(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Wh(){return(Wh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Gh(e){return(Gh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kh(e){return(Kh="function"==typeof Symbol&&"symbol"===Gh(Symbol.iterator)?function(e){return Gh(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Gh(e)})(e)}function Xh(e){return e&&"object"===Kh(e)&&!Array.isArray(e)}function Jh(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},n=r.clone?Wh({},e):e;return Xh(e)&&Xh(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(Xh(t[i])&&i in e?n[i]=Jh(e[i],t[i],r):n[i]=t[i])})),n}var Zh=["xs","sm","md","lg","xl"];function Qh(e){var t=e.values,r=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,n=e.unit,i=void 0===n?"px":n,o=e.step,a=void 0===o?5:o,s=Yh(e,["values","unit","step"]);function l(e){var t="number"==typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var n=Zh.indexOf(t)+1;return n===Zh.length?l(e):"@media (min-width:".concat(r[e]).concat(i,") and ")+"(max-width:".concat(r[Zh[n]]-a/100).concat(i,")")}return Uh({keys:Zh,values:r,up:l,down:function(e){var t=Zh.indexOf(e)+1,n=r[Zh[t]];return t===Zh.length?l("xs"):"@media (max-width:".concat(("number"==typeof n&&t>0?n:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return r[e]}},s)}function ey(e,t,r){var n;return Uh({gutters:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Uh({paddingLeft:t(2),paddingRight:t(2)},r,Bh({},e.up("sm"),Uh({paddingLeft:t(3),paddingRight:t(3)},r[e.up("sm")])))},toolbar:(n={minHeight:56},Bh(n,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Bh(n,e.up("sm"),{minHeight:64}),n)},r)}var ty={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},ry={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},ny={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"},iy={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},oy={black:"#000",white:"#fff"},ay={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:oy.white,default:ny[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)"}},sy={text:{primary:oy.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:ny[800],default:"#303030"},action:{active:oy.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 ly(e,t,r,n){e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=function(e,t){if(e=zh(e),t=_h(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;return Hh(e)}(e.main,n):"dark"===t&&(e.dark=function(e,t){if(e=zh(e),t=_h(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]*=1-t;return Hh(e)}(e.main,1.5*n)))}function uy(e){var t=e.primary,r=void 0===t?{light:ty[300],main:ty[500],dark:ty[700]}:t,n=e.secondary,i=void 0===n?{light:ry.A200,main:ry.A400,dark:ry.A700}:n,o=e.error,a=void 0===o?{light:iy[300],main:iy[500],dark:iy[700]}:o,s=e.type,l=void 0===s?"light":s,u=e.contrastThreshold,c=void 0===u?3:u,d=e.tonalOffset,m=void 0===d?.2:d,f=Yh(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function p(e){return function(e,t){var r=$h(e),n=$h(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,sy.text.primary)>=c?sy.text.primary:ay.text.primary}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(e=Uh({},e)).main&&e[t]&&(e.main=e[t]),ly(e,"light",r,m),ly(e,"dark",n,m),e.contrastText||(e.contrastText=p(e.main)),e}var y={dark:sy,light:ay};return Jh(Uh({common:oy,type:l,primary:h(r),secondary:h(i,"A400","A200","A700"),error:h(a),grey:ny,contrastThreshold:c,getContrastText:p,augmentColor:h,tonalOffset:m},y[l]),f,{clone:!1})}function cy(e){return Math.round(1e5*e)/1e5}var dy={textTransform:"uppercase"};function my(e,t){var r="function"==typeof t?t(e):t,n=r.fontFamily,i=void 0===n?'"Roboto", "Helvetica", "Arial", sans-serif':n,o=r.fontSize,a=void 0===o?14:o,s=r.fontWeightLight,l=void 0===s?300:s,u=r.fontWeightRegular,c=void 0===u?400:u,d=r.fontWeightMedium,m=void 0===d?500:d,f=r.fontWeightBold,p=void 0===f?700:f,h=r.htmlFontSize,y=void 0===h?16:h,g=r.allVariants,v=r.pxToRem,b=Yh(r,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,M=v||function(e){return"".concat(e/y*x,"rem")},S=function(e,t,r,n,o){return Uh({fontFamily:i,fontWeight:e,fontSize:M(t),lineHeight:r},'"Roboto", "Helvetica", "Arial", sans-serif'===i?{letterSpacing:"".concat(cy(n/t),"em")}:{},{},o,{},g)},E={h1:S(l,96,1,-1.5),h2:S(l,60,1,-.5),h3:S(c,48,1.04,0),h4:S(c,34,1.17,.25),h5:S(c,24,1.33,0),h6:S(m,20,1.6,.15),subtitle1:S(c,16,1.75,.15),subtitle2:S(m,14,1.57,.1),body1:S(c,16,1.5,.15),body2:S(c,14,1.43,.15),button:S(m,14,1.75,.4,dy),caption:S(c,12,1.66,.4),overline:S(c,12,2.66,1,dy)};return Jh(Uh({htmlFontSize:y,pxToRem:M,round:cy,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:m,fontWeightBold:p},E),b,{clone:!1})}function fy(){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 py=["none",fy(0,2,1,-1,0,1,1,0,0,1,3,0),fy(0,3,1,-2,0,2,2,0,0,1,5,0),fy(0,3,3,-2,0,3,4,0,0,1,8,0),fy(0,2,4,-1,0,4,5,0,0,1,10,0),fy(0,3,5,-1,0,5,8,0,0,1,14,0),fy(0,3,5,-1,0,6,10,0,0,1,18,0),fy(0,4,5,-2,0,7,10,1,0,2,16,1),fy(0,5,5,-3,0,8,10,1,0,3,14,2),fy(0,5,6,-3,0,9,12,1,0,3,16,2),fy(0,6,6,-3,0,10,14,1,0,4,18,3),fy(0,6,7,-4,0,11,15,1,0,4,20,3),fy(0,7,8,-4,0,12,17,2,0,5,22,4),fy(0,7,8,-4,0,13,19,2,0,5,24,4),fy(0,7,9,-4,0,14,21,2,0,5,26,4),fy(0,8,9,-5,0,15,22,2,0,6,28,5),fy(0,8,10,-5,0,16,24,2,0,6,30,5),fy(0,8,11,-5,0,17,26,2,0,6,32,5),fy(0,9,11,-5,0,18,28,2,0,7,34,6),fy(0,9,12,-6,0,19,29,2,0,7,36,6),fy(0,10,13,-6,0,20,31,3,0,8,38,7),fy(0,10,13,-6,0,21,33,3,0,8,40,7),fy(0,10,14,-6,0,22,35,3,0,8,42,7),fy(0,11,14,-7,0,23,36,3,0,9,44,8),fy(0,11,15,-7,0,24,38,3,0,9,46,8)],hy={borderRadius:4};function yy(){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 r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return 0===r.length?e(1):1===r.length?e(r[0]):r.map((function(t){var r=e(t);return"number"==typeof r?"".concat(r,"px"):r})).join(" ")};return Object.defineProperty(r,"unit",{get:function(){return t}}),r.mui=!0,r}var gy={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)"},vy={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195},by=function(e){return"".concat(Math.round(e),"ms")},xy={easing:gy,duration:vy,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.duration,n=void 0===r?vy.standard:r,i=t.easing,o=void 0===i?gy.easeInOut:i,a=t.delay,s=void 0===a?0:a;return Yh(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof n?n:by(n)," ").concat(o," ").concat("string"==typeof s?s:by(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))}},My={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};const Sy=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,r=void 0===t?{}:t,n=e.mixins,i=void 0===n?{}:n,o=e.palette,a=void 0===o?{}:o,s=e.shadows,l=e.spacing,u=e.typography,c=void 0===u?{}:u,d=Yh(e,["breakpoints","mixins","palette","shadows","spacing","typography"]),m=uy(a),f=Qh(r),p=yy(l),h=Uh({breakpoints:f,direction:"ltr",mixins:ey(f,p,i),overrides:{},palette:m,props:{},shadows:s||py,typography:my(m,c),spacing:p},Jh({shape:hy,transitions:xy,zIndex:My},d));return h}({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:'"QlikView Sans", "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 Ey=L({productionPrefix:"qb272",disableGlobal:!0,seed:""});function Cy(){function e({x:e,y:t,width:r,height:n,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(r)?a.width:r,a.height=Number.isNaN(n)?a.height:n,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:r=document.createElement.bind(document)}=t;let n,i=e();const o={element:()=>n,root:()=>n,appendTo:e=>(n||(n=r("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),render(e){if(!n)return!1;const t=i.scaleRatio.x,r=i.scaleRatio.y;return n.style.left=Math.round(i.margin.left+i.x*t)+"px",n.style.top=Math.round(i.margin.top+i.y*r)+"px",n.style.width=Math.round(i.width)+"px",n.style.height=Math.round(i.height)+"px",n.style.transform=`scale(${t}, ${r})`,n.style.transformOrigin="top left",w.render(function(e,t){return q.createElement(R,{generateClassName:t},q.createElement(k,{theme:Sy},e))}(e,Ey),n),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(n&&w.unmountComponentAtNode(n),o),destroy(){n&&n.parentElement&&(w.unmountComponentAtNode(n),n.parentElement.removeChild(n)),n=null},size:t=>(t&&(i=e(t)),i)};return o}}function qy(){return function(e){e.renderer("react",Cy()),e.component("data-title",Vh()),e.component("disclaimer",function(){class e extends q.Component{render(){const{label:e,spanStyle:t}=this.props;return q.createElement(q.Fragment,null,q.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:Eh.string.isRequired,spanStyle:Eh.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:r},layout:{dock:n}}=this.settings,i="top"!==n&&"bottom"!==n||!r?"ltr":"rtl",o=function(e,t){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":r.width=t.height+"px",r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=t.height+"px",r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left";break;case"center":r.width=t.width+"px",r.height=t.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}(n,this.rect),a="center"===n?t:"* "+t,s="center"!==n?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return q.createElement("div",{style:o,dir:i},q.createElement(q.Fragment,null,q.createElement(e,{label:a,spanStyle:s})))}}}())}}function Oy(e,t,r,n){const i=function(t){const r=String(t);return e(r)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,n?r-1:0]),a=i([t.data.value,n?0:r-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(n){const i=e.pxScale(n);return i===e?this:Oy(i,t,r)},i}function Ay(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},r={},n={}){const i=t(e,r,n),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),Oy(i,a,l,e.invert)}))}const Dy={getDefaultSettings:({size:e=10,fill:t="#999",alignment:r}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:r}),createOob({oob:e,dockValue:t,boxCenter:r,rendWidth:n,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=n,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=n,d=t<.5?180:0),a(U({},e,{[s]:r*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function Ny({i:e,width:t,height:r,resolved:n,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==n.major.settings.binStart?(l=n.major.items[e].binStart,u=n.major.items[e].binEnd,s=n.major.settings.binStart.scale):(s=n.major.settings.major.scale,l=s?n.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=U({},{major:l,majorEnd:u},n.minor.items[e]);i.forEach((t=>{d[t]=n[t].items[e]}));const m=o?r:t,f=function({bandwidth:e,width:t,minWidthPx:r,maxWidthPx:n,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(n))?i:n/i);return a=Number.isNaN(Number(r))?a:Math.max(r/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),p=(c-f)/2,h=p+d.major+f/2;return{item:d,boxCenter:h,boxWidth:f,boxPadding:p,rendWidth:t,rendHeight:r}}function Iy({keys:e,data:t,defaultSettings:r,style:n,settings:i,width:o,height:a,resolver:s}){const l=U(!0,{},r||{},n||{}),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:U(!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:U(!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 m=i.minor||{};let f;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:U(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let r=0,n=e.length;r<n;r++)f=e[r],p[f]=s.resolve({data:t,defaults:l[f],settings:i[f],scaled:u});return p}const Ty=["oob"];const wy={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:r}=this.settings.settings,n="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=Iy({keys:Ty,data:i,defaultSettings:{oob:Dy.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:r,resolved:n,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=Ny}){const l=[],{items:u}=n.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:f,rendHeight:p}=s({i:c,width:e,height:t,resolved:n,keys:i,flipXY:r,calcKey:"oob"}),h=u[c].data,y=[];if(d.oob.show){y.push(Dy.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:f,rendHeight:p,flipXY:r,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:y};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:n,resolved:l,keys:Ty,symbol:s,dockValue:r})}},Ly={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Ry=["hat"];function ky(e,t=!0){let r="";for(let t=0;t<e.length;t++){const n=e[t];r+=0===t?`M${n.x} ${n.y}`:`L${n.x} ${n.y}`,r+=" "}return t&&(r+="Z"),r}function Py({item:e,boxWidth:t,boxPadding:r,rendWidth:n,rendHeight:i,flipXY:o}){let a="x",s="y",l=n,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=n,c=1-c);const d=(r+e.major)*l;let m=[{[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 f=U({},e.hat,{type:"path",d:ky(m)});m=[{[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[f,U({},e.hat,{type:"path",d:ky(m)})]}const jy={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,r="horizontal"===this.settings.settings.orientation,{data:n,style:i,resolver:o}=this,a=Iy({keys:Ry,data:n,defaultSettings:Ly,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a;return function({width:e,height:t,flipXY:r,resolved:n,keys:i,_calcItemRenderingOpts:o=Ny}){const a=[],{items:s}=n.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f}=o({i:l,width:e,height:t,resolved:n,keys:i,flipXY:r,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...Py({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f,flipXY:r}));const y={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(y)}return a}({items:l,settings:s,width:e,height:t,flipXY:r,resolved:a,keys:Ry})}};var Fy="unclassified",Vy="equal-equal",_y="equal-higher",zy="equal-lower",Hy="equal-void",$y="higher-equal",By="higher-higher-acute",Uy="higher-higher-obtuse",Yy="higher-lower-negative",Wy="higher-lower-positive",Gy="higher-void",Ky="lower-equal",Xy="lower-higher-negative",Jy="lower-higher-positive",Zy="lower-lower-acute",Qy="lower-lower-obtuse",eg="lower-void",tg="void-equal",rg="void-higher",ng="void-lower",ig="void-void";function og(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function ag(e,t,r){const n=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.sqrt((t.x-r.x)**2+(t.y-r.y)**2),o=Math.sqrt((r.x-e.x)**2+(r.y-e.y)**2);return Math.acos((i*i+n*n-o*o)/(2*i*n))*(180/Math.PI)}function sg({previous:e,current:t,next:r}){const n=e&&e.value,i=t&&t.value,o=r&&r.value;return e||r?e?r?n===i?i===o?Vy:i<o?_y:zy:i===o?n>i?$y:Ky:n>i?i<o?ag(e,t,r)>90?Uy:By:og(e,t)>og(e,r)?Wy:Yy:i>o?ag(e,t,r)>90?Qy:Zy:og(e,t)>og(e,r)?Jy:Xy:n===i?Hy:n>i?Gy:eg:i===o?tg:i<o?rg:ng:ig}function lg({bounds:e,size:t}){const{x:r,y:n,width:i,height:o}=e,{insideStrategy:a}=t;return"center"===a?Math.floor(r+i/2)>=0&&Math.ceil(r+i/2)<=t.width&&Math.floor(n+o/2)>=0&&Math.ceil(n+o/2)<=t.height:Math.floor(r+i)>0&&Math.ceil(r)<t.width&&Math.floor(n+o/2)>=0&&Math.ceil(n+o/2)<=t.height}const ug=1,cg=0;function dg({node:e,line:t,groupIndex:r,extract:n,style:i,measureText:o,size:a,horizontal:s,rtl:l,meta:u,showLabel:c}){const d=n.label(e.data);if("string"!=typeof d&&"number"!=typeof d||""===d)return!1;const m=o({fontFamily:i.fontFamily,fontSize:i.fontSize,text:d}),{localBounds:f}=e,{"stroke-width":p}=e.attrs,h=n.pointValue(e.data),y={x:f.x+f.width/2,y:f.y+f.height/2,width:m.width+2*ug,height:m.height+2*cg},g=`${y.x}-${y.y}`,v=!s&&!l,b=s?a.height:a.width,x=(s?y.y:y.x)/b,M=(v?1-x:x)<=(b<=200?.25:.1),S={key:g,node:e,line:t,group:r,value:h,labelMeasurements:m,bounds:y,inside:lg({bounds:f,size:a}),border:p?p/2:0,classification:Fy,setClassification(e){S.classification=e},preferences:[],setPreferences(e){S.preferences.push(...e)},placement:void 0,setPlacement(e){S.placement=e},duplicate:!1,setDuplicate(){S.duplicate=!0},extreme:u.getExtreme(g),minority:u.getMinority(g),elite:M,show:c(e)};return S}function mg({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}){const l=function({nodes:e,size:t,horizontal:r}){const n={top:[],right:[],bottom:[],left:[]},i=r?t.height:t.width,o=r?"y":"x",a=[...[.2,.4,.6,.8,1].map((e=>({threshold:e*i,count:0,distribution:0})))],s={},l=e.map((t=>{const{localBounds:r}=t,n={x:r.x+r.width/2,y:r.y+r.height/2},i=`${n.x}-${n.y}`;for(let t=0;t<a.length;t++){const r=a[t];if(n[o]<r.threshold||t===a.length-1){r.count++,r.distribution=r.count/e.length,s[i]=t;break}}return{key:i,center:n}})),u=l.reduce(((e,t)=>((!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e)),{});return n.top=l.filter((e=>e.center.y===u.top.center.y)).map((e=>e.key)),n.right=l.filter((e=>e.center.x===u.right.center.x)).map((e=>e.key)),n.bottom=l.filter((e=>e.center.y===u.bottom.center.y)).map((e=>e.key)),n.left=l.filter((e=>e.center.x===u.left.center.x)).map((e=>e.key)),{getExtrema:e=>({top:-1!==n.top.indexOf(e),right:-1!==n.right.indexOf(e),bottom:-1!==n.bottom.indexOf(e),left:-1!==n.left.indexOf(e)}),getExtreme:e=>{const{top:t,right:r,bottom:i,left:o}=n;return[t,r,i,o].some((t=>-1!==t.indexOf(e)))},getMinority:e=>a[s[e]].distribution<1}}({nodes:e,size:i,horizontal:o});return function({nodes:e,by:t,lineIndex:r}){const n=e.reduce(((e,n,i)=>{const o=t(n.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:n,line:n.data[r].value}),e}),{});return Object.keys(n).map((e=>n[e])).sort(((e,t)=>e.index-t.index)).map((e=>e.items))}({nodes:e,by:t.majorValue,lineIndex:t.lineIndex}).map(((e,u)=>e.map((e=>({line:e.line,item:dg({node:e.node,line:e.line,groupIndex:u,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,meta:l,showLabel:s})}))).filter((e=>e.item)).reduce(((e,t)=>(e[t.line]=t.item,e)),{}))).filter((e=>Object.keys(e).length))}var fg={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"},pg={[Vy]:[fg.TOP,fg.BOTTOM],[_y]:[fg.BOTTOM,fg.BOTTOM_RIGHT],[zy]:[fg.TOP,fg.TOP_RIGHT],[Hy]:[fg.TOP,fg.BOTTOM],[$y]:[fg.LEFT,fg.BOTTOM_LEFT,fg.TOP,fg.TOP_RIGHT],[By]:[fg.BOTTOM,fg.BOTTOM_LEFT,fg.LEFT,fg.TOP_RIGHT],[Uy]:[fg.BOTTOM,fg.TOP],[Yy]:[fg.TOP,fg.TOP_RIGHT,fg.RIGHT],[Wy]:[fg.BOTTOM,fg.BOTTOM_LEFT,fg.LEFT],[Gy]:[fg.TOP],[Ky]:[fg.TOP],[Xy]:[fg.TOP,fg.TOP_LEFT],[Jy]:[fg.BOTTOM_RIGHT],[Zy]:[fg.TOP,fg.TOP_LEFT,fg.LEFT,fg.TOP_RIGHT,fg.RIGHT],[Qy]:[fg.TOP,fg.BOTTOM],[eg]:[fg.TOP],[tg]:[fg.TOP],[rg]:[fg.TOP,fg.BOTTOM],[ng]:[fg.TOP,fg.BOTTOM,fg.LEFT],[ig]:[fg.TOP]};function hg({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}){const l=mg({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}),u=[...l.reduce(((e,t)=>(e.push(...Object.keys(t).map((e=>t[e]))),e)),[])],c=u.reduce(((e,t)=>(e[t.line]||(e[t.line]=0),e[t.line]++,e)),{}),d=Math.max(...Object.keys(c).map((e=>c[e]))),m=l.map((e=>Object.keys(e).map((t=>e[t])))),f={getItems:()=>u,getMaxLineDensity:()=>d,getLocalLines({index:e,reach:t}){const{lines:r}=function({groups:e,index:t,reach:r}){const n={};for(let i=t-r;i<=t+r;i++){const t=e[i];if(t)for(let e=0;e<t.length;e++){const r=t[e],{line:i}=r;n[i]||(n[i]=[]),n[i].push(r.bounds)}}const i=Object.keys(n).map((e=>n[e])),o=[];for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length-1;t++){const r=i[e][t],n=i[e][t+1],a={x1:r.x,y1:r.y,x2:n.x,y2:n.y};o.push(a)}return{lines:o}}({groups:m,index:e,reach:t});return r}};return function({groups:e}){for(let t=0;t<e.length;t++){const r=Object.keys(e[t]).map((r=>e[t][r]));for(let n=0;n<r.length;n++){const i=r[n],o=sg({previous:e[t-1]&&e[t-1][i.line],current:i,next:e[t+1]&&e[t+1][i.line]});i.setClassification(o)}}}({groups:l}),f.getItems().forEach((e=>e.setPreferences(pg[e.classification]))),f}function yg({item:e,placement:t,size:r}){return t.x>=0-r.edgeBleed.left&&t.x<=r.width-e.bounds.width+r.edgeBleed.right&&t.y>=0-r.edgeBleed.top&&t.y<=r.height-e.bounds.height}function gg({line1:e,line2:t}){const r=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(0===r)return!1;const n=((t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1))/r,i=((e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1))/r;return n>=0&&n<=1&&i>=0&&i<=1}function vg({candidate:e,lines:t,rects:r}){return!!t.some((t=>function({line:e,rect:t}){const r={x:t.x,y:t.y},n={x:t.x+t.width,y:t.y},i={x:t.x+t.width,y:t.y+t.height},o={x:t.x,y:t.y+t.height},a={x1:n.x,y1:n.y,x2:i.x,y2:i.y},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:r.x,y2:r.y};return gg({line1:e,line2:{x1:r.x,y1:r.y,x2:n.x,y2:n.y}})||gg({line1:e,line2:a})||gg({line1:e,line2:s})||gg({line1:e,line2:l})}({line:t,rect:e})))||r.some((t=>function({rect1:e,rect2:t}){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)}({rect1:t,rect2:e})))}const bg={x:0,width:0,y:0,height:0};const xg=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Mg=({item:e})=>({x:e.bounds.x,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Sg=({item:e})=>({x:e.bounds.x+e.node.localBounds.width/2+e.border,y:e.bounds.y-e.bounds.height/2}),Eg=({item:e})=>({x:e.bounds.x,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Cg=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y+e.node.localBounds.height/2+e.border}),qg=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Og=({item:e})=>({x:e.bounds.x-e.bounds.width-e.node.localBounds.width/2-e.border,y:e.bounds.y-e.bounds.height/2}),Ag=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border});var Dg=2.5,Ng=4;const Ig=[fg.TOP,fg.TOP_LEFT,fg.TOP_RIGHT],Tg=[fg.BOTTOM,fg.BOTTOM_LEFT,fg.BOTTOM_RIGHT];function wg({position:e}){const t={x:Dg,width:-2*Dg,y:0,height:0},r=Ig.indexOf(e)>-1,n=Tg.indexOf(e)>-1;return r&&(t.y=Ng,t.height=-Ng),n&&(t.height=-Ng),t}function Lg({cx:e,cy:t,r:r,degrees:n}){const i=n*(Math.PI/180);return{x:Math.round(e+r*Math.sin(i)),y:Math.round(t+r*-Math.cos(i))}}function Rg({coordinates:e,degrees:t,item:r}){const n={x:e.x,y:e.y};return t<=90?n.y-=r.bounds.height:t>180&&t<=270?n.x-=r.bounds.width:t>270&&(n.y-=r.bounds.height,n.x-=r.bounds.width),n}function kg({item:e,validator:t,force:r=!1}){const n=function({item:e}){return[e.node.localBounds.height/2*Math.sqrt(2)]}({item:e}),i=e.bounds.x,o=e.bounds.y;for(let a=0;a<n.length;a++){const s=n[a];for(let n=40;n<=180;n+=15){const a=Rg({coordinates:Lg({cx:i,cy:o,r:s,degrees:n}),degrees:n,item:e});if(t({item:e,placement:a,ignoreLines:r}).valid)return a}for(let n=320;n>180;n-=15){const a=Rg({coordinates:Lg({cx:i,cy:o,r:s,degrees:n}),degrees:n,item:e});if(t({item:e,placement:a,ignoreLines:r}).valid)return a}}return!1}function Pg({item:e,validator:t,force:r=!1}){const n=[...e.preferences,...Object.keys(fg).map((e=>fg[e])).filter((t=>-1===e.preferences.indexOf(t)))],i={[fg.TOP]:xg,[fg.TOP_RIGHT]:Mg,[fg.RIGHT]:Sg,[fg.BOTTOM_RIGHT]:Eg,[fg.BOTTOM]:Cg,[fg.BOTTOM_LEFT]:qg,[fg.LEFT]:Og,[fg.TOP_LEFT]:Ag},o=[];for(let a=0;a<n.length;a++){const s=n[a],l=i[s]({item:e}),u=wg({position:s}),c=t({item:e,placement:l,adjustment:u,ignoreLines:r});if(r&&c.inside&&o.push(l),c.valid)return l}const a=()=>kg({item:e,validator:t,force:r});if(r){const e=a();return e||(o[0]||undefined)}return(e.extreme||e.elite)&&a()||undefined}function jg({model:e,itemSize:t,connect:r,size:n,all:i}){const o={},a=function({model:e}){const{length:t}=e.getItems();return t>1e3}({model:e}),s=function({model:e,itemSize:t,connect:r,size:n}){const i=e.getItems(),o=Math.max(...i.map((e=>e.labelMeasurements.width))),a=t||n.width/i.length,s=Math.ceil(o/a)+1;return r?Math.max(s,e.getMaxLineDensity()):s}({model:e,itemSize:t,connect:r,size:n}),l=e.getItems(),u=[...l.map((e=>({x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2})))],c=[];l.forEach((t=>{const{data:r}=t.node;if(!t.show||!t.inside||r.null&&r.null.value||r.interpolated&&r.interpolated.value)return;if(a&&!t.minority)return;const{key:l}=t;if(o[l])return void t.setDuplicate();o[l]=!0;const d=function({size:e,lines:t,placements:r}){return function({item:n,placement:i,adjustment:o=bg,ignoreLines:a=!1}){const s={inside:yg({item:n,placement:i,size:e}),collides:!0,valid:!1};return s.inside?(s.collides=vg({candidate:{x:i.x+o.x,y:i.y+o.y,width:n.bounds.width+o.width,height:n.bounds.height+o.height},lines:a?[]:t,rects:r}),s.valid=s.inside&&!s.collides,s):s}}({size:n,lines:e.getLocalLines({index:t.group,reach:s}),placements:u}),m=Pg({item:t,validator:d});m?(m.height=t.bounds.height,m.width=t.bounds.width,u.push(m),t.setPlacement(m)):i&&c.push({item:t,validator:d})})),c.forEach((e=>{const{item:t,validator:r}=e,n=Pg({item:t,validator:r,force:!0});n&&(n.height=t.bounds.height,n.width=t.bounds.width,u.push(n),t.setPlacement(n))}))}var Fg={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,itemSize:()=>{},connect:!1,all:!1,label:()=>{},showLabel:()=>!0,pointValue:()=>{},majorValue:()=>{},target:{labelSpace:"label-space-component",point:"point-component",allPoints:[]},lineIndex:"line",insideStrategy:"edge"},style:{fontFamily:"QlikView Sans, sans-serif",fontSize:"12px",fill:"#333"}},preferredSize(){const e={edgeBleed:{top:0,right:0,left:0}},t=this.chart.component(this.settings.settings.target.labelSpace);if(!t||!t.rect)return e;const{orientation:r,rtl:n}=this.settings.settings,i="horizontal"===r;if(t.show(n)){const{size:r}=t.settings.settings;e.edgeBleed.top=i?r:0,e.edgeBleed[n?"left":"right"]=i?0:r}return e},render(){if(!this.chart.component(this.settings.settings.target.point))return[];const e=this.settings.settings.target.allPoints.length?e=>this.settings.settings.target.allPoints.includes(e.key):e=>e.key===this.settings.settings.target.point,t=this.chart.findShapes("circle").filter(e);if(!t.length)return[];const{settings:r}=this.settings,n={label:r.label,pointValue:r.pointValue,majorValue:r.majorValue,lineIndex:r.lineIndex},{height:i,width:o,edgeBleed:a}=this.rect,s={height:i,width:o,edgeBleed:a,insideStrategy:r.insideStrategy},{style:l}=this,u=hg({nodes:t,extract:n,style:l,measureText:this.renderer.measureText,size:s,horizontal:"horizontal"===r.orientation,rtl:r.rtl,showLabel:r.showLabel});return function({model:e}){e.getItems().sort(((e,t)=>e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1))}({model:u}),jg({model:u,itemSize:r.itemSize(),connect:r.connect,size:s,all:r.all}),u.getItems().filter((e=>e.placement&&e.node.key===this.settings.settings.target.point)).map((e=>({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2,fontSize:l.fontSize,fontFamily:l.fontFamily,fill:l.fill,text:n.label(e.node.data),baseline:"central",anchor:"middle"})))}},Vg={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};var _g={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",primaryExtremum:()=>{},secondaryExtremum:()=>{},primarySeries:[],secondarySeries:[],orientation:"horizontal",rtl:!1,major:{scale:"major-scale"},markerOffset:1,size:10},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e=[]}=this.data;if(!e.length)return[];const{type:t,orientation:r,rtl:n,markerOffset:i,size:o,major:a,primarySeries:s,secondarySeries:l}=this.settings.settings,u=this.settings.settings.primaryExtremum(),c=this.settings.settings.secondaryExtremum(),d=s.length&&void 0!==u,m=l.length&&void 0!==c;if(!d&&!m)return[];const f=s.map((e=>e.ref)),p=l.map((e=>e.ref)),h=function({type:e,primaryExtremum:t,secondaryExtremum:r,primaryItems:n=[],secondaryItems:i=[],primarySeries:o=[],secondarySeries:a=[]}){const s=[];return[...o,...a].forEach((o=>{const a=o.isPrimary?t:r,l=o.isPrimary?n:i;s.push((({type:e,extremum:t,separateStacking:r,items:n})=>{const i="max"===e?e=>e>t:e=>e<t,o=r?e=>i(e.point.value<0?e.start.value:e.end.value):e=>i(e.end.value);return n.filter(o)})({type:e,extremum:a,items:l}))})),(({items:e})=>{const t=[],r=[];return e.forEach((e=>{const{value:n}=e.major;t[n]||(t[n]=!0,r.push(e))})),r})({items:s.reduce(((e,t)=>e.concat(t)),[])})}({type:t,primaryExtremum:u,secondaryExtremum:c,primaryItems:e.filter((e=>f.includes(e.end.source.field))),secondaryItems:e.filter((e=>p.includes(e.end.source.field))),primarySeries:s,secondarySeries:l});if(!h.length)return[];const y="horizontal"===r,g=this.rect[y?"width":"height"],v=this.resolver.resolve({data:{items:h},settings:{major:a},scaled:{major:g}}),b=("max"===t?90:-90)-(y?0:90)-(!y&&n?180:0),x=o/2*i,{fill:M}=this.settings.style;return v.items.map((e=>function({symbol:e,size:t,fill:r,startAngle:n,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:r,stroke:"#205891",strokeWidth:0,sides:3,startAngle:n,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:o,fill:M,startAngle:b,x:y?g*e.major:x,y:y?x:g*e.major,data:e.data})))}};function zg({x:e,y:t,size:r,stroke:n,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:n||o,strokeWidth:i,x1:e-r/2,y1:t,x2:e+r/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*r}]}}function Hg({chart:e,seriesInfo:t}){const r={primary:{paths:[],map:{}},secondary:{paths:[],map:{}}},n=[...t.primary.map((e=>e.key)),...t.secondary.map((e=>e.key))];return e.findShapes("path").filter((e=>n.some((t=>t===e.key)))).reduce(((e,r)=>((t.primary.some((e=>e.key===r.key))?e.primary:e.secondary).paths.push(r),e)),r),{getLine:(e,t)=>{const n=t?r.primary:r.secondary;if(!n.map[e]){const[t]=n.paths.filter((t=>t.data&&t.data.typeIndex.value===e));n.map[e]=t}return n.map[e]}}}function $g({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function Bg({brush:e,chart:t}){const r=e.brush.ranges();if(!r.length)return!1;const n=t&&t.scale(ea.SCALE.MAJOR),i=n&&n.max&&n.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return r.some((t=>t.min<=e&&o(e,t.max)))}}function Ug({brush:e,selectionInfo:t,items:r,selectionValues:n,colorByData:i,chart:o}){const a=e.brushes();if(!a.length)return[];const s=a[0],{minorRange:l,legendRange:u,legendTap:c}=t,d=0===s.id.indexOf("qHyperCube/qMeasureInfo/")?"qHyperCube/qMeasureInfo/X":s.id;let m=[u?e=>e.color.value:n[d]].filter(Boolean);if(i&&l&&m.push((e=>e.color.value)),!i&&c&&(m=[e=>e.color.value]),!m.length)return[];const f=function({brush:e,chart:t}){return("value"===e.type?$g:Bg)({brush:e,chart:t})}({brush:s,chart:o});return f?r.reduce(((e,t,r)=>(m.some((e=>f({value:e(t)})))&&e.push({item:t,index:r}),e)),[]):[]}function Yg({chart:e,selected:t,connection:r,gradient:n,fallback:i}){const o=e.scale(ea.SCALE.COLOR),a=t.filter((e=>-1!==r.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e)))||i,offset:Math.min(1,Math.max(0,(e-s)/c))}))),m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:h}}function Wg({chart:e,selected:t,connection:r,gradient:n,fallback:i}){const o=e.scale(ea.SCALE.COLOR),a=t.filter((e=>-1!==r.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a)-s,u=0===l?1:l,c=o.domain(),d=[];for(let e=0;e<c.length-1;e++){const t=c[e],r=o(t)||i;d.push({color:r,offset:Math.min(1,Math.max(0,(t-s)/u))});const n=c[e+1];d.push({color:r,offset:Math.min(1,Math.max(0,(n-s)/u))})}const m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:h}}function Gg({property:e,chart:t,connection:r,attrs:n,colorSettings:i,colorByData:o,selected:a,hasMultipleMeasures:s,groupedByMeasure:l,itemsPerGroup:u,orientation:c,rtl:d}){const m=n[e];if("gradient"!==m.type)return m;const{type:f,nil:p}=i;if(s||!o)return function({chart:e,selected:t,connection:r,gradient:n,fallback:i,orientation:o,isColorCode:a,groupedByMeasure:s,itemsPerGroup:l,rtl:u}){const c=e.scale(ea.SCALE.MAJOR),d=e.scale(ea.SCALE.COLOR),m=s?e=>c([e,0])+c.bandwidth()*l/2:e=>c(e),f=t.filter((e=>-1!==r.indexOf(e.index))),p=("vertical"===o&&u?f.reverse():f).map((e=>e.item)),h=p.map((e=>m(e.major.value))),y=Math.min(...h),g=Math.max(...h)-y,v=0===g?1:g,b=h.map(((e,t)=>0===t?0:t===h.length-1?1:(e-y)/v)),x=[];for(let e=0;e<p.length;e++){const t=p[e],r=a?t.color.value:d(t.color.value)||i,n=b[e];x.push({color:r,offset:0===e?0:Math.max(0,x[x.length-1].offset)}),x.push({color:r,offset:e===p.length-1?1:Math.max(0,parseFloat((n+(b[e+1]-n)/2).toFixed(5)))})}return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:x}}({chart:t,selected:a,connection:r,gradient:m,fallback:p,orientation:c,isColorCode:"color"===f,groupedByMeasure:l,itemsPerGroup:u,rtl:d});return("continuous"===f?Yg:Wg)({chart:t,selected:a,connection:r,gradient:m,fallback:p})}function Kg({chart:e,pathModel:t,colorSettings:r,colorByData:n,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:u,selected:c,connections:d,rtl:m,count:f}){const p=t.getLine(l,u),{attrs:h}=p,y=function({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map((e=>{const t=e.substring(0,1),r={letter:t,x:0,y:0,raw:e},n=e.substring(1).split(",");return"M"===t||"L"===t?([r.x]=n,[,r.y]=n):"C"===t&&([,,,,r.x]=n,[,,,,,r.y]=n),r}))}({d:h.d});return d.map((t=>function({chart:e,colorSettings:t,colorByData:r,hasMultipleMeasures:n,groupedByMeasure:i,itemsPerGroup:o,orientation:a,selected:s,connection:l,commands:u,attrs:c,rtl:d,count:m}){return{path:l.map(((e,t)=>{const r=u[e];return 0!==t||"M"===r.letter?r.raw:`M${r.x},${r.y}`})).join(""),attrs:c,stroke:Gg({property:"stroke",chart:e,connection:l,attrs:c,selected:s,colorSettings:t,colorByData:r,hasMultipleMeasures:n,groupedByMeasure:i,itemsPerGroup:o,orientation:a,rtl:d,count:m})}}({chart:e,colorSettings:r,colorByData:n,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,selected:c,connection:t,commands:y,attrs:h,rtl:m,count:f})))}function Xg({chart:e,pathModel:t,seriesInfo:r,brush:n,selectionInfo:i,items:o,selectionValues:a,colorSettings:s,colorByData:l,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,rtl:f}){const p=function({items:e,seriesInfo:t}){const r=e.reduce(((e,r,n)=>{const i=r.typeIndex.value;var o;return e[i]||(e[i]={key:i,items:[],index:n,measureIx:null===(o=r.colorMeasureIdx)||void 0===o?void 0:o.value,primary:t.primary.some((e=>e.typeIndex===i))}),e[i].items.push(r),e}),{});return Object.keys(r).map((e=>r[e])).sort(((e,t)=>e.index-t.index)).map((e=>({lineKey:e.key,items:e.items,primary:e.primary,measureIx:e.measureIx})))}({items:function({items:e,selectionInfo:t,seriesInfo:r}){return e.filter((e=>{if("NaN"===e.end.value||Number.isNaN(e.end.value))return!1;const{minorRange:n,minorRangePrimary:i}=t;return!n||(i?r.primary:r.secondary).some((t=>t.typeIndex===e.typeIndex.value))}))}({items:o,selectionInfo:i,seriesInfo:r}),seriesInfo:r}),{lines:h}=p.reduce(((r,o)=>{const p=Ug({brush:n,selectionInfo:i,items:o.items,selectionValues:a,colorByData:l,chart:e});if(p.length<2)return r;const h=function({selected:e}){return e.reduce(((e,t)=>{const{index:r}=t;if(e.length){const t=e[e.length-1];r===t[t.length-1]+1?t.push(r):e.push([r])}else e.push([r]);return e}),[]).filter((e=>e.length>1))}({selected:p});return h.length?(r.lines.push(...Kg({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,lineKey:o.lineKey,primary:o.primary,selected:p,connections:h,rtl:f,count:o.items.length})),r):r}),{lines:[]}),y=[];return h.forEach((e=>y.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"}))),y}var Jg={require:["chart","renderer"],defaultSettings:{settings:{seriesInfo:{primary:[],secondary:[]},selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,groupedByMeasure:!1,itemsPerGroup:1,orientation:"vertical",rtl:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach((e=>this.state.brush.removeListener(e.type,e.fn))),this.state.listeners.length=0},created(){this.state={pathModel:Hg({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),brush:this.chart.brush("selection"),listeners:[],selectionInfo:{minorRange:!1,minorRangePrimary:!1,legendRange:!1,legendTap:!1}}},mounted(){this.addListener("update",(()=>{this.state.selectionInfo=this.settings.settings.getSelectionInfo();const e=Xg({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl});this.renderer.render(e)})),this.addListener("end",(()=>{this.renderer.render([])}))},render(){this.state.pathModel=Hg({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),this.state.selectionInfo=this.settings.settings.getSelectionInfo();return Xg({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl})},destroyed(){this.removeListeners()}};const Zg="QlikView Sans, sans-serif";var Qg=[["object.comboChart","","fontFamily"],["object.comboChart","outOfRange","color","#999"],["object.comboChart","axis.title","color"],["object.comboChart","axis.title","fontSize","13px"],["object.comboChart","axis.title","fontFamily",Zg],["object.comboChart","axis.label.name","color","#595959"],["object.comboChart","axis.label.name","fontSize","12px"],["object.comboChart","axis.label.name","fontFamily",Zg],["object.comboChart","axis.line.major","color","#cccccc"],["object.comboChart","axis.line.minor","color","#e6e6e6"],["object.comboChart","label.value","fontFamily",Zg],["object.comboChart","label.value","fontSize","12px"],["object.comboChart","label.value","numFontSize","12px",e=>parseInt(e,10)],["object.comboChart","label.value","color","#595959"],[!1,"label.value","lightColor","#E6E6E6"],[!1,"label.value","darkColor","#595959"]];const ev={line:"bar",circle:"circle",diamond:"diamond",triangle:"triangle",rect:"square"},tv=e=>void 0===e.marker?ev.circle:ev[e.marker],rv=e=>void 0===e.markerFill||e.markerFill;function nv({series:e,layoutService:t}){switch(Lf(e)){case ta.MARKER:return(e=>({marker:tv(e),fill:rv(e)}))(e);case ta.LINE:return(e=>{const t=e.getLayoutValue("nullMode","gap");return{showAsGaps:"gap"===t,showAsConnections:"connect"===t,showAsZeros:"zero"===t}})(t);default:return{}}}function iv(e=na,t){return t?e.axis===ra.PRIMARY:e.axis===ra.PRIMARY||Lf(e)===ta.BAR}var ov={exports:{}};var av={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var sv="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=av,n=sv,i=(t=e.exports={}).re=[],o=t.src=[],a=t.t={};let s=0;const l=(e,t,r)=>{const l=s++;n(l,t),a[e]=l,o[l]=t,i[l]=new RegExp(t,r?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION",`(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${o[a.NUMERICIDENTIFIER]}|${o[a.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${o[a.NUMERICIDENTIFIERLOOSE]}|${o[a.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${o[a.PRERELEASEIDENTIFIER]}(?:\\.${o[a.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${o[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[a.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD",`(?:\\+(${o[a.BUILDIDENTIFIER]}(?:\\.${o[a.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${o[a.MAINVERSION]}${o[a.PRERELEASE]}?${o[a.BUILD]}?`),l("FULL",`^${o[a.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${o[a.MAINVERSIONLOOSE]}${o[a.PRERELEASELOOSE]}?${o[a.BUILD]}?`),l("LOOSE",`^${o[a.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",o[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),l("XRANGEIDENTIFIER",o[a.NUMERICIDENTIFIER]+"|x|X|\\*"),l("XRANGEPLAIN",`[v=\\s]*(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:${o[a.PRERELEASE]})?${o[a.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:${o[a.PRERELEASELOOSE]})?${o[a.BUILD]}?)?)?`),l("XRANGE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",o[a.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${o[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${o[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${o[a.LONECARET]}${o[a.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${o[a.LONECARET]}${o[a.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${o[a.GTLT]}\\s*(${o[a.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]}|${o[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${o[a.XRANGEPLAIN]})\\s+-\\s+(${o[a.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${o[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[a.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0.0.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}(ov,ov.exports);const lv=["includePrerelease","loose","rtl"];var uv=e=>e?"object"!=typeof e?{loose:!0}:lv.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const cv=/^[0-9]+$/,dv=(e,t)=>{const r=cv.test(e),n=cv.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var mv={compareIdentifiers:dv,rcompareIdentifiers:(e,t)=>dv(t,e)};const fv=sv,{MAX_LENGTH:pv,MAX_SAFE_INTEGER:hv}=av,{re:yv,t:gv}=ov.exports,vv=uv,{compareIdentifiers:bv}=mv;class xv{constructor(e,t){if(t=vv(t),e instanceof xv){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>pv)throw new TypeError(`version is longer than ${pv} characters`);fv("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?yv[gv.LOOSE]:yv[gv.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>hv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hv||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<hv)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(e){if(fv("SemVer.compare",this.version,this.options,e),!(e instanceof xv)){if("string"==typeof e&&e===this.version)return 0;e=new xv(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof xv||(e=new xv(e,this.options)),bv(this.major,e.major)||bv(this.minor,e.minor)||bv(this.patch,e.patch)}comparePre(e){if(e instanceof xv||(e=new xv(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(fv("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return bv(r,n)}while(++t)}compareBuild(e){e instanceof xv||(e=new xv(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(fv("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return bv(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}var Mv=xv;const{MAX_LENGTH:Sv}=av,{re:Ev,t:Cv}=ov.exports,qv=Mv,Ov=uv;var Av=(e,t)=>{if(t=Ov(t),e instanceof qv)return e;if("string"!=typeof e)return null;if(e.length>Sv)return null;if(!(t.loose?Ev[Cv.LOOSE]:Ev[Cv.FULL]).test(e))return null;try{return new qv(e,t)}catch(e){return null}};const Dv=Av;var Nv=(e,t)=>{const r=Dv(e,t);return r?r.version:null};const Iv=Av;var Tv=(e,t)=>{const r=Iv(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const wv=Mv;var Lv=(e,t,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new wv(e,r).inc(t,n).version}catch(e){return null}};const Rv=Mv;var kv=(e,t,r)=>new Rv(e,r).compare(new Rv(t,r));const Pv=kv;var jv=(e,t,r)=>0===Pv(e,t,r);const Fv=Av,Vv=jv;var _v=(e,t)=>{if(Vv(e,t))return null;{const r=Fv(e),n=Fv(t),i=r.prerelease.length||n.prerelease.length,o=i?"pre":"",a=i?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==n[e])return o+e;return a}};const zv=Mv;var Hv=(e,t)=>new zv(e,t).major;const $v=Mv;var Bv=(e,t)=>new $v(e,t).minor;const Uv=Mv;var Yv=(e,t)=>new Uv(e,t).patch;const Wv=Av;var Gv=(e,t)=>{const r=Wv(e,t);return r&&r.prerelease.length?r.prerelease:null};const Kv=kv;var Xv=(e,t,r)=>Kv(t,e,r);const Jv=kv;var Zv=(e,t)=>Jv(e,t,!0);const Qv=Mv;var eb=(e,t,r)=>{const n=new Qv(e,r),i=new Qv(t,r);return n.compare(i)||n.compareBuild(i)};const tb=eb;var rb=(e,t)=>e.sort(((e,r)=>tb(e,r,t)));const nb=eb;var ib=(e,t)=>e.sort(((e,r)=>nb(r,e,t)));const ob=kv;var ab=(e,t,r)=>ob(e,t,r)>0;const sb=kv;var lb=(e,t,r)=>sb(e,t,r)<0;const ub=kv;var cb=(e,t,r)=>0!==ub(e,t,r);const db=kv;var mb=(e,t,r)=>db(e,t,r)>=0;const fb=kv;var pb=(e,t,r)=>fb(e,t,r)<=0;const hb=jv,yb=cb,gb=ab,vb=mb,bb=lb,xb=pb;var Mb=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return hb(e,r,n);case"!=":return yb(e,r,n);case">":return gb(e,r,n);case">=":return vb(e,r,n);case"<":return bb(e,r,n);case"<=":return xb(e,r,n);default:throw new TypeError("Invalid operator: "+t)}};const Sb=Mv,Eb=Av,{re:Cb,t:qb}=ov.exports;var Ob=(e,t)=>{if(e instanceof Sb)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=Cb[qb.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),Cb[qb.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;Cb[qb.COERCERTL].lastIndex=-1}else r=e.match(Cb[qb.COERCE]);return null===r?null:Eb(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)},Ab=Db;function Db(e){var t=this;if(t instanceof Db||(t=new Db),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}function Nb(e,t,r){var n=t===e.head?new wb(r,null,t,e):new wb(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function Ib(e,t){e.tail=new wb(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Tb(e,t){e.head=new wb(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function wb(e,t,r,n){if(!(this instanceof wb))return new wb(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}Db.Node=wb,Db.create=Db,Db.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Db.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Db.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Db.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ib(this,arguments[e]);return this.length},Db.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Tb(this,arguments[e]);return this.length},Db.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Db.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Db.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},Db.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},Db.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},Db.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},Db.prototype.map=function(e,t){t=t||this;for(var r=new Db,n=this.head;null!==n;)r.push(e.call(t,n.value,this)),n=n.next;return r},Db.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Db,n=this.tail;null!==n;)r.push(e.call(t,n.value,this)),n=n.prev;return r},Db.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},Db.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},Db.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},Db.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},Db.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Db;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;for(;null!==i&&n<t;n++,i=i.next)r.push(i.value);return r},Db.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Db;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;null!==i&&n>t;n--)i=i.prev;for(;null!==i&&n>e;n--,i=i.prev)r.push(i.value);return r},Db.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<r.length;n++)i=Nb(this,i,r[n]);return o},Db.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{require("./iterator.js")(Db)}catch(Kd){}const Lb=Ab,Rb=Symbol("max"),kb=Symbol("length"),Pb=Symbol("lengthCalculator"),jb=Symbol("allowStale"),Fb=Symbol("maxAge"),Vb=Symbol("dispose"),_b=Symbol("noDisposeOnSet"),zb=Symbol("lruList"),Hb=Symbol("cache"),$b=Symbol("updateAgeOnGet"),Bb=()=>1;const Ub=(e,t,r)=>{const n=e[Hb].get(t);if(n){const t=n.value;if(Yb(e,t)){if(Gb(e,n),!e[jb])return}else r&&(e[$b]&&(n.value.now=Date.now()),e[zb].unshiftNode(n));return t.value}},Yb=(e,t)=>{if(!t||!t.maxAge&&!e[Fb])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Fb]&&r>e[Fb]},Wb=e=>{if(e[kb]>e[Rb])for(let t=e[zb].tail;e[kb]>e[Rb]&&null!==t;){const r=t.prev;Gb(e,t),t=r}},Gb=(e,t)=>{if(t){const r=t.value;e[Vb]&&e[Vb](r.key,r.value),e[kb]-=r.length,e[Hb].delete(r.key),e[zb].removeNode(t)}};class Kb{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const Xb=(e,t,r,n)=>{let i=r.value;Yb(e,i)&&(Gb(e,r),e[jb]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Jb=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[Rb]=e.max||1/0;const t=e.length||Bb;if(this[Pb]="function"!=typeof t?Bb:t,this[jb]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[Fb]=e.maxAge||0,this[Vb]=e.dispose,this[_b]=e.noDisposeOnSet||!1,this[$b]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[Rb]=e||1/0,Wb(this)}get max(){return this[Rb]}set allowStale(e){this[jb]=!!e}get allowStale(){return this[jb]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[Fb]=e,Wb(this)}get maxAge(){return this[Fb]}set lengthCalculator(e){"function"!=typeof e&&(e=Bb),e!==this[Pb]&&(this[Pb]=e,this[kb]=0,this[zb].forEach((e=>{e.length=this[Pb](e.value,e.key),this[kb]+=e.length}))),Wb(this)}get lengthCalculator(){return this[Pb]}get length(){return this[kb]}get itemCount(){return this[zb].length}rforEach(e,t){t=t||this;for(let r=this[zb].tail;null!==r;){const n=r.prev;Xb(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[zb].head;null!==r;){const n=r.next;Xb(this,e,r,t),r=n}}keys(){return this[zb].toArray().map((e=>e.key))}values(){return this[zb].toArray().map((e=>e.value))}reset(){this[Vb]&&this[zb]&&this[zb].length&&this[zb].forEach((e=>this[Vb](e.key,e.value))),this[Hb]=new Map,this[zb]=new Lb,this[kb]=0}dump(){return this[zb].map((e=>!Yb(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[zb]}set(e,t,r){if((r=r||this[Fb])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,i=this[Pb](t,e);if(this[Hb].has(e)){if(i>this[Rb])return Gb(this,this[Hb].get(e)),!1;const o=this[Hb].get(e).value;return this[Vb]&&(this[_b]||this[Vb](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[kb]+=i-o.length,o.length=i,this.get(e),Wb(this),!0}const o=new Kb(e,t,i,n,r);return o.length>this[Rb]?(this[Vb]&&this[Vb](e,t),!1):(this[kb]+=o.length,this[zb].unshift(o),this[Hb].set(e,this[zb].head),Wb(this),!0)}has(e){if(!this[Hb].has(e))return!1;const t=this[Hb].get(e).value;return!Yb(this,t)}get(e){return Ub(this,e,!0)}peek(e){return Ub(this,e,!1)}pop(){const e=this[zb].tail;return e?(Gb(this,e),e.value):null}del(e){Gb(this,this[Hb].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[Hb].forEach(((e,t)=>Ub(this,t,!1)))}};class Zb{constructor(e,t){if(t=tx(t),e instanceof Zb)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Zb(e.raw,t);if(e instanceof rx)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!cx(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&dx(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=ex.get(t);if(r)return r;const n=this.options.loose,i=n?ox[ax.HYPHENRANGELOOSE]:ox[ax.HYPHENRANGE];e=e.replace(i,Ex(this.options.includePrerelease)),nx("hyphen replace",e),e=e.replace(ox[ax.COMPARATORTRIM],sx),nx("comparator trim",e,ox[ax.COMPARATORTRIM]),e=(e=(e=e.replace(ox[ax.TILDETRIM],lx)).replace(ox[ax.CARETTRIM],ux)).split(/\s+/).join(" ");const o=n?ox[ax.COMPARATORLOOSE]:ox[ax.COMPARATOR],a=e.split(" ").map((e=>fx(e,this.options))).join(" ").split(/\s+/).map((e=>Sx(e,this.options))).filter(this.options.loose?e=>!!e.match(o):()=>!0).map((e=>new rx(e,this.options)));a.length;const s=new Map;for(const e of a){if(cx(e))return[e];s.set(e.value,e)}s.size>1&&s.has("")&&s.delete("");const l=[...s.values()];return ex.set(t,l),l}intersects(e,t){if(!(e instanceof Zb))throw new TypeError("a Range is required");return this.set.some((r=>mx(r,t)&&e.set.some((e=>mx(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new ix(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(Cx(this.set[t],e,this.options))return!0;return!1}}var Qb=Zb;const ex=new Jb({max:1e3}),tx=uv,rx=Ax,nx=sv,ix=Mv,{re:ox,t:ax,comparatorTrimReplace:sx,tildeTrimReplace:lx,caretTrimReplace:ux}=ov.exports,cx=e=>"<0.0.0-0"===e.value,dx=e=>""===e.value,mx=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},fx=(e,t)=>(nx("comp",e,t),e=gx(e,t),nx("caret",e),e=hx(e,t),nx("tildes",e),e=bx(e,t),nx("xrange",e),e=Mx(e,t),nx("stars",e),e),px=e=>!e||"x"===e.toLowerCase()||"*"===e,hx=(e,t)=>e.trim().split(/\s+/).map((e=>yx(e,t))).join(" "),yx=(e,t)=>{const r=t.loose?ox[ax.TILDELOOSE]:ox[ax.TILDE];return e.replace(r,((t,r,n,i,o)=>{let a;return nx("tilde",e,t,r,n,i,o),px(r)?a="":px(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:px(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(nx("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,nx("tilde return",a),a}))},gx=(e,t)=>e.trim().split(/\s+/).map((e=>vx(e,t))).join(" "),vx=(e,t)=>{nx("caret",e,t);const r=t.loose?ox[ax.CARETLOOSE]:ox[ax.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,a)=>{let s;return nx("caret",e,t,r,i,o,a),px(r)?s="":px(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:px(o)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(nx("replaceCaret pr",a),s="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(nx("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),nx("caret return",s),s}))},bx=(e,t)=>(nx("replaceXRanges",e,t),e.split(/\s+/).map((e=>xx(e,t))).join(" ")),xx=(e,t)=>{e=e.trim();const r=t.loose?ox[ax.XRANGELOOSE]:ox[ax.XRANGE];return e.replace(r,((r,n,i,o,a,s)=>{nx("xRange",e,r,n,i,o,a,s);const l=px(i),u=l||px(o),c=u||px(a),d=c;return"="===n&&d&&(n=""),s=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(s="-0"),r=`${n+i}.${o}.${a}${s}`):u?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:c&&(r=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`),nx("xRange return",r),r}))},Mx=(e,t)=>(nx("replaceStars",e,t),e.trim().replace(ox[ax.STAR],"")),Sx=(e,t)=>(nx("replaceGTE0",e,t),e.trim().replace(ox[t.includePrerelease?ax.GTE0PRE:ax.GTE0],"")),Ex=e=>(t,r,n,i,o,a,s,l,u,c,d,m,f)=>`${r=px(n)?"":px(i)?`>=${n}.0.0${e?"-0":""}`:px(o)?`>=${n}.${i}.0${e?"-0":""}`:a?">="+r:`>=${r}${e?"-0":""}`} ${l=px(u)?"":px(c)?`<${+u+1}.0.0-0`:px(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:"<="+l}`.trim(),Cx=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(nx(e[r].semver),e[r].semver!==rx.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},qx=Symbol("SemVer ANY");class Ox{static get ANY(){return qx}constructor(e,t){if(t=Dx(t),e instanceof Ox){if(e.loose===!!t.loose)return e;e=e.value}wx("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===qx?this.value="":this.value=this.operator+this.semver.version,wx("comp",this)}parse(e){const t=this.options.loose?Nx[Ix.COMPARATORLOOSE]:Nx[Ix.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new Lx(r[2],this.options.loose):this.semver=qx}toString(){return this.value}test(e){if(wx("Comparator.test",e,this.options.loose),this.semver===qx||e===qx)return!0;if("string"==typeof e)try{e=new Lx(e,this.options)}catch(e){return!1}return Tx(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ox))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new Rx(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new Rx(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=Tx(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=Tx(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||i&&o||a||s}}var Ax=Ox;const Dx=uv,{re:Nx,t:Ix}=ov.exports,Tx=Mb,wx=sv,Lx=Mv,Rx=Qb,kx=Qb;var Px=(e,t,r)=>{try{t=new kx(t,r)}catch(e){return!1}return t.test(e)};const jx=Qb;var Fx=(e,t)=>new jx(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Vx=Mv,_x=Qb;var zx=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _x(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new Vx(n,r)))})),n};const Hx=Mv,$x=Qb;var Bx=(e,t,r)=>{let n=null,i=null,o=null;try{o=new $x(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new Hx(n,r)))})),n};const Ux=Mv,Yx=Qb,Wx=ab;var Gx=(e,t)=>{e=new Yx(e,t);let r=new Ux("0.0.0");if(e.test(r))return r;if(r=new Ux("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let i=null;n.forEach((e=>{const t=new Ux(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Wx(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})),!i||r&&!Wx(r,i)||(r=i)}return r&&e.test(r)?r:null};const Kx=Qb;var Xx=(e,t)=>{try{return new Kx(e,t).range||"*"}catch(e){return null}};const Jx=Mv,Zx=Ax,{ANY:Qx}=Zx,eM=Qb,tM=Px,rM=ab,nM=lb,iM=pb,oM=mb;var aM=(e,t,r,n)=>{let i,o,a,s,l;switch(e=new Jx(e,n),t=new eM(t,n),r){case">":i=rM,o=iM,a=nM,s=">",l=">=";break;case"<":i=nM,o=oM,a=rM,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tM(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const u=t.set[r];let c=null,d=null;if(u.forEach((e=>{e.semver===Qx&&(e=new Zx(">=0.0.0")),c=c||e,d=d||e,i(e.semver,c.semver,n)?c=e:a(e.semver,d.semver,n)&&(d=e)})),c.operator===s||c.operator===l)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===l&&a(e,d.semver))return!1}return!0};const sM=aM;var lM=(e,t,r)=>sM(e,t,">",r);const uM=aM;var cM=(e,t,r)=>uM(e,t,"<",r);const dM=Qb;var mM=(e,t,r)=>(e=new dM(e,r),t=new dM(t,r),e.intersects(t));const fM=Px,pM=kv;const hM=Qb,yM=Ax,{ANY:gM}=yM,vM=Px,bM=kv,xM=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===gM){if(1===t.length&&t[0].semver===gM)return!0;e=r.includePrerelease?[new yM(">=0.0.0-0")]:[new yM(">=0.0.0")]}if(1===t.length&&t[0].semver===gM){if(r.includePrerelease)return!0;t=[new yM(">=0.0.0")]}const n=new Set;let i,o,a,s,l,u,c;for(const t of e)">"===t.operator||">="===t.operator?i=MM(i,t,r):"<"===t.operator||"<="===t.operator?o=SM(o,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&o){if(a=bM(i.semver,o.semver,r),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of n){if(i&&!vM(e,String(i),r))return null;if(o&&!vM(e,String(o),r))return null;for(const n of t)if(!vM(e,String(n),r))return!1;return!0}let d=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver,m=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;d&&1===d.prerelease.length&&"<"===o.operator&&0===d.prerelease[0]&&(d=!1);for(const e of t){if(c=c||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),">"===e.operator||">="===e.operator){if(s=MM(i,e,r),s===e&&s!==i)return!1}else if(">="===i.operator&&!vM(i.semver,String(e),r))return!1;if(o)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),"<"===e.operator||"<="===e.operator){if(l=SM(o,e,r),l===e&&l!==o)return!1}else if("<="===o.operator&&!vM(o.semver,String(e),r))return!1;if(!e.operator&&(o||i)&&0!==a)return!1}return!(i&&u&&!o&&0!==a)&&(!(o&&c&&!i&&0!==a)&&(!m&&!d))},MM=(e,t,r)=>{if(!e)return t;const n=bM(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},SM=(e,t,r)=>{if(!e)return t;const n=bM(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var EM=(e,t,r={})=>{if(e===t)return!0;e=new hM(e,r),t=new hM(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=xM(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const CM=ov.exports;var qM={re:CM.re,src:CM.src,tokens:CM.t,SEMVER_SPEC_VERSION:av.SEMVER_SPEC_VERSION,SemVer:Mv,compareIdentifiers:mv.compareIdentifiers,rcompareIdentifiers:mv.rcompareIdentifiers,parse:Av,valid:Nv,clean:Tv,inc:Lv,diff:_v,major:Hv,minor:Bv,patch:Yv,prerelease:Gv,compare:kv,rcompare:Xv,compareLoose:Zv,compareBuild:eb,sort:rb,rsort:ib,gt:ab,lt:lb,eq:jv,neq:cb,gte:mb,lte:pb,cmp:Mb,coerce:Ob,Comparator:Ax,Range:Qb,satisfies:Px,toComparators:Fx,maxSatisfying:zx,minSatisfying:Bx,minVersion:Gx,validRange:Xx,outside:aM,gtr:lM,ltr:cM,intersects:mM,simplifyRange:(e,t,r)=>{const n=[];let i=null,o=null;const a=e.sort(((e,t)=>pM(e,t,r)));for(const e of a){fM(e,t,r)?(o=e,i||(i=e)):(o&&n.push([i,o]),o=null,i=null)}i&&n.push([i,null]);const s=[];for(const[e,t]of n)e===t?s.push(e):t||e!==a[0]?t?e===a[0]?s.push("<="+t):s.push(`${e} - ${t}`):s.push(">="+e):s.push("*");const l=s.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return l.length<u.length?l:t},subset:EM},OM="0.23.1";const AM=e=>!e||qM.lt(qM.coerce(e),qM.coerce(OM)),DM=({layoutService:e,flags:t})=>{const r=t.isEnabled("BARS_IN_SECONDARY_AXIS")&&!AM(e.getLayoutValue("version")),n=e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>{const r={[ta.BAR]:0,[ta.LINE]:0,[ta.MARKER]:0};return({series:n=na},i)=>{const o=iv(n,t),a=Lf(n);return{id:i,type:a,typeIndex:r[a]++,ref:"qMeasureInfo/"+i,refIndex:i,isPrimary:o,scale:o?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,collection:o?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY,options:nv({series:n,layoutService:e})}}})(e,r)),i=(e,t)=>e.filter((e=>Lf(e)===t)).length,o=n.filter((e=>e.isPrimary)),a=n.filter((e=>!e.isPrimary)),s=[!!o.length&&o[0],!!a.length&&a[0]].filter((e=>!!e)),l=i(n,ta.BAR),u=i(o,ta.BAR),c=i(a,ta.BAR),d=e=>n.filter((t=>Lf(t)===e)),m=d(ta.LINE).map((e=>ks(ea.COMPONENT.POINT,e))),f=d(ta.MARKER).map((e=>({key:ks(ea.COMPONENT.MARKER,e),type:e.options.marker}))),p=f.map((e=>e.key)),h=[];u>0&&h.push(`${ea.COMPONENT.BAR}-${ra.PRIMARY}`),c>0&&h.push(`${ea.COMPONENT.BAR}-${ra.SECONDARY}`);const y=[...h,...m,...p],{MINI_CHART:g}=ea.COMPONENT,v=d(ta.LINE).map((e=>ks(g.LINE,e))),b=d(ta.MARKER).map((e=>ks(g.MARKER,e))),x=e.meta.isContinuous?[`${g.BAR}-${ra.PRIMARY}`,`${g.BAR}-${ra.SECONDARY}`,...v,...b]:[];return{meta:{allSeries:n,primarySeries:o,secondarySeries:a,barSeriesCount:l,primaryBarSeriesCount:u,secondaryBarSeriesCount:c,measureAxes:s,pointComponentKeys:m,markerComponentKeys:p,barComponentKeys:h,seriesComponentKeys:y,miniComponentKeys:x,markers:f},query:{all:()=>n,seriesByAxis:e=>e?o:a,series:d,isPrimary:iv}}};function NM(e){return function({layout:t}){var r,n,i;const o=rc(t,"qHyperCube.qMeasureInfo",[]),a=o.some((({series:e=na})=>Lf(e)===ta.LINE)),s=oe.continuous(t,(()=>a&&ee.isTime(!0,t))),l=e.isEnabled("BARS_IN_SECONDARY_AXIS")&&!AM(rc(t,"version","")),u=o.filter((({series:e=na})=>Lf(e)===ta.BAR)),c=u.length,d=u.filter((e=>e.series.axis===ra.PRIMARY)).length,m=u.filter((e=>e.series.axis===ra.SECONDARY)).length,f=l?d>1||m>1:c>1,p=("grouped"!==rc(t,"barGrouping.grouping")||s)&&f,h=!p&&c>1,y=l&&p&&(d>0&&m>1||d>1&&m>0),g=!(null==t||null===(r=t.qHyperCube)||void 0===r||null===(n=r.qDimensionInfo)||void 0===n||null===(i=n[0])||void 0===i||!i.qLocked);return{canBeContinuous:ee.canBeContinuous(t),isDiscrete:!s,isContinuous:s,isTime:ee.isTime(s,t),isSnapshot:oe.snapshot(t),isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:y,isGrouped:h||y,isGroupedByMeasure:h||y,isDimensionLocked:g,groupSize:y?2:c,hasLineSeries:a}}}function IM({layoutService:e}){const{dimensionCount:t,measureCount:r}=e.meta;return{qTop:0,qLeft:0,qWidth:t+r,qHeight:Math.min(2e3,1e4/(r+1))}}function TM({genericObjectModel:e,layoutService:t}){return function(){return function(e,t,r){return e.getHyperCubeReducedData(r.path,[r.rect],r.zoomLevel,r.filter).catch(se).then((e=>{var r;const n=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===n&&i.length>1&&(null===(r=e[0])||void 0===r?void 0:r.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,{path:"/qHyperCubeDef",rect:IM({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function wM({genericObjectModel:e,layoutService:t}){const{isSnapshot:r,isContinuous:n}=t.meta;return r?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||e.getHyperCube()})}}({layoutService:t}):n?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):TM({genericObjectModel:e,layoutService:t})}const LM=e=>"number"==typeof e&&!Number.isNaN(e);function RM({isPrimary:e,layoutService:t,seriesModel:r}){return function(){const n=t.getHyperCubeValue("qMeasureInfo"),i=r.query.seriesByAxis(e).map((e=>n[e.refIndex])),o=i.filter((e=>Lf(e.series)===ta.BAR)),a=i.filter((e=>Lf(e.series)===ta.LINE)),s=i.filter((e=>Lf(e.series)===ta.MARKER));return{min:Math.min(...i.filter((e=>LM(e.qMin))).map((e=>e.qMin))),max:Math.max(...i.filter((e=>LM(e.qMax))).map((e=>e.qMax))),bar:{min:Math.min(...o.filter((e=>LM(e.qMin))).map((e=>e.qMin))),max:Math.max(...o.filter((e=>LM(e.qMax))).map((e=>e.qMax)))},line:{min:Math.min(...a.filter((e=>LM(e.qMin))).map((e=>e.qMin))),max:Math.max(...a.filter((e=>LM(e.qMax))).map((e=>e.qMax)))},marker:{min:Math.min(...s.filter((e=>LM(e.qMin))).map((e=>e.qMin))),max:Math.max(...s.filter((e=>LM(e.qMax))).map((e=>e.qMax)))}}}}function kM({isPrimary:e,layoutService:t,seriesModel:r}){const n=RM({isPrimary:e,layoutService:t,seriesModel:r}),i=function({seriesModel:e,isPrimary:t}){return function({dataPage:r}){const n=e.query.series(ta.BAR).filter((e=>e.isPrimary===t)).map((e=>e.refIndex)),{qMatrix:i}=r,o={min:NaN,max:NaN};return i.forEach((e=>{let t=0,r=0;e.slice(1).filter(((e,t)=>n.some((e=>e===t))&&"NaN"!==e.qNum)).forEach((e=>{e.qNum>=0?r+=e.qNum:t+=e.qNum})),o.min=Number.isNaN(o.min)?t:Math.min(t,o.min),o.max=Number.isNaN(o.max)?r:Math.max(r,o.max)})),o}}({seriesModel:r,isPrimary:e});return function({dataPage:e}){const t=n({dataPage:e});return t.bar=i({dataPage:e}),t.min=Math.min(t.bar.min,t.line.min,t.marker.min),t.max=Math.max(t.bar.max,t.line.max,t.marker.max),t}}function PM({isPrimary:e,continuousModel:t,layoutService:r,reducedModel:n,seriesModel:i}){const o={min:NaN,max:NaN,implicit:{min:NaN,max:NaN,bar:{min:NaN,max:NaN},line:{min:NaN,max:NaN},marker:{min:NaN,max:NaN}},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},a=function({isPrimary:e,layoutService:t,seriesModel:r}){const{isBarSeriesStacked:n}=t.meta;return n?kM({isPrimary:e,layoutService:t,seriesModel:r}):RM({isPrimary:e,layoutService:t,seriesModel:r})}({isPrimary:e,layoutService:r,seriesModel:i});return{query:{getExtrema:()=>o},command:{initialize:()=>{const{min:s,max:l}=function({isPrimary:e,layoutService:t}){const r={min:NaN,max:NaN},{getLayoutValue:n}=t,i=n("measureAxes."+(e?0:1),{});if(i.autoMinMax)return r;const{minMax:o,min:a,max:s}=i;return"min"!==o&&"minMax"!==o||(r.min=a),"max"!==o&&"minMax"!==o||(r.max=s),Number.isNaN(r.min)||Number.isNaN(r.max)||(r.min=Math.min(a,s),r.max=Math.max(a,s)),r}({isPrimary:e,layoutService:r});return o.explicit.min=s,o.explicit.max=l,o.meta.hasExplicitMin=!Number.isNaN(s),o.meta.hasExplicitMax=!Number.isNaN(l),o.meta.hasExplicit=o.meta.hasExplicitMin||o.meta.hasExplicitMax,function({continuousModel:e,layoutService:t,reducedModel:r}){const{isDiscrete:n}=t.meta;if(n){const e=r.query.getCube();return Promise.resolve({dataPage:e.qDataPages[0]})}return e.fetchMinMaxData().then((e=>({dataPage:e[0]})))}({continuousModel:t,layoutService:r,reducedModel:n}).then((({dataPage:t})=>{const{min:r,max:n,bar:s,line:l,marker:u}=a({dataPage:t}),c=i.query.seriesByAxis(e).some((e=>Lf(e)===ta.BAR)),d=c?Math.min(r,0):r,m=c?Math.max(n,0):n,f=c?Math.min(s.min,0):s.min,p=c?Math.max(s.max,0):s.max,h=c?Math.min(l.min,0):l.min,y=c?Math.max(l.max,0):l.max,g=c?Math.min(u.min,0):u.min,v=c?Math.max(u.max,0):u.max;o.implicit.min=Number.isFinite(d)?d:0,o.implicit.max=Number.isFinite(m)?m:0,o.implicit.bar.min=Number.isFinite(f)?f:0,o.implicit.bar.max=Number.isFinite(p)?p:0,o.implicit.line.min=Number.isFinite(h)?h:0,o.implicit.line.max=Number.isFinite(y)?y:0,o.implicit.marker.min=Number.isFinite(g)?g:0,o.implicit.marker.max=Number.isFinite(v)?v:0,o.min=Number.isNaN(o.explicit.min)?o.implicit.min:o.explicit.min,o.max=Number.isNaN(o.explicit.max)?o.implicit.max:o.explicit.max,o.meta.hasExplicitMin&&!o.meta.hasExplicitMax&&(o.max=Math.max(o.min,o.max)),o.meta.hasExplicitMax&&!o.meta.hasExplicitMin&&(o.min=Math.min(o.min,o.max)),o.meta.includesZero=!!((0-o.min)*(0-o.max)<=0)}))}}}}function jM({extrema:e,ticks:t}){const r=e.meta.hasExplicit?2:3;return t.filter((t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t))).length>=r}function FM({min:e,max:t,count:r,threshold:n,disable:i}){const o=function(e,t,r){const n=nn().domain([e,t]);return n.nice(r),n}(e,t,r),a=function({min:e,max:t,threshold:r,scale:n,disable:i}){const o={start:!0,stop:!0};if(i)return o;const[a,s]=n.domain();return 0!==e&&0!==a&&(o.start=n(e)>r),0!==t&&0!==s&&(o.stop=n(t)<1-r),o}({min:e,max:t,threshold:n,scale:o,disable:i});if(!a.start||!a.stop){const[e,t]=o.domain(),n=o.ticks(r),i=n.length>=4?n[1]-n[0]:.1*e,s=n.length>=4?n[n.length-1]-n[n.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(r)}return o}const VM=50,_M=100,zM=200,HM=125;function $M({config:{measureAxesRef:e},layoutService:t,size:r}){const n=(e=>{switch(e){case.5:return VM;case 1:return _M;case 2:return zM;default:return e*HM}})(t.getLayoutValue(e+".spacing",1));return Math.max(1,Math.round(r/n))}function BM({config:e,chart:t,layoutService:r,dockService:n,measureText:i,size:o,min:a,max:s}){const l=$M({config:e,layoutService:r,size:o}),u=FM({min:a,max:s,count:l,threshold:.05,disable:!0}),c=u.domain(),d={roundedMin:c[0],roundedMax:c[1],ticks:u.ticks(l)},m="horizontal"===n.meta.major.orientation?"height":"width",f=e=>i(e)[m],p=t.formatter(e.formatter),h=()=>{const e=d.ticks.map(p);return!e.some(((t,r)=>e.indexOf(t)!==r))&&(e=>{const t=o/d.ticks.length;return Math.max(...e.map(f))<=t})(e)};for(let e=l-1;e>0&&!h();e--)u.domain([a,s]),u.nice(e),[d.roundedMin,d.roundedMax]=u.domain(),d.ticks=u.ticks(e);return d}function UM({tick:e,index:t,ticks:r}){return 0===t||t===r.length-1||0===e}function YM({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}function WM({config:e,chart:t,extrema:r,min:n,max:i}){const o={roundedMin:0,roundedMax:0,ticks:[]},a=FM({min:n,max:i,count:10,threshold:.15,disable:!0});[o.roundedMin,o.roundedMax]=a.domain();const s=a.ticks(10),l=function({ticks:e}){const t=Math.round(.3*e.length),r=t,n=e.length-t;return e.slice(r,n).some((e=>0===e))}({ticks:s}),u=l?UM:YM;o.ticks=s.filter(((e,t,r)=>u({tick:e,index:t,ticks:r})));o.ticks.length%2==0&&!l&&!r.meta.hasExplicit&&s.length>1&&(o.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const c=t.formatter(e.formatter),d=o.ticks.map(c);return d.some(((e,t)=>d.indexOf(e)!==t))&&(o.ticks=[o.ticks[0],o.ticks[o.ticks.length-1]]),o}function GM({ticks:e,extrema:t}){let r=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some((e=>e===t.explicit.min))&&(r.unshift(t.explicit.min),r=r.filter((e=>e>=t.explicit.min))),t.meta.hasExplicitMax&&!e.some((e=>e===t.explicit.max))&&(r.push(t.explicit.max),r=r.filter((e=>e<=t.explicit.max))),r):r}function KM({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}){const{ticks:u,roundedMin:c,roundedMax:d}=function({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}){if("SPARK"===n.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:s,max:l});const u=BM({config:e,chart:t,layoutService:r,dockService:n,measureText:o,size:a,min:s,max:l});return jM({extrema:i,ticks:u.ticks})?u:WM({config:e,chart:t,extrema:i,min:s,max:l})}({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}),m=function({ticks:e,count:t}){const r=[];for(let n=0;n<e.length-1;n++){const i=e[n],o=(e[n+1]-i)/(t+1);for(let e=1;e<=t;e++)r.push(i+o*e)}return r}({ticks:u,count:1});return{min:c,max:d,values:[...GM({ticks:u,extrema:i}).map((e=>({value:e,isMinor:!1}))),...m.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value))}}function XM({config:e,chart:t,layoutService:r,dockService:n,measureText:i,extrema:o,size:a}){const{min:s,max:l}=function({extrema:e}){const{min:t,max:r}=e;return t!==r?{min:t,max:r}:0===t||1===t?{min:t-1,max:r+1}:{min:t-.2*t*Math.sign(t),max:r+.2*r*Math.sign(r)}}({extrema:o});return KM({config:e,chart:t,layoutService:r,dockService:n,extrema:o,measureText:i,size:a,min:s,max:l})}function JM({config:e,chart:t,layoutService:r,extremumModel:n,dockService:i,seriesModel:o,themeService:a}){const s={locked:!1,resolved:void 0},{getExtrema:l}=n.query,u=function({chart:e,config:t,dockService:r,extremumModel:n,layoutService:i,seriesModel:o,themeService:a}){const{measureText:s}=S.renderer("svg")();return()=>{const l=a.getStyles(),u=function({dockService:e,seriesModel:t,chart:r}){var n;const i=r.component(t.meta.seriesComponentKeys[0]),o=null!==(n=null==i?void 0:i.rect)&&void 0!==n?n:e.meta.chart.size;return"horizontal"===e.meta.major.orientation?o.height:o.width}({chart:e,dockService:r,seriesModel:o}),c=n.query.getExtrema();return XM({config:t,chart:e,layoutService:i,dockService:r,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:c,size:u})}}({config:e,chart:t,layoutService:r,extremumModel:n,dockService:i,seriesModel:o,themeService:a}),c=()=>(s.locked&&s.resolved||(s.resolved=u()),s.resolved);return{query:{getValues:()=>c().values,getMin:()=>l().meta.hasExplicitMin?l().explicit.min:c().min,getMax:()=>l().meta.hasExplicitMax?l().explicit.max:c().max},command:{lock:()=>{s.locked=!0},unlock:()=>{s.locked=!1}}}}function ZM({genericObjectModel:e,layoutService:t}){const r={properties:void 0};return{query:{getProperties:()=>r.properties},command:{initialize:()=>function({layout:e,model:t}){return oe.snapshot(e)?Promise.resolve(null):t.getEffectiveProperties().then((e=>({properties:e})))}({layout:t.getLayout(),model:e}).then((e=>{const{properties:t}=null!=e?e:{};r.properties=t}))}}}function QM({layoutService:e,seriesModel:t,colorService:r}){const{type:n,mode:i,fieldType:o}=r.getSettings();if("categorical"!==n)return;const a=e.getLayoutValue("dataPoint.show",!1)?"line-point":"line";let s;s="field"===i?"measure"===o?()=>({type:ta.BAR}):()=>t.query.all()[0]:e=>t.query.all()[e.value];return{item:{shape:{type:({datum:e})=>{const{type:t,options:r}=s(e);switch(t){case"line":return a;case"marker":return r.marker;default:return"square"}},stroke:{},strokeWidth:({datum:e})=>{const{type:t,options:r}=s(e);return t===ta.LINE?2:t!==ta.MARKER||r.fill?0:1},size:10,fill:{fn:({datum:e,scale:t})=>{const{type:r,options:n}=s(e);return r!==ta.MARKER||n.fill?t(e.value):"none"}}}}}}function eS({layout:e,defaultAuto:t}){const r=t(e),n=e.qHyperCube.qMeasureInfo.length>1;return{...r,useBaseColors:n?"measure":r.useBaseColors}}function tS({actions:e,appLayoutModel:t,appModel:r,chart:n,environment:i,flags:o,genericObjectModel:a,layoutService:s,picasso:l,seriesModel:u,viewState:c}){let d;const{theme:m,translator:f}=i,p={wrappedScales:void 0,legendComponents:void 0,legendInteractions:void 0};return d=function(e){var t,r,n,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,m=void 0===d?Uu:d,f=e.config,p=void 0===f?{}:f,h=e.custom,y=void 0===h?{}:h,g=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,M=p.auto,S=void 0===M?void 0:M,E=p.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),q={theme:x,key:v,localeInfo:g,layout:C,hc:null==c||null===(r=c.getHyperCube)||void 0===r?void 0:r.call(c),legendProps:null==c||null===(n=c.getLayoutValue)||void 0===n?void 0:n.call(c,"legend"),colorProps:gl(gl({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?zu(C):void 0})},O=Vu({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&O.auto((function(e){return S?S({layout:e,defaultAuto:Bu}):Bu(e)}));var A=!1;return{getColor:function(){return O.color()},getPaletteColor:function(e){var t=e.index,r=e.color;return O.resolveUIColor({index:t,color:r})},getData:function(){return O.data()},getDatumProps:function(e){return O.datumProps(e)},getSnapshotData:function(){return O.getSnapshotData(E)},getSettingsForMeasure:function(e){return O.settingsForMeasure(e)},getSettings:function(){return O.settings()},getLegend:function(e,t){return O.legend(e,t)},getScales:function(){return O.scales()},getPalettes:function(){return O.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return O.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:gl({},y),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?m:e)({getUseBaseColors:zu}),r=Hu(q,t);return O.config(r),O.getAuxiliarySettings(E).then((function(){A=!0}))}}}({picasso:l,model:a,app:r,translator:f,layoutService:s,createConfig:()=>{let e;o.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&(e=s.getHyperCubeValue("qMeasureInfo").map((e=>e.color)));return{theme:m,colorProps:{measureOverrides:e},legendProps:s.getLayoutValue("legend"),hc:s.getHyperCube(),key:ea.SCALE.COLOR}},config:{auto:eS,localeInfo:t.qLocaleInfo},custom:{wrappedScales:()=>p.wrappedScales,legendComponents:()=>p.legendComponents,legendInteractions:()=>p.legendInteractions,updateLegend:()=>{const{components:t,interactions:r,scales:o}=function({viewState:e,chart:t,layoutService:r,seriesModel:n,environment:i,colorService:o,actions:a}){const{options:s}=i,l={eventName:"legend-c",key:ea.COMPONENT.LEGEND,viewState:e,chart:t,styleReference:"object.comboChart",rtl:"rtl"===s.direction,settings:QM({layoutService:r,seriesModel:n,colorService:o})},{components:u,interactions:c}=o.getLegend(l,{actions:a,navigationDisabled:!a.interact.enabled()}),d=o.getScales();return{components:u.filter(Boolean).map((e=>{const{layout:t}=e,{dock:r}=t,n=d[ea.SCALE.COLOR+"Range"];return!n||"right"!==r&&"left"!==r||(n.invert=!0),"legend-cat"===e.type&&(e.settings.item.shape.fill.scale=e.scale,e.settings.item.shape.stroke.scale=e.scale),e})),interactions:c,scales:d}}({viewState:c,chart:n,environment:i,colorService:d,seriesModel:u,layoutService:s,actions:e});p.wrappedScales=o,p.legendComponents=t,p.legendInteractions=r}}}),d}const rS=()=>{},nS=2,iS=20,oS=200;var aS={contains:function(e,t){if(!e)return!1;const{qArea:r}=e;return!!r&&(r.qLeft<=t.qLeft&&r.qLeft+r.qWidth>=t.qLeft+t.qWidth&&r.qTop<=t.qTop&&r.qTop+r.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 r=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),n=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+r-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+n-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,r){const n=r.qTop-10<=t.qTop,i=r.qLeft+r.qWidth+10>=t.qLeft+t.qWidth,o=r.qTop+r.qHeight+10>=t.qTop+t.qHeight,a=r.qLeft-10<=t.qLeft;return n&&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 sS={contains:function(e,t){if(!e)return!1;const{qArea:r}=e;return!!r&&(r.qTop<=t.qTop&&r.qTop+r.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 r=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),n=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,n-e.qArea.qTop),a=Math.min(n+r-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-n-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:n,qLeft:i},qData:[{...e.qData[0],qUp:n,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,r){const n=r.qTop-10<=t.qTop,i=r.qTop+r.qHeight+10>=t.qTop+t.qHeight;return n&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const r=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const n={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===r&&n.args.push(600),n}}};var lS={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 uS="pages";const cS="discretePan";function dS({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:cS,pointers:1,threshold:10,enable(n,i){return this.started===cS||!i||!!t.scroll.enabled()&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===r))}},events:{discretePanstart(e){e.preventDefault(),this.started=cS;const t="horizontal"===n.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},discretePanmove(e){e.preventDefault();const t="horizontal"===n.meta.major.orientation,r=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(r-this.previousTotalDelta)*a;this.previousTotalDelta=r,o.scroll(s)},discretePanend(e){e.preventDefault(),this.started=!1},discretePancancel(e){e.preventDefault(),this.started=!1}}}}function mS({chart:e,componentKey:t,actions:r,scroller:n}){return function(i){if(!r.scroll.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);n.scroll(s)}}function fS({layoutService:e,areaBuffer:t}){const r=void 0===t?function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:r}){const n=Math.min(t,Math.max(oS,r));return{width:e,height:Math.max(iS,Math.min(r*nS,n))}}}({layoutService:e}):function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:r}){return{width:e,height:Math.min(t,r)}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:t,height:i}=r({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=t?Math.ceil((t-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:t?Math.min(t,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:t?Math.max(0,Math.min(e.qLeft-a,n.width-t)):e.qLeft}}}function pS(e){let t,r;const n=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||r)return t.reject("REJECTED"),t=null,void(r&&(n(r),r=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=>{r&&r.reject("REJECTED"),r=e})(a):n(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!r,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(r.reject("REJECTED"),r=null)},i}const hS={command:{update:()=>{}}};function yS({dataStore:e,composition:t,enigmaModel:r,layoutService:n,trendLineModel:i=hS,definitionPath:o,areaBuffer:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:r,expand:n,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const n=e.getCurrent();if(a)return Promise.resolve(t(n,l));const i=r.release(n.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(n,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=n(l);return o(i(c)).then((r=>(s(r),e.add(r),t(r,l))))}}({dataStore:e,slice:l,warden:u({bounds:{width:n.meta.size.x,height:n.meta.size.y}}),expand:fS({layoutService:n,areaBuffer:a}),request:c({layoutService:n,definitionPath:o}),process:pS(r),connectionless:n.meta.isSnapshot,processDataPage:s}),m=ac(((e,{onProcessing:t,onData:r})=>{d(e,{onProcessing:t}).then((e=>r(e))).catch((e=>{if("REJECTED"!==e)throw e}))}),50);return function(e,{onProcessing:t=rS,onDataPage:r=rS}={}){m(e,{onProcessing:t,onData:e=>{n.setDataPages(e?[e]:[]),i.command.update(),r(e)}})}}var gS={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:r,viewSize:n}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/n;return[a,r.inView>=r.inTotal?a+1:a+o.qArea.qWidth/r.inView]}};var vS={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:r,areaBuffer:n}){const i=void 0===n?4:n,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(r+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:r,viewSize:n}){const{pixel:i}=t,o=e.getDataPages()[0],a=n/r.inView,s=(i+o.qArea.qTop*a)/n;return[s,r.inView>=r.inTotal?s+1:s+o.qArea.qHeight/r.inView]}};function bS(e){const{groupSize:t,measureCount:r}=e.meta;return null!=t?t:r}function xS(e,t){const r=[];for(let n=0;n<e.length;n++){const i=t(e[n]);-1===r.indexOf(i)&&r.push(i)}return r.length}function MS(e){return xS(e.qMatrix,(e=>e[0].qElemNumber))-1}var SS={inTotal:function({layoutService:e}){const t=bS(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:r,areaBuffer:n}){const i=bS(e),o=void 0===n?i:n,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((r+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:r,viewSize:n}){const i=bS(e),o=e.getDataPages()[0],a=n/r.inView,{pixel:s}=t,l=MS(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/n;return[c,r.inView>=r.inTotal?c+1:c+u/r.inView]}};const ES=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function CS(e){return{itemOffset(t,r){if(0!==t.qArea.qTop)return ES(e,r);const n=((e,t)=>{const r={successful:!0,count:0};let n=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=n;t++){if(!e[t])return r.successful=!1,r;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),n--)}return r.count=i.length-1,r})(t.qMatrix,r);return n.successful?n.count:ES(e,r)},area(t,r,n){if(0!==t.qArea.qTop)return ES(e,r);return xS(t.qMatrix.slice(0,n.qTop+1),(e=>e[0].qElemNumber))-1}}}var qS={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:r,inView:n}){const i=CS(t).itemOffset(e(),r),o=Math.max(0,Math.floor(r-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(n+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:r,items:n,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/n.inView,{item:l,pixel:u}=r,c=CS(t).area(e(),l,a.qArea),d=MS(a),m=a.qArea.qHeight+d,f=u===o?(n.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[f,n.inView>=n.inTotal?f+1:f+m/n.inView]}};function OS({rect:e,dockService:t,itemWidths:r,dimensionAxis:n,inTotal:i,isMajorVisible:o,isMajorLabelless:a,maxDataRows:s}){const{DEFAULT:l,SQUEEZE:u,LABELLESS:c}=r[t.meta.chart.mode],{axisDisplayMode:d="auto",maxVisibleItems:m=10}=n,f="horizontal"===t.meta.major.orientation?e.width:e.height,p=f/i>=u;switch(d){case"max":return Math.min(i,s);case"custom":return Math.min(m,s);case"auto":default:return!o||a?f/c:p?i:f/l}}function AS({chart:e,getRect:t,getDataPages:r,layoutService:n,dockService:i,getItemWidths:o,axisKey:a,areaBuffer:s,rtl:l}){const{inTotal:u,area:c,scaleRange:d}=function({layoutService:e}){const{isDimensionless:t,isGrouped:r,isGroupedByMeasure:n}=e.meta;return t?gS:r?n?SS:qS:vS}({layoutService:n}),m=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,f=e=>e?m()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const r=n.getLayoutValue("dimensionAxis"),s=u({layoutService:n}),l=e.component(a),c=!a||!l||l.isVisible();return{inTotal:s,inView:OS({rect:t(),dockService:i,itemWidths:o(),dimensionAxis:r,inTotal:s,isMajorVisible:c,isMajorLabelless:"none"===r.show||"title"===r.show,maxDataRows:Math.floor(1e4/(n.meta.dimensionCount+n.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t,i=Math.min(0,Math.max(e,p(r,n)));return{pixel:i,item:n?Math.abs(n*i/m()):0}},getUpperBound({items:e}){const{inTotal:t,inView:r}=e;return p(t,r)},getViewRange({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t;return function({viewSize:e,inTotal:t,inView:r,pixelOffset:n}){const i=e/r*t,o=Math.abs(n)/i;return[o,o+e/i]}({viewSize:m(),inTotal:r,inView:n,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>c({getDataPages:r,layoutService:n,itemOffset:e,inView:t.inView,areaBuffer:s}),getScaleRange({offsets:e,items:t}){const o=d({getDataPages:r,layoutService:n,offsets:e,items:t,viewSize:m(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&l?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t;return e<=0&&e>=p(r,n)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:r}=t,n=e*f(r);return Number.isFinite(n)?-n:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:r,inView:n}=t;return-e*(f(n)*r)}}}}function DS({chart:e,componentKey:t,state:r,dataStore:n,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,areaBuffer:c,viewState:d,rtl:m}){r.set("rect",{width:0,height:0}),r.set("itemWidths",{}),r.set("itemSize",0),r.set("items",{}),r.set("offsets",{}),r.set("finished",0),r.set("scaleRange",[0,1]);const f=AS({chart:e,getRect:()=>r.get("rect"),getDataPages:n.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>r.get("itemWidths"),axisKey:u,areaBuffer:c,rtl:m}),p=()=>{const e=f.getItems();return r.set("items",e),e},h=({pixelOffset:e,items:t})=>{const n=f.getOffsets({pixelOffset:e,items:t});return r.set("offsets",n),n},y=e=>{const t=Date.now(),n=p(),a=h({pixelOffset:e,items:n}),s=f.getArea({itemOffset:a.item,items:n});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((r=>e[r]===t[r]))})(s))return void((f.validate.offset({pixelOffset:e,items:n})||d.get("scrollOffset")!==a.item)&&(r.set("finished",t),r.set("scaleRange",f.getScaleRange({offsets:a,items:n})),d.preventSet("viewRange",f.getViewRange({pixelOffset:a.pixel,items:n})),d.set("scrollOffset",a.item)));d.preventSet("viewRange",f.getViewRange({pixelOffset:a.pixel,items:n}));const l=()=>{r.get("finished")>t||(r.set("finished",t),r.set("scaleRange",f.getScaleRange({offsets:a,items:n})),d.set("scrollOffset",a.item))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=r.get("items");return e>t},itemSize:()=>r.get("itemSize"),scaleRange:()=>r.get("scaleRange"),initialize(){const n=e.component(t);if(!n)return Promise.resolve();r.set("rect","function"==typeof l?l():n.rect),r.set("itemWidths","function"==typeof s?s():s);const a=p();r.set("itemSize",f.getItemSize({items:a}));const u=void 0===d.get("scrollOffset")?(({items:e})=>1===o.getLayoutValue("scrollStartPos")?f.getUpperBound({items:e}):0)({items:a}):f.convert.itemToPixelOffset({itemOffset:d.get("scrollOffset"),items:a}),c=h({pixelOffset:u,items:a});d.preventSet("viewRange",f.getViewRange({pixelOffset:c.pixel,items:a}));const m=f.getArea({itemOffset:c.item,items:a});return new Promise((e=>{i(m,{onDataPage:()=>{r.set("scaleRange",f.getScaleRange({offsets:c,items:a})),d.preventSet("scrollOffset",c.item),e()}})}))},scroll(e){const t=r.get("offsets").pixel+e;y(t)},scrollToRelative(e){const t=r.get("items"),n=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(n)}}}function NS({chart:e,actions:t,componentKey:r,enigmaModel:n,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:m,areaBuffer:f,processDataPage:p=(()=>{})}={}}){const h=ic(),y=function({qMode:e}){switch(e){case"S":default:return aS;case"K":return sS;case"T":return lS}}({qMode:i.getHyperCubeValue("qMode")}),g=function({state:e,contains:t}){return e.set(uS,[]),{add:t=>{const r=e.get(uS);r.length=0,r.push(t)},getCurrent:()=>e.get(uS)[0],getAll:()=>e.get(uS),contains:r=>t(e.get(uS)[0],r)}}({state:h,contains:y.contains});!function({layoutService:e,dataStore:t,composition:r}){const n=e.getDataPages()[0];if(!n)return;const i=r.patcher({layoutService:e});i.should(n)&&i(n),t.add(n)}({layoutService:i,dataStore:g,composition:y});const v=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:f}),b=yS({dataStore:g,composition:y,enigmaModel:n,layoutService:i,trendLineModel:a,definitionPath:c,areaBuffer:v,processDataPage:p}),x=DS({chart:e,componentKey:r,state:h,dataStore:g,pageData:b,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:m,areaBuffer:v,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(r){const n=rc(r,""+e.refs.dataPages);n.length=0,n.push(t.getCurrent())}}({layoutService:i,dataStore:g});return{interactions:function({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o}){return{gestures:[dS({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o})],native:{type:"native",events:{wheel:mS({chart:e,actions:t,componentKey:r,scroller:o})}}}}({chart:e,actions:t,componentKey:r,dockService:o,rtl:u,scroller:x}),query:{getCanScroll:()=>x.enabled(),getItemSize:()=>x.itemSize(),getScaleRange:()=>x.scaleRange(),getCurrentDataPage:()=>g.getCurrent()},command:{initialize:()=>x.initialize(),scrollTo:e=>x.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var IS={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}};function TS({appLayoutModel:e,appModel:t,chart:r,environment:n,flags:i,genericObjectModel:o,layout:a,picasso:s}){const{translator:l,embed:u}=n,c=function({layout:e,app:t,picasso:r,model:n,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:r,model:n,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:ya,miniChartToken:{},embed:s}}({layout:a,app:t,model:o,picasso:s,chart:r,translator:l,localeInfo:e.qLocaleInfo,embed:u});return{query:{useCustomTooltip:()=>c.useCustomTooltip,useTooltipChart:()=>{var e,t,r,n;return i.isEnabled("CUSTOM_TOOLTIP_CHART")&&(null===(e=a.tooltip)||void 0===e||null===(t=e.chart)||void 0===t||null===(r=t.object)||void 0===r?void 0:r.refId)&&c.embed&&"function"==typeof(null===(n=c.model)||void 0===n?void 0:n.getEffectiveProperties)},hasChartLimitation:()=>{var e;return null==t||null===(e=t.isInModalSelection)||void 0===e?void 0:e.call(t)},getCustomTooltipModel:()=>c}}}function wS({layoutService:e,key:t}){const{style:r}=e.getLayoutValue("components",[]).filter((e=>e.key===t))[0]||{};return({property:n,defaultValue:i,index:o})=>{const a=r&&Object.hasOwnProperty.call(r,n)?r[n]:i;if(void 0===o)return a;const{style:s}=e.getHyperCubeValue((e=>`qMeasureInfo.${e}.styling`)(o),[]).filter((e=>e.key===t))[0]||{};return s&&Object.hasOwnProperty.call(s,n)?s[n]:a}}function LS({layoutService:e,dockService:t}){const{BAR:r,LINE:n,POINT:i}=Us,o=wS({layoutService:e,key:"bar"}),a=wS({layoutService:e,key:"line"}),s=()=>{const e=o({property:"strokeWidth",defaultValue:"none"});return e?r.STROKE.WIDTH[e.toUpperCase()]:0};return{query:{bar:{getHasStyling:()=>!!e.getLayoutValue("components",[]).filter((e=>"bar"===e.key)).length,getWidthFn:()=>()=>o({property:"width",defaultValue:.7}),getHasStrokeWidth:()=>!!s(),getStrokeWidth:()=>s(),getStrokeColor:()=>o({property:"strokeColor",defaultValue:{index:-1,color:r.STROKE.COLOR}}).color},line:{getCurveFn:()=>(e,t)=>a({property:"lineCurve",defaultValue:n.CURVE.LINEAR,index:t}),getStrokeWidthFn:()=>(e,r)=>a({property:"lineThickness",defaultValue:"FULL"===t.meta.chart.mode?n.WIDTH.FULL.DEFAULT:n.WIDTH.LESS.DEFAULT,index:r}),getStrokeDasharrayFn:()=>(e,t)=>{const r=a({property:"lineType",defaultValue:n.TYPE.SOLID,index:t});return r&&n.TYPE[r.toUpperCase()]}},point:{getSize:e=>a({property:"dataPointSize",defaultValue:i.SIZE.DEFAULT,index:e})}}}}const{model:RS}=Gp,kS=({picasso:e,chart:c,environment:d,flags:m,viewState:f,viewCache:p,actions:h,selectionService:y})=>{const g=o(),{width:v,height:b}=n(),[x,M]=t(),[S,E]=t(),C=a(),q=s(),O=l(),A=u();r((()=>{if(!(g&&null!=c&&c.update&&d&&f))return;const t=function(e){var t=e.source,r=e.metaAdditionsFn,n=Tl(!0,{},t),i=lc(n),o=function(){return function(e){var t=e.layout,r=e.additionsFn,n=void 0===r?function(){return{}}:r,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,m=gl({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return gl(gl({},m),n({layout:t,meta:m}))}({layout:n,additionsFn:r,additionsProps:{size:i.size}})},a={refs:gl({},i.refs),meta:o(),getLayout:function(){return n},getLayoutValue:function(e,t){return rc(n,e,t)},setLayoutValue:function(e,t){nc(n,e,t),i=lc(n),a.meta=o()},getHyperCube:function(){return n.qHyperCube},getHyperCubeValue:function(e,t){return rc(n.qHyperCube,e,t)},setHyperCubeValue:function(e,t){nc(n.qHyperCube,e,t),i=lc(n),a.meta=o()},getDataPages:function(){return rc(n,i.refs.dataPages)},setDataPages:function(e){nc(n,i.refs.dataPages,e),a.meta=o()}};return a}({source:g,metaAdditionsFn:NM(m)}),{viewState:r={}}=d.options,{legendScrollOffset:n,scrollOffset:i}=t.meta.isSnapshot?t.getLayoutValue("snapshotData.content.chartData",{}):r;f.preventSet("scrollOffset",i),f.preventSet("legendScrollOffset",n),f.preventSet("title",t.getLayoutValue("title"));const o=function({genericObjectModel:e,layoutService:t}){const r={cube:void 0,on:!1},n=wM({genericObjectModel:e,layoutService:t});return{query:{getCube:()=>r.cube,getIsReduced:()=>r.on},command:{initialize:()=>n().then((({reducedCube:e})=>{r.cube=e,r.on=!!(r.cube&&r.cube.qDataPages[0]&&r.cube.qDataPages[0].qIsReduced)})),setSnapshotData:e=>{e.reducedHyperCube=r.cube}}}}({genericObjectModel:C,layoutService:t}),a=tc({chart:c,layoutService:t,config:{logicalSize:{width:v,height:b},rtl:"rtl"===d.options.direction},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0,measureAxes:[{ref:"measureAxes.0",name:"minor"},{ref:"measureAxes.1",name:"minorSecondary"}]}}),s=LS({layoutService:t,dockService:a}),l=DM({layoutService:t,flags:m}),u=t.meta.isDiscrete?function({chart:e,genericObjectModel:t,layoutService:r,dockService:n,seriesModel:i,viewState:o,rtl:a,actions:s}){return NS({chart:e,actions:s,componentKey:Kp(i),enigmaModel:t,layoutService:r,dockService:n,viewState:o,rtl:a,itemWidths:IS,options:{axisKey:ea.COMPONENT.AXIS.MAJOR}})}({chart:c,genericObjectModel:C,layoutService:t,dockService:a,seriesModel:l,viewState:f,rtl:"rtl"===d.options.direction,actions:h}):void 0,x=t.meta.isContinuous?RS({model:C,layoutService:t,viewState:f,viewCache:p}):void 0,S=tS({actions:h,appLayoutModel:O,appModel:q,chart:c,environment:d,flags:m,genericObjectModel:C,layoutService:t,picasso:e,seriesModel:l,viewState:f}),E=function(e){var t=e.theme,r=e.styleMatrix,n={theme:t,styleMatrix:Tm(void 0===r?[]:r),styles:void 0};return n.styles=wm(n.styleMatrix,t),{getStyles:function(){return n.styles},getTheme:function(){return n.theme},setTheme:function(e){n.theme=e,n.styles=wm(n.styleMatrix,e)}}}({theme:d.theme,styleMatrix:Qg}),D=function({layoutService:e,seriesModel:t}){const{isContinuous:r}=e.meta,n="qDimensionInfo/0",i=n+":numeric";return{main:{major:n,majorNumeric:i,minorsPrimary:t.meta.primarySeries.map((e=>e.ref)),minorsSecondary:t.meta.secondarySeries.map((e=>e.ref))},virtuals:r?[{key:i,from:n,override:{value:e=>e.qNum}}]:void 0}}({layoutService:t,seriesModel:l}),N=PM({isPrimary:!0,layoutService:t,reducedModel:o,seriesModel:l,continuousModel:x,flags:m}),I=PM({isPrimary:!1,layoutService:t,reducedModel:o,seriesModel:l,continuousModel:x,flags:m}),T=JM({config:{measureAxesRef:"measureAxes.0",formatter:ea.FORMATTER.PRIMARY},chart:c,layoutService:t,extremumModel:N,dockService:a,seriesModel:l,themeService:E}),w=JM({config:{measureAxesRef:"measureAxes.1",formatter:ea.FORMATTER.SECONDARY},chart:c,layoutService:t,extremumModel:I,dockService:a,seriesModel:l,themeService:E}),L=ZM({genericObjectModel:C,layoutService:t}),R=TS({appLayoutModel:O,appModel:q,chart:c,environment:d,flags:m,genericObjectModel:C,layout:g,picasso:e}),k=Zo({layoutService:t,discreteModel:u}),P=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAJOR:ea.SCALE.MAJOR,MAJOR_INNER:ea.SCALE.MAJOR_INNER,MINOR:{PRIMARY:ea.SCALE.MINOR.PRIMARY,SECONDARY:ea.SCALE.MINOR.SECONDARY}},COMPONENT:{BAR_PRIMARY:`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,BAR_SECONDARY:`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,AXIS:{MAJOR:ea.COMPONENT.AXIS.MAJOR,MAJOR_CONTINUOUS:ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,TIME_INNER:ea.COMPONENT.AXIS.TIME_INNER,MINOR:{PRIMARY:ea.COMPONENT.AXIS.MINOR.PRIMARY,SECONDARY:ea.COMPONENT.AXIS.MINOR.SECONDARY}},AXIS_TITLE:{MAJOR:ea.COMPONENT.AXIS_TITLE.MAJOR,MINOR:{PRIMARY:ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,SECONDARY:ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY}}},COLLECTION:{MAIN:ea.COLLECTION.MAIN}}}}(t),j=function(e){var t=e.picassoInstance,r=e.plugins,n=e.pluginArgs,i=void 0===n?{}:n,o={initialized:!1,definitions:[]};return{initialize:function(){return pl(regeneratorRuntime.mark((function e(){var n,a,s,l;return regeneratorRuntime.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(r.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=pl(regeneratorRuntime.mark((function e(r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,r.fn(gl({},i));case 4:if("object"===ml(n=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(r.info.componentName,n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(r.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(gl({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(n=o.definitions).push.apply(n,xl(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var r=bl(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(r){var n=Tl(!0,{},r.brush);Tl(!0,r,t),t.brush&&(r.brush=function(e,t){return"object"===ml(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=uc({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=uc({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(n,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:A,pluginArgs:P});M({selectionService:y,genericObjectModel:C,appModel:q,dockService:a,styleModel:s,layoutService:t,fieldModel:D,seriesModel:l,reducedModel:o,primaryExtremumModel:N,secondaryExtremumModel:I,primaryTickModel:T,secondaryTickModel:w,propertiesModel:L,colorService:S,themeService:E,appLayoutModel:O,tooltipModel:R,flags:m,...u&&{discreteModel:u},...x&&{continuousModel:x},refLineModel:k,pluginService:j})}),[g,C,q,O,d,null==c?void 0:c.update,f]);const[,D]=i((()=>{if(!x)return Promise.resolve();const{layoutService:e,colorService:t,reducedModel:r,primaryExtremumModel:n,secondaryExtremumModel:i,propertiesModel:o,continuousModel:a,discreteModel:s,pluginService:l}=x,u=a?()=>{var t,r;a.update(e.getLayout());const n=a.initialFetch(),i=!e.meta.isSnapshot&&(null==d||null===(t=d.options)||void 0===t||null===(r=t.viewState)||void 0===r?void 0:r.zoom);return i&&f.preventSet("zoom",i),n}:()=>Promise.resolve(),c=t.initialize().then((()=>{const e=t.getSettings().field;y.setBrushAliases({colorField:e}),t.custom.updateLegend()}));return Promise.all([l.initialize(),r.command.initialize(),C?o.command.initialize():Promise.resolve(),c,u(),h.scroll.attachDiscreteModel(s)]).then((()=>Promise.all([n.command.initialize(),i.command.initialize()]).then((()=>E(x)))))}),[x]);if(D)throw D;return S};function PS(){const[e,n]=t();return r((()=>{n(function(e){var t=gl({},e),r={},n={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&r[e]?t[e]=r[e](o,a):t[e]=o,!i&&n[e]&&n[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){r[e]=t},onChanged:function(e,t){n[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}))}),[]),e}const jS={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const FS={query:{getCanScroll:()=>!0}};function VS(){const e=h(),[n,i]=t(!1),[o,a]=t(!1),[s,l]=t(!1),u=function(){const e=h(),[n,i]=t(!1),[o,a]=t({}),[s,l]=t();return r((()=>()=>{a({})}),[]),r((()=>{e&&i(!e.select&&!e.active)}),[e]),{enabled:()=>n,emit:(e,...t)=>o[e].forEach((e=>e(...t))),removeListener:(e,t)=>{var r;const n=null===(r=o[e])||void 0===r?void 0:r.indexOf(t);n>-1&&o[e].splice(n,1)},on:(e,t)=>{Array.isArray(o[e])?o[e].push(t):o[e]=[t]},get brushSelectionIncludeMax(){return s},set brushSelectionIncludeMax(e){l(e)},getBrushOptions:void 0}}(),c=function(){var e,n,i;const o=h(),[a,s]=t(!1),[l,u]=t(!1),c=y(),d=!!c.qSelectionInfo.qInSelections,m=!(null===(e=c.qHyperCube)||void 0===e||null===(n=e.qDimensionInfo)||void 0===n||null===(i=n[0])||void 0===i||!i.qIsOneAndOnlyOne);r((()=>{o&&s(!o.select&&!o.active)}),[o]);const f=e=>{u("boolean"==typeof e?e:!l)};return g((()=>({key:"lasso",label:"Lasso",icon:jS,hidden:!a||!d||m,active:l,action:f})),[d,m,l,a]),{action:f,enabled:()=>a,active:()=>l}}();let d=FS;r((()=>{e&&(i(!e.active),a(!e.active),l(!e.passive))}),[e]);const[m]=t({});return m.scroll={enabled:()=>n&&d.query.getCanScroll(),attachDiscreteModel:e=>{d=e||FS}},m.interact={enabled:()=>o},m.tooltip={enabled:()=>s},m.lasso=c,m.select=u,m}function _S({clearMinor:e,clearDiscrete:t,clearLegend:r}){e(),e({componentName:"minor-secondary-range-brush",eventName:"minorRange-secondary"}),t({brushName:!1}),r()}function zS({setSelectionInfo:e,event:t,components:r,clear:n}){const i=null!=r&&r.length?r.map((e=>e.key)).filter(Boolean):[];e({event:t,components:i,minorRangePrimary:"minorRange"===t,minorRange:["minorRange","minorRange-secondary"].includes(t),legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===ea.COMPONENT.LEGEND_CATEGORICAL}),n()}var HS,$S={exports:{}};HS=$S,function(e,t){HS.exports=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/conversion/",r(r.s="./index.js")}({"../node_modules/extend/index.js":
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var r,n,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=m-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,m):"";if(r=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",o=n&&n[1]&&n[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",g=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-g+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),p+(r?"-":"")+n+x}}(ku={exports:{}}),ku.exports);function ju(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Fu={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Vu=/%$/,_u=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Bu=/^\(oct\)/i,Hu=/^\(dec\)/i,$u=/^\(hex\)/i,zu=/^\(bin\)/i,Uu=/^\(rom\)/i,Yu=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Wu=/#|0/g;function Gu(e,t,r,n){return e=e.toString(t),r[1]===r[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",n||".")}function Ku(e,t,r){var n=ju(e);return r?n:new RegExp(n||"",t)}function Xu(e,t,r){var n,i,o,a,s,l,u,c,d,m,f,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),m=t,(f=r)&&(f=ju(f)),m&&(m=ju(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(f,"[#0]+)?")),a=(o=(o=p.match(d))?o[0]:"")?p.substr(0,p.indexOf(o)):p,s=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===r&&(i=(n=o.split(r)).pop(),o=n.join("")+r+i,t=""),l=t,t=/,/.test(r)?"¤":",",l&&(o=o.replace(Ku(l,"g"),t)),u=r,r=".",u&&(o=o.replace(Ku(u,"g"),r)),c=(c=o.match(/#/g))?c.length:0;var h,y=p.split(u);y[1]&&(h=y[1].match(Wu)),e.prefix=a||"",e.postfix=s||"",e.pattern=p,e.maxPrecision=h?h.length:2,e.percentage=Vu.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(Ku(t,null,!0),"|").concat(Ku(r,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=r,e.temp=c}var Ju=function(){function e(t,r,n,i,o){kl(this,e),this.localeInfo=t,this.pattern=r,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Fu;var r={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(r[t[0]]=t[1])})),r}(t,this.patternSeparator),this.prepare()}return jl(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,r,n){return this.prepare(t,r,n),this.formatValue(e)}},{key:"prepare",value:function(e,t,r){var n;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===r&&(r=this.decimalDelimiter),e?(this._prepared={positive:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},n=this._prepared,e=e.split(this.patternSeparator),n.positive.pattern=e[0],n.negative.pattern=e[1],n.zero.pattern=e[2],Yu.test(e[0])&&(n.positive.isFunctional=!0),e[1]?Yu.test(e[1])&&(n.negative.isFunctional=!0):n.negative=!1,e[2]?Yu.test(e[2])&&(n.zero.isFunctional=!0):n.zero=!1,n.positive.isFunctional||Xu(n.positive,t,r),n.negative&&!n.negative.isFunctional&&Xu(n.negative,t,r),n.zero&&!n.zero.isFunctional&&Xu(n.zero,t,r)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,r,n,i,o,a,s,l,u,c=this._prepared,d="",m="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,r){var n;return _u.test(t)?e=Gu(e,Number(/\d{2}/.exec(t)[0]),t,r):Bu.test(t)?e=Gu(e,8,t,r):Hu.test(t)?e=Gu(e,10,t,r):$u.test(t)?e=Gu(e,16,t,r):zu.test(t)?e=Gu(e,2,t,r):Uu.test(t)&&(n="",e<0&&(n="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?n+(e=function(e,t){for(var r,n="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(r=0;r<a.length;r++)if(a[r]<=i){n+=s[r],i-=a[r];break}for(r=0;r<o;r++)n="M".concat(n);return t[1]!==t[1].toUpperCase()&&(n=n.toLowerCase()),n}(e,t)):t+n+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,h,y=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),g=y[0];for(s=0,r=Number(Number(e).toExponential().split("e")[1]);g<=r&&s<y.length;)g=y[++s];s>0&&(p=y[s-1]),p&&r>0&&p>0?h=p:(r<0&&p<0||!p)&&(g<0&&g-r<=c.maxPrecision?h=g:p<=r&&!(g>0&&-r<=c.maxPrecision)&&(h=p)),h&&(d=this.abbreviations[h],e/=Math.pow(10,h))}if(n=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(n>=1e15||n>0&&n<=1e-14)e=n?n.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Pu(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),M=u.replace(/#+$/,"").length,S=("I"===this.type?0:n%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=S.length;s<M;s++)S+="0";S&&(e+=o+S)}else 0===v&&(i=0)}else if(n>=Math.pow(10,t)||n<1||n<1e-4)0===e?e="0":n<1e-4||n>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),m=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(n)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Pu(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+m+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function Zu(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.size,o=void 0===i?5e3:i,a=n.multipleArguments,s=void 0!==a&&a,l=n.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),d=Object.create(null),m=0,f=0;return(t=s?function(){return r=u.apply(void 0,arguments),t.has(r)?t.get(r):t.set(r,e.apply(void 0,arguments))}:function(n){return r=u(n),t.has(r)?t.get(r):t.set(r,e(n))}).set=function(e,t){return m>=o&&(delete c[d[f]],delete d[f],m--,f++),c[e]=t,d[m]=e,m++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),d=Object.create(null),m=0,f=0},t.size=function(){return m},t}function Qu(e,t,r,n,i){var o=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return $l(Ju,t)}(i,e,t,r,n),a=Zu(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,r,n){return a.clear(),o.format(t,e,r,n)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var ec=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],tc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rc=["January","February","March","April","May","June","July","August","September","October","November","December"],nc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ic(e,t){for(var r=e.length;r<t;r++)e="0".concat(e);return e}function oc(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}var ac=function(){function e(t,r,n){kl(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:ec,qDayNames:tc,qLongMonthNames:rc,qMonthNames:nc}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),r||(r=(Fl(i={},"T",o.qTimeFmt||"hh:mm:ss"),Fl(i,"D",o.qDateFmt||"YYYY-MM-DD"),Fl(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[n]),this.pattern=r}return jl(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var r,n,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(n=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=n.getUTCDay()-1)<0&&(a=6),r={year:n.getUTCFullYear(),month:n.getUTCMonth(),day:a,date:n.getUTCDate(),h:o,m:n.getUTCMinutes(),s:n.getUTCSeconds(),f:n.getUTCMilliseconds(),t:n.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){var r,n=function(e){var t=e,r=24*oc(t),n=60*oc(r),i=60*oc(n),o=1e3*oc(i);return{d:Math.floor(t),h:Math.floor(r),m:Math.floor(n),s:Math.floor(i),f:Math.round(o)}}(e),i=n.d,o=n.h,a=n.m,s=n.s,l=n.f,u=0;/w+|t+/gi.test(t)&&(r=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(r.getTime())&&(r=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=r?r.getDay()-1:0)<0&&(u=6);var c="";return r&&(c=r.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:ic("".concat(t.year).slice(-2),2),YYY:ic("".concat(t.year).slice(-3),3),def:function(e){return ic("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:ic("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:ic("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return ic("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return ic("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return ic("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return ic("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var r="".concat(t.f),n=e.length-r.length;if(n>0)for(var i=0;i<n;i++)r+="0";else n<0&&(r=r.slice(0,e.length));return r}},"t{1,2}|T{1,2}":{def:function(e){var r=t.t;return e[0].toUpperCase()===e[0]&&(r=r.toUpperCase()),r.slice(0,e.length)}}}}(this,r),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var d=new RegExp(u.join("|"),"g");return t.replace(d,(function(e){var t,r,n;for(r in l)if(Object.prototype.hasOwnProperty.call(l,r)&&(t=new RegExp(r)).test(e))break;if(!t)return"";for(var i in l[r])if(i===e||i.toLowerCase()===e){void 0===(n=l[r][i])&&(n=l[r][i.toLowerCase()]);break}return void 0===n&&(n=l[r].def),"function"==typeof n&&(n=n(e)),n}))}}]),e}();function sc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return $l(ac,t)}function lc(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function uc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=sc(r,e,t),i=Zu(n.format.bind(n),{toKey:function(e){return"object"===Rl(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return"IV"!==t?lc(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(r){return n=sc(r,e,t),i=Zu(n.format.bind(n),{toKey:function(e){return"object"===Rl(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function cc(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return uc(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var r="#",n=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(r=e.qNumFormat.qFmt||r,n=e.qNumFormat.qThou||n,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(r="#".concat(i,"##A"),o="U"),Qu(r,n,i,o,t)}function dc(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.meta,n=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),d=function(e){return e.qText||""},m="dimension"===l?"first":"avg",f=cc(r,o),p="dimension"===l?"first":function(e,t){return f(t)},h={id:function(){return n},key:function(){return i},raw:function(){return r},title:function(){return r.qFallbackTitle||r.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(h)),e},min:function(){return r.qMin},max:function(){return r.qMax},value:c,label:d,reduce:m,reduceLabel:p,formatter:function(){return f},tags:function(){return r.qTags}};return h}function mc(e,t,r,n,i){return(t[e]||[]).map((function(t,o){var a="".concat(n?"".concat(n,"/"):"").concat(e,"/").concat(o),s={instance:dc(tu({id:"".concat(r?"".concat(r,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=mc("qAttrDimInfo",t,r,a,tu({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=mc("qAttrExprInfo",t,r,a,tu({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=mc("qMeasureInfo",t,r,a,tu({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function fc(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.key,o=n.data,a=n.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=fc.util,d={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},m={key:function(){return i},raw:function(){return u},field:function(e){return xu(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,m,l,c)},hierarchy:function(e){return d.hierarchy(e,m,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(d.extractor=Ru,d.hierarchy=Lu,d.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(d.extractor=ou,d.pages=u.qDataPages,d.hierarchy=Lu):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},m,l,c)};var f="S"===u.qMode?function(e){return e.qElemNumber}:void 0,p="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,zl(mc("qDimensionInfo",u,i,"",tu({},d,{value:f,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,zl(mc("qMeasureInfo",u,i,"",tu({},d,{value:p,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var h=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return h(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=m.field(e.from),r=dc(_l({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},m,l,c)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(r)})),(r=l.allFields).push.apply(r,zl(l.virtualFields)),m}var pc=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],hc=/\/qDimensionInfo(?:\/(\d+))?/,yc=/\/qMeasureInfo\/(\d+)/,gc=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,vc=/\/qAttrExprInfo\/(\d+)/,bc=/\/?qHyperCube/,xc=/\/?qTreeData/,Mc=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},Sc=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function Ec(e,t){var r=e,n=-1,i=-1,o="",a=function(e){return e};bc.test(e)?(o="".concat(r.substr(0,r.indexOf("qHyperCube")+10)),a=Mc):xc.test(e)&&(o="".concat(r.substr(0,r.indexOf("qTreeData")+9)),a=Sc);var s=!0;if(hc.test(e)&&(n=+hc.exec(e)[1]),yc.test(e)&&(i=+yc.exec(e)[1]),gc.test(e)){i=-1,n=0;var l=+gc.exec(r)[2];isNaN(l)||(n=l,r=r.replace(/\/\d+$/,"")),s=!1}if(vc.test(e)){var u=i;if(t){i=0;var c=gu(o,t);i+=(c.qMeasureInfo||[]).length,n>-1?(i=c.qDimensionInfo.slice(0,n).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),n=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+vc.exec(r)[1]}else n>-1?(n=-1,i=+vc.exec(r)[1]):i+=+vc.exec(r)[1]+1}return pc.forEach((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||Ul(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=t[0],i=t[1];r=r.replace(n,i)})),s&&(r=a(r)),r&&"/"!==r[0]&&(r="/".concat(r)),{measureIdx:i,dimensionIdx:n,path:r}}function Cc(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=r.byCells,o=r.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=Ec(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var r=e.brush.ranges();r.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),r.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){var d=n.qHyperCube,m=d.qNoOfLeftDims,f=d.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===m||f>=m)&&m>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:f-m})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var h=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!h.length,a.push({params:[t.path,t.dimensionIdx,h,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=r.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function qc(e){fc.util=e.data("matrix").util,e.data("q",fc),e.formatter("q-number",Qu),e.formatter("q-time",uc)}function Oc(e){var t=Ol(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var r=t.qIsOneAndOnlyOne;return void 0!==r&&r}function Ac(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===Ma(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function Dc(e){var t=e.brush,r=e.colorField,n=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!r||/qAttrDimInfo/.test(r)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&t.removeKeyAlias(n),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(r))):o&&t.addKeyAlias(n,"qHyperCube/".concat(r))}qc.qBrushHelper=Cc,qc.selections=Cc;function Nc(e){var t=e.brush,r=e.getConfig;return{interceptor:function(e){var n=t.brushes(),i=r(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;n.forEach((function(r){var n,i,a;("range"===r.type||null!==(n=e[0])&&void 0!==n&&n.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==r.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));return l.length>1?function(e){var t=e.layout,r=void 0===t?{}:t,n=e.values,i=void 0===n?[]:n;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=Oc({layout:r,path:e}),n=i.filter((function(t){return t.key===e})),o=t?[n.pop()]:n;a.push.apply(a,Na(o))})),a.filter(Boolean)}({layout:s,values:l}):l},rangeInterceptor:function(e){var n=t.brushes(),i=r().allowSimultaneous;return n.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(n.forEach((function(r){var n=r.id===e[0].key||i.includes(r.id)&&i.includes(e[0].key);"range"!==r.type||n||t.clear([])})),e)}}}var Ic=[],Tc=0,wc=function(e){var t=Ic.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},Lc=function(){document.addEventListener("keyup",wc)},Rc=function(){document.removeEventListener("keyup",wc)},kc=function(e,t){Object.keys(t).forEach((function(r){e.on(r,t[r])}))},Pc=function(e,t){Object.keys(t).forEach((function(r){e.removeListener(r,t[r])}))};function jc(e,t,r){if(t&&void 0!==r&&"selectHyperCubeContinuousRange"===e.method){var n=e.params;if(n&&n[1]&&n[1][0]){var i=n[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=r&&(a.qMaxInclEq=!0)}}}function Fc(e){var t=e.chart,r=e.document,n=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=n.event===i,d=r.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var m=t.component(o);return!!m&&(m.emit(u),"string"==typeof s&&t.brush(s).clear(),m)}function Vc(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return Fc({selectionInfo:t,chart:r,document:n,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}function _c(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return Fc({selectionInfo:t,chart:r,document:n,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}function Bc(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=Fc({selectionInfo:t,chart:r,document:n,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var m=d.settings.settings,f=m.scale,p=m.brush,h=r.scale(f).data().fields.map((function(e){return e.id()})),y=r.brush(p),g=y.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));y&&g.length&&g.forEach((function(e){y.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}function Hc(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;Fc({selectionInfo:t,chart:r,document:n,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}function $c(e){var t=e.chart,r=e.selectionInfo,n=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(r&&o.includes(r.event)){var l=r.currentComponent;r.previousComponent!==l&&(n.clear(),s.forEach((function(e){return t.brush(e).end()})))}}function zc(e){var t=e.selectionInfo,r=e.chart,n=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;Fc({selectionInfo:t,chart:r,document:n,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}var Uc=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Aa(e,["chart","document","selections","selectionInfo"]);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function Yc(e){var t,r=e.lasso;null!=r&&null!==(t=r.active)&&void 0!==t&&t.call(r)&&(null==r||r.action(!1))}function Wc(e){var t,r=e.chart,n=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=(a||{}).lasso,c=void 0!==u&&u,d=i.reset,m=void 0===d?Yc:d,f=i.clear,p=!1!==f&&function(e){var t=e.clear,r=void 0===t?Uc:t,n=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:n,selectionInfo:i,chart:o,document:document,cleared:e};return r(Oa({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Vc(Oa(Oa({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _c(Oa(Oa({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Bc(Oa(Oa({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Hc(Oa(Oa({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $c(Oa(Oa({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return zc(Oa(Oa({},t),e))}},t))}}({clear:f,selections:s,selectionInfo:n,chart:r}),h=function(e){var t=e.chart,r=e.lasso,n=e.reset,i=e.clear,o=!1,a={deactivated:function(e){n({e:e,lasso:r})},canceled:function(e){n({e:e,lasso:r}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===n&&delete a.deactivated,!1===i&&delete a.cleared,!1===n&&!1===i&&delete a.canceled,a}({chart:r,clear:p,reset:m,lasso:c}),y={};Object.entries(h).forEach((function(e){var t=Da(e,2),r=t[0],n=t[1];y[r]=function(e,t){return t?function(r){return t({event:r,defaultFunc:e})}:e}(n,l[r])}));var g=function(e){var t=e.selectionEvents,r=e.selections,n=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:r,selectionInfo:n,chart:o,document:a},u=function(e){return Object.assign(n,e||{})},c=function(e){var t=e.event,r=e.components;return function(){return function(e){var t=e.selectionInfo,r=e.clear,n=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(Oa(Oa({},void 0===t?{}:t),{},{event:n,components:o.map((function(e){return e.key})).filter(Boolean)})),r()}({event:t,components:r,clear:i,chart:o,selectionInfo:n,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(Oa(Oa({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:n,clear:p,chart:r,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",g),Object.entries(y).forEach((function(e){var t=Da(e,2),r=t[0],n=t[1];null==s||s.on(r,n)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",g),Object.entries(y).forEach((function(e){var t=Da(e,2),r=t[0],n=t[1];null==s||s.removeListener(r,n)}))}}var Gc=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Kc(e){var t=e.chart,r=e.actions,n=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=(c=void 0===c?{}:c).clear,m=c.reset,f=o.selectionEvents,p=void 0===f?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:f,h=o.brushEvents,y=void 0===h?{}:h,g=o.brushName,v=void 0===g?"selection":g,b=o.brushMaxListeners,x=void 0===b?20:b,M=o.brushRanges,S=void 0!==M&&M,E=o.interceptors,C=void 0===E?{}:E,q=o.selectionsFn,O=void 0===q?i.selections:q,A=t.brush(v);if("number"==typeof x&&A.setMaxListeners(x),S){var D=!0===S?Gc:S;A.configure({ranges:D})}var N={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,singleSelectDims:[],selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.selections,n=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!r)return{layout:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Tc,c=null,d=[],m={};r.on=r.on.bind(r),r.isActive=r.isActive.bind(r),r.addListener=r.addListener.bind(r),r.removeListener=r.removeListener.bind(r);var f=Nc({brush:n,getConfig:function(){return{layout:c,allowSimultaneous:d}}}),p=f.rangeInterceptor,h=f.interceptor;n.intercept("set-ranges",p),n.intercept("toggle-ranges",p),n.intercept("toggle-values",h),n.intercept("set-values",h),n.intercept("add-values",h),n.on("start",(function(){return r.begin(l)}));var y={activate:function(){},deactivated:function(){return n.end()},cleared:function(){return n.clear()},canceled:function(){return n.end()}};kc(r,y);var g=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;n.start(),"function"==typeof o.select.getBrushOptions&&(m=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){a(n,m,c).forEach((function(e){jc(e,o.select.brushSelectionIncludeMax,g),r.select(e)}))}))):n.on("update",(function(){a(n,m,c).forEach((function(e){return r.select(e)}))})),0===Ic.length&&Lc(),Ic.push({key:u,selections:r}),{layout:function(e){c=e},allowSimultaneous:function(e){d=e},release:function(){c=null;var e=Ic.indexOf(Ic.filter((function(e){return e.key===u}))[0]);-1!==e&&Ic.splice(e,1),Ic.length||Rc(),Pc(r,y)}}}({brush:A,majorScale:u,actions:r,selections:n,picassoQ:i,selectionsFn:O});!function(e){var t=e.brush,r=e.interceptors,n=void 0===r?{}:r;Object.entries(n).forEach((function(e){var r=Da(e,2),n=r[0],i=r[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(n,e)}))}))}({brush:A,interceptors:C});var T=function(e){var t=e.chart,r=e.selectionActions,n=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,r=e.chart,n=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=Da(e,2),o=i[0],a=i[1],s=function(){return a({chart:r,selectionInfo:n})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var r=Da(e,2),n=r[0],i=r[1];t.removeListener(n,i)}))}}({brush:n,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=Wc({chart:t,selectionInfo:o,selectionActions:r,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var r=!1,n=function(e){r||"Shift"!==e.key||(t.lasso.action(!0),r=!0)},i=function(e){"Shift"===e.key&&(t.lasso.action(!1),r=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:A,actions:r,selections:n,selectionInfo:N.selectionInfo,selectionActions:{clear:d,reset:m},selectionEvents:p,brushEvents:y});if(s){var w=!0===s?Na(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;I.allowSimultaneous(w)}return{unbindEvents:T,state:N,picassoSelections:I,brush:A}}function Xc(e){var t=e.chart,r=e.selections,n=e.actions,i=void 0!==n&&n,o=e.config,a=void 0===o?{}:o,s=Kc({chart:t,actions:i,selections:r,picassoQ:qc,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,m=a.custom,f=void 0===m?{}:m,p=a.legendAlias,h=void 0===p?void 0:p,y=a.setBrushAliases,g=void 0===y?Dc:y;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==r||null===(t=r.isLocked)||void 0===t?void 0:t.call(r))&&void 0!==e?e:Ac(n)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,r,n,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(r=null==a?void 0:a.qHyperCube)&&void 0!==r?r:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return Oc({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,r=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,n=void 0===r?[]:r;return null!==(t=n.map((function(e,t){var r;return!(e.qLocked||(null===(r=e.qCardinalities)||void 0===r?void 0:r.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(n.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(n=u[0])||void 0===n||!n.qLocked),s}({selections:r,picassoSelections:c,layout:e});Object.assign(u,t)},setBrushAliases:function(e){var t=e.colorField,r=e.useLegendCube,n=void 0!==r&&r,i=Aa(e,["colorField","useLegendCube"]),o=Oa({useLegendCube:n,colorField:t,brush:d,legendAlias:h},i);g(Oa(Oa({},o),{},{defaultFunc:function(){return Dc(o)}}))},destroy:function(){l(),c.release()},custom:Oa({},f)}}var Jc="QlikView Sans, sans-serif",Zc="#737373",Qc="#cccccc",ed="#e6e6e6";function td(e){var t={};return[].concat(Na(e),Na([["","","color"],["object","axis.title","fontFamily",Jc],["object","axis.title","fontSize","13px"],["object","axis.title","color"],["object","axis.label.name","fontFamily",Jc],["object","axis.label.name","fontSize","12px"],["object","axis.label.name","color","#595959"],["object","axis.line.major","color",Qc],["object","axis.line.minor","color",ed],["object","grid.line.major","color",Qc],["object","grid.line.minor","color",ed],["object","grid.line.highContrast","color",ed],["object","referenceLine.label.name","fontFamily",Jc],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.label.name","color","#333333"],["object","referenceLine.outOfBounds","fontFamily",Jc],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","color",ed],["object","referenceLine.outOfBounds","backgroundColor",Zc,function(e){return"transparent"===e?Zc:e}]])).reduce((function(e,r){var n="".concat(r[0],"-").concat(r[1],"-").concat(r[2],"}");return t[n]||(t[n]=!0,e.push(r)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}function rd(e,t){var r={};return e.forEach((function(e){var n=Da(e,5),i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],u=(void 0===l?function(e){return e}:l)(function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(!e||!1===t)return i;var o=e.getStyle(t,r,n);return void 0===o?i:o}(t,i,o,a,s));Al(r,[o,a].filter(Boolean).join("."),u)})),r}function nd({key:e,source:t,layoutService:r,fieldModel:n,colorService:i,series:o}){const{meta:a}=r;if(a.isBarSeriesStacked){const{major:a,majorNumeric:s}=n.main,l=o.filter((e=>e.type===ta.BAR)),u=r.meta.isContinuous?s:a,c=e=>"NaN"!==e.qNum?e.qNum:0;return[{key:e,data:{extract:l.map((({ref:e,typeIndex:n,refIndex:o})=>({source:t,field:a,value:r.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},segment:{field:e,value:c,reduceLabel:"none"},end:{field:e,value:c,reduceLabel:"none"},null:{fields:l.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},typeIndex:n,...i.getDatumProps(o),customTooltipAttrExps:va.getNode(r.getLayout(),r.meta),sumOfPositives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"}}}))),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}]}return[]}function id({key:e,series:t,source:r,fieldModel:n,colorService:i,layoutService:o,forceCreate:a=!1}){if(t.length||a){const{major:a,majorNumeric:s}=n.main,l=e=>"NaN"!==e.qNum?e.qNum:0,u=o.meta.isContinuous?s:a;return[{key:e,data:{extract:t.map((({ref:e,refIndex:t,typeIndex:n,options:s},c)=>({source:r,field:a,value:o.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},end:{field:e,value:s.showAsZeros?l:void 0,reduceLabel:"none"},start:0,line:c,typeIndex:n,null:{field:e,value:e=>"NaN"===e.qNum,reduceLabel:"none"},customTooltipAttrExps:va.getNode(o.getLayout(),o.meta),...i.getDatumProps(t)}})))}}]}return[]}function od({key:e,layoutService:t,fieldModel:r,series:n}){const{meta:i}=t;if(i.isBarSeriesStacked){const{major:t,majorNumeric:o}=r.main,a=n.filter((e=>e.type===ta.BAR)),s=i.isContinuous?{field:o,value:e=>e.qNum,reduceLabel:"none"}:[];return[{key:e,data:{extract:{field:0,props:{major:{field:i.isContinuous?o:t},null:{fields:a.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},sumOfPositives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},timeStart:s,timeEnd:s},value:i.isContinuous?e=>e.qNum:void 0}}}]}return[]}const ad={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var sd={OPTIONS:ad,DEFAULT:ad.MINI_CHART};function ld({layoutService:e,discrete:t}){return({h:r,rect:n,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=n[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 r("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 ud({layoutService:e,viewState:t,viewCache:r}){return e.meta.isContinuous?function(e,t){const r=e.get("zoom"),n=t.get("continuousMin"),i=t.get("continuousMax");return[(r.min-n)/(i-n),(r.max-n)/(i-n)]}(t,r):function(e){return e.get("viewRange")}(t)}const cd=e=>({miniChart:e===sd.OPTIONS.MINI_CHART.value,bar:e===sd.OPTIONS.BAR.value,none:e===sd.OPTIONS.NONE.value});function dd({layoutService:e,override:t}){const r=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return cd(t);const r=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===r)return cd(sd.DEFAULT.value);const n=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return cd(!r&&(n||!n&&i)?sd.OPTIONS.NONE.value:sd.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:r})&&(r.miniChart=t.value===sd.OPTIONS.MINI_CHART.value,r.bar=t.value===sd.OPTIONS.BAR.value,r.none=t.value===sd.OPTIONS.NONE.value),r}function md({componentKey:e,chart:t,viewState:r,viewCache:n,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===o.meta.major.orientation,f=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=m?d.rect.computedInner.width:d.rect.computedInner.height,h=m&&a?p-f:f,y=Math.max(0,Math.min(h/p,1)),[g,v]=ud({layoutService:i,viewState:r,viewCache:n}),b=y<g,x=y>v,M=!b&&!x;return{pixel:h,relative:y,thumb:M?h-g*p:0,beforeThumb:b,afterThumb:x,onThumb:M}}}function fd({componentKey:e,chart:t,viewState:r,viewCache:n,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,m]=ud({layoutService:i,viewState:r,viewCache:n});return{size:c,thumbSize:(m-d)*c}}}function pd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=md({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=fd({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(n,i)=>!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(r){r.preventDefault();const a=u(r);if(o.meta.isContinuous){const e=n.get("zoom"),t=e.max-e.min,r=i.get("continuousMin"),o=i.get("continuousMax"),s=r+(o-r)*a.relative;n.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,r+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,r=Math.max(0,t/e.size);s.command.scrollTo(r)}t.component(e).emit("render")}}}}function hd({e:e}){return(e.srcEvent||e).srcElement.getAttribute("data-scrollbar-handle")||""}const yd="scrollbarResize";function gd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=md({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:"event:scrollbarResize",options:{event:yd,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!r.scroll.enabled())&&(!t||(this[yd]=this[yd]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&hd({e:t})&&(this[yd].panningEvent=t.srcEvent),!!this[yd].panningEvent))}},events:{scrollbarResizestart(r){r.preventDefault(),this[yd]=this[yd]||{},this[yd].panningEvent&&t.component(e).emit("dragStart",this[yd].panningEvent)},scrollbarResizemove(r){if(r.preventDefault(),this[yd]=this[yd]||{},!this[yd].panningEvent)return;const o=n.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(r).relative+a,d=hd({e:this[yd].panningEvent});let m="start"===d?Math.min(c,o.max):o.min,f="end"===d?Math.max(c,o.min):o.max;m===f&&(m-="start"===d?u:0,f+="end"===d?u:0),n.set("zoom",{min:m,max:f}),t.component(e).emit("render")},scrollbarResizeend(r){r.preventDefault(),this[yd]=this[yd]||{},delete this[yd].panningEvent,t.component(e).emit("dragEnd")},scrollbarResizecancel(r){r.preventDefault(),this[yd]=this[yd]||{},delete this[yd].panningEvent,t.component(e).emit("dragEnd")}}}}const vd="scrollbarPan";function bd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=md({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=fd({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:"event:scrollbarPan",options:{event:vd,threshold:0,enable(n,i){return this[vd]=this[vd]||{},!(i&&!this[vd].isPanning)||!!r.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{scrollbarPanstart(r){r.preventDefault();const a=u(r);if(this[vd]=this[vd]||{},this[vd].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=n.get("zoom"),t=e.max-e.min,r=i.get("continuousMin"),o=i.get("continuousMax"),s=r+(o-r)*a.relative;s<e.min?n.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,r+t)}):s>e.max&&n.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,r+t)}),this[vd].relative=a.relative,this[vd].zoom=n.get("zoom"),this[vd].zoom.span=this[vd].zoom.max-this[vd].zoom.min,this[vd].zoom.fullSpan=o-r}else if(a.onThumb)this[vd].offset=a.thumb;else{const e=c();this[vd].offset=a.beforeThumb?0:e.thumbSize}},scrollbarPanmove(r){r.preventDefault();const a=u(r);if(this[vd]=this[vd]||{},o.meta.isContinuous){const e=a.relative-this[vd].relative,{fullSpan:t,span:r,min:o,max:s}=this[vd].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");n.set("zoom",{min:Math.min(o+e*t,u-r),max:Math.max(s+e*t,l+r)})}else{const e=a.pixel-(this[vd].offset||0),t=c(),r=Math.max(0,e/t.size);s.command.scrollTo(r)}t.component(e).emit("render")},scrollbarPanend(r){r.preventDefault(),this[vd]=this[vd]||{},this[vd].isPanning=!1,t.component(e).emit("unlockState")},scrollbarPancancel(r){r.preventDefault(),this[vd]=this[vd]||{},this[vd].isPanning=!1,t.component(e).emit("unlockState")}}}}function xd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[pd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),gd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,rtl:l}),bd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function Md({componentKey:e,chart:t,actions:r,layoutService:n}){const i=(i,o)=>{if(!n.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&r.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const Sd={background:"rgba(0, 0, 0, 0.1)"},Ed={top:-1,bottom:-1,width:6},Cd={width:2,background:"#595959"};var qd={before:Sd,after:Sd,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Ed,endHandle:Ed,startHandleBorder:Cd,endHandleBorder:Cd};const Od={background:"rgba(0, 0, 0, 0.1)"},Ad={top:-1,bottom:-1,width:6},Dd={width:2,background:"#595959"};var Nd={before:Od,after:Od,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Ad,endHandle:Ad,startHandleBorder:Dd,endHandleBorder:Dd};const Id={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Td={pointerEvents:"initial"},wd={pointerEvents:"none"};const Ld="ew-resize",Rd="default";function kd(){const{rect:e}=this,{settings:t}=this.settings,r="horizontal"===t.orientation,n=r?e.computedInner.width:e.computedInner.height,i=t.range(),o=r&&t.rtl;return{size:n,start:(o?1-i[1]:i[0])*n,end:(o?1-i[0]:i[1])*n}}function Pd(){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?Ld:Rd}function jd(e,t,r){const{min:n}=this.settings.settings.size.thumb;if(r-t<n){const i=(n-(r-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,r+i-e);return{size:e,start:t-i+o,end:r+i+o}}return{size:e,start:t,end:r}}function Fd(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Vd(){const{size:e,start:t,end:r}=kd.call(this);this.renderer.render(this.elements(this.h,jd.call(this,e,t,r)))}function _d(){const{state:e,settings:t,style:r}=this,n=t.settings.style;return e.style[n]||(e.style[n]=function({id:e,style:t}){const r="slim"===e?Nd:qd;return{container:{...Id},before:{...Id,...r.before,...t.before},after:{...Id,...r.after,...t.after},thumb:{...Id,...r.thumb,...t.thumb},startHandle:{...Id,...Td,...r.startHandle},endHandle:{...Id,...Td,...r.endHandle},startHandleBorder:{...Id,...wd,...r.startHandleBorder},endHandleBorder:{...Id,...wd,...r.endHandleBorder}}}({id:t.settings.style,style:r[n]})),e.style[n]}var Bd={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(){Vd.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||!Fd.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=hd({e:e});t&&(this.state.hover[t]=!0),Pd.call(this),Vd.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Pd.call(this),Vd.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=hd({e:e});t&&(this.state.drag[t]=!0),Pd.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Pd.call(this),Vd.call(this))}},preferredSize({outer:e}){const{min:t,max:r,ratio:n}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(r,e[i]*n))},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:r,end:n}=kd.call(this);return this.elements(e,jd.call(this,t,r,n))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:r,end:n}){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:r,end:n,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-r},m={[i.start]:n},f={left:-3},p={left:1},h={right:-3,left:"auto"},y={left:3},g=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:f},class:"scrollbar--start-handle","data-scrollbar-handle":"start"},o?e("div",{style:{...s.startHandleBorder,...u?y:p}}):void 0);b.push(t);const r=e("div",{style:{...s.endHandle,...u?f:h},class:"scrollbar--end-handle","data-scrollbar-handle":"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:y}}):void 0);b.push(r)}const x=e("div",{style:{...s.thumb,[i.start]:r,[i.end]:t-n},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[g,x,v,...c])}({h:e,size:t,start:r,end:n,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:_d.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};function Hd({layoutService:e}){return e.meta.isContinuous&&dd({layoutService:e}).miniChart}function $d({models:e}){const{layoutService:t,fieldModel:r,seriesModel:n,colorService:i}=e,{primarySeries:o,secondarySeries:a}=n.meta,s=n.query.series(ta.LINE),l=[...id({forceCreate:!0,key:ea.COLLECTION.PRIMARY,series:o,fieldModel:r,colorService:i,layoutService:t}),...id({key:ea.COLLECTION.SECONDARY,series:a,fieldModel:r,colorService:i,layoutService:t}),...id({key:ea.COLLECTION.LINE,series:s,fieldModel:r,colorService:i,layoutService:t}),...nd({key:ea.COLLECTION.STACKED_PRIMARY,layoutService:t,fieldModel:r,colorService:i,series:o}),...nd({key:ea.COLLECTION.STACKED_SECONDARY,layoutService:t,fieldModel:r,colorService:i,series:a}),...od({key:ea.COLLECTION.STACKED_TOTAL_PRIMARY,layoutService:t,fieldModel:r,series:o}),...od({key:ea.COLLECTION.STACKED_TOTAL_SECONDARY,layoutService:t,fieldModel:r,series:a})];return Hd(e)&&(l.push(...id({key:ea.COLLECTION.REDUCED,source:ea.DATA.REDUCED,series:n.query.all(),fieldModel:r,colorService:i,layoutService:t})),l.push(...id({key:ea.COLLECTION.REDUCED_PRIMARY,source:ea.DATA.REDUCED,series:o,fieldModel:r,colorService:i,layoutService:t})),l.push(...id({key:ea.COLLECTION.REDUCED_SECONDARY,source:ea.DATA.REDUCED,series:a,fieldModel:r,colorService:i,layoutService:t})),l.push(...nd({key:ea.COLLECTION.REDUCED_STACKED_PRIMARY,source:ea.DATA.REDUCED,layoutService:t,fieldModel:r,series:n.meta.primarySeries.filter((e=>e.type===ta.BAR)),colorService:i})),l.push(...nd({key:ea.COLLECTION.REDUCED_STACKED_SECONDARY,source:ea.DATA.REDUCED,layoutService:t,fieldModel:r,series:n.meta.secondarySeries.filter((e=>e.type===ta.BAR)),colorService:i}))),l}const zd=({layoutService:e,dockService:t})=>"custom"!==e.getLayoutValue("dimensionAxis.axisDisplayMode")?Math.min(200,t.meta.chart.size["horizontal"===t.meta.major.orientation?"height":"width"]/4):void 0;function Ud({models:e}){const{dockService:t,seriesModel:r}=e;if(1!==r.meta.measureAxes.length)return.5;const n=r.meta.measureAxes[0].isPrimary?t.meta.minor.dock:t.meta.minorSecondary.dock;return"horizontal"===t.meta.minor.orientation?"near"===n||"bottom"===n?1:0:"near"===n||"left"===n?0:1}const Yd=({models:e,environment:t})=>{const{fieldModel:r,discreteModel:n,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{data:{extract:{field:r.main.major,props:{selectionDimension:{field:r.main.major}}}},maxPxStep:zd({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:n.query.getScaleRange,align:Ud({models:e})}},Wd=({models:e,environment:t})=>{const{fieldModel:r,discreteModel:n,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{type:"group-by-measure",data:{extract:{field:r.main.major}},measureCount:i.meta.groupSize,maxPxStep:zd({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:n.query.getScaleRange,align:Ud({models:e})}};function Gd({viewState:e,models:t,environment:r}){const{fieldModel:n,dockService:i}=t,{orientation:o}=i.meta.major;return{type:"linear",invert:"horizontal"===o&&"rtl"===r.options.direction,data:{extract:{field:n.main.majorNumeric}},ticks:{forceBounds:!0,count:e.get("zoom").min===e.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>e.get("zoom").min,max:()=>e.get("zoom").max}}function Kd({viewCache:e,mainMajor:t}){return U(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}function Xd({viewState:e,viewCache:t,layoutService:r}){return t.set("qTimeAxisCache",[]),{get:(e,r=0)=>{const n=t.get("qTimeAxisCache");return n[r]&&n[r][0]===e?n[r][1]:void 0},set:(e,r,n=0)=>{t.get("qTimeAxisCache")[n]=[e,r]},key:({distance:n})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=r.getHyperCubeValue("qAxisData.qAxis",[]).map((e=>e.qName));return[n,Number.parseFloat(a).toFixed(12),...s].toString()}}}function Jd({picasso:e,viewState:t,viewCache:r,models:n,environment:i}){const{layoutService:o,fieldModel:a,appLayoutModel:s,themeService:l}=n,{measureText:u}=e.renderer("svg")(),{majorNumeric:c}=a.main,d=l.getStyles(),m={type:"time",data:{field:c},qAxis:()=>o.getHyperCubeValue("qAxisData.qAxis",[]),field:c,min:()=>t.get("zoom").min,max:()=>t.get("zoom").max,invert:"rtl"===i.options.direction,formatter:{fn:e.formatter("q-time"),localeInfo:s.qLocaleInfo,qNumFormat:o.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:d.axis.label.name.fontFamily,fontSize:d.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:t.get("zoom").min},anchor:"start",clamp:!0},cache:Xd({viewState:t,viewCache:r,layoutService:o})};return{[ea.SCALE.MAJOR]:U(!0,{},m,{ticks:{level:"outer"}}),[ea.SCALE.MAJOR_INNER]:U(!0,{},m,{ticks:{level:"inner"}})}}function Zd({picasso:e,models:t,viewState:r,viewCache:n,environment:i}){const{meta:o}=t.layoutService,a=o.isTime?{...Jd({picasso:e,viewState:r,viewCache:n,models:t,environment:i})}:o.isContinuous?{[ea.SCALE.MAJOR]:Gd({models:t,viewState:r,environment:i})}:o.isBarSeriesGrouped?{[ea.SCALE.MAJOR]:Wd({models:t,environment:i})}:{[ea.SCALE.MAJOR]:o.isBarSeriesStackedInBothAxis?Wd({models:t,environment:i}):Yd({models:t,environment:i})};return Hd(t)?{...a,[ea.SCALE.REDUCED]:Kd({viewCache:n,mainMajor:a[ea.SCALE.MAJOR]})}:a}function Qd({fields:e,tickModel:t,dockService:r,environment:n}){const i="rtl"===n.options.direction,{orientation:o}=r.meta.minor;return{data:{source:"qHyperCube",fields:e},invert:"vertical"===o||i,ticks:{values:t.query.getValues},min:t.query.getMin,max:t.query.getMax}}function em({layoutService:e,tickModel:t,dockService:r,environment:n}){if(!Hd({layoutService:e}))return;const i="rtl"===n.options.direction,{orientation:o}=r.meta.minor;return{type:"linear",invert:"vertical"===o||i,min:t.query.getMin,max:t.query.getMax}}function tm({picasso:e,models:t,viewState:r,viewCache:n,environment:i}){const{layoutService:o,fieldModel:a,primaryTickModel:s,secondaryTickModel:l,colorService:u,dockService:c}=t;return{...Zd({picasso:e,models:t,viewState:r,viewCache:n,environment:i}),[ea.SCALE.MINOR.PRIMARY]:Qd({fields:a.main.minorsPrimary,tickModel:s,dockService:c,environment:i}),[ea.SCALE.MINOR.SECONDARY]:Qd({fields:a.main.minorsSecondary,tickModel:l,dockService:c,environment:i}),[ea.SCALE.MINOR.REDUCED_PRIMARY]:em({layoutService:o,tickModel:s,dockService:c,environment:i}),[ea.SCALE.MINOR.REDUCED_SECONDARY]:em({layoutService:o,tickModel:l,dockService:c,environment:i}),...u.custom.wrappedScales()}}var rm={AXIS:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"SMALL"},VERTICAL:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"MEDIUM"},VERTICAL:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REFERENCE_LINE:"SPARK"};const nm=["all","labels"];function im({models:e}){const{layoutService:t,dockService:r,seriesModel:n,themeService:i}=e,o=t.getLayoutValue("measureAxes");if(!o||!o.length)return!1;const a=i.getStyles(),{measureAxes:s}=n.meta;return s.filter((e=>{const t=e.isPrimary?0:1;return nm.some((e=>o[t].show===e))})).map((e=>({type:"axis",key:e.isPrimary?ea.COMPONENT.AXIS.MINOR.PRIMARY:ea.COMPONENT.AXIS.MINOR.SECONDARY,scale:e.scale,layout:{dock:e.isPrimary?r.meta.minor.dock:r.meta.minorSecondary.dock,minimumLayoutMode:rm.AXIS.MINOR},settings:{labels:{show:!0,fontFamily:a.axis.label.name.fontFamily,fontSize:a.axis.label.name.fontSize,fill:a.axis.label.name.color},line:{stroke:a.axis.line.major.color},ticks:{stroke:a.axis.line.major.color},minorTicks:{stroke:a.axis.line.minor.color}}})))}var om=.5,am=3,sm=13;function lm({models:e,environment:t}){const{layoutService:r,dockService:n,themeService:i}=e,o="rtl"===t.options.direction,a=r.getLayoutValue("dimensionAxis"),s=i.getStyles(),l=(({layoutService:e})=>{const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[r]=e.getDataPages(),n=r?r.qMatrix:[];return ue.getAdjustedMaxGlyphCount(t,n,0,"qText")})({layoutService:r}),{orientation:u}=n.meta.major,c="horizontal"===u?a.label:"auto";return{type:"axis",key:ea.COMPONENT.AXIS.MAJOR,scale:ea.SCALE.MAJOR,layout:{dock:n.meta.major.dock,minimumLayoutMode:rm.AXIS.MAJOR[u.toUpperCase()]},settings:{labels:{mode:a.label,tiltAngle:o?-40:40,maxEdgeBleed:50,maxLengthPx:"horizontal"===c?void 0:n.meta.minor.size/4,maxGlyphCount:l,tiltThreshold:l>am&&l<sm?1:void 0,fontFamily:s.axis.label.name.fontFamily,fontSize:s.axis.label.name.fontSize,fill:s.axis.label.name.color}},brush:{consume:[{context:"selection",style:{inactive:{opacity:om}}}]}}}function um({models:e}){const{dockService:t,themeService:r}=e,{orientation:n}=t.meta.major,i=r.getStyles();return{type:"axis",key:ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,scale:ea.SCALE.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:rm.AXIS.MAJOR[n.toUpperCase()]},settings:{labels:{align:0,offset:4,fontFamily:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:i.axis.label.name.color},line:{show:!1}}}}function cm({models:e,environment:t}){const{layoutService:r}=e,n=r.getLayoutValue("dimensionAxis");if(!n)return[];const{show:i}=n;return"none"===i||"title"===i?[]:r.meta.isTime?function({models:e,environment:t}){const{dockService:r,themeService:n}=e,i="rtl"===t.options.direction,{orientation:o}=r.meta.major,a="bottom"===r.meta.major.dock?0:1,s=n.getStyles(),l=i?1:0,u={type:"time-axis",renderer:"svg",layout:{dock:r.meta.major.dock,minimumLayoutMode:rm.AXIS.MAJOR[o]},preferredSize:()=>({size:2*parseFloat(s.axis.label.name.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:i?"end":"start",label:{align:a,justify:l},guideLine:{major:{justify:l},minor:{align:a}},line:{show:!1}},style:{label:{fontFamily:s.axis.label.name.fontFamily,fontSize:s.axis.label.name.fontSize,fill:s.axis.label.name.color},majorGuideLine:{stroke:s.axis.line.major.color},minorGuideLine:{stroke:s.axis.line.minor.color}}};return[U(!0,{},u,{key:ea.COMPONENT.AXIS.TIME_INNER,scale:ea.SCALE.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}}},style:{majorGuideLine:{stroke:s.axis.line.minor.color},minorGuideLine:{stroke:s.axis.line.major.color}}}),U(!0,{},u,{key:ea.COMPONENT.AXIS.TIME_OUTER,scale:ea.SCALE.MAJOR,settings:{guideLine:{minor:{show:!1}}}})]}({models:e,environment:t}):r.meta.isContinuous?[um({models:e})]:[lm({models:e,environment:t})]}const dm=({layoutService:e,axis:t})=>e.meta.isBarSeriesGrouped?({scale:e,datum:t})=>e([t.value,t.typeIndex.value])+e.bandwidth()/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:r})=>e([r.value,t])+e.bandwidth()/2:null,mm=({layoutService:e,seriesModel:t,rtl:r,orientation:n})=>e.meta.isContinuous?null:e.meta.isBarSeriesGrouped?({scale:e,datum:i})=>e([i.value,r&&"horizontal"===n?t.meta.barSeriesCount-1:0])+e.bandwidth()*t.meta.barSeriesCount/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:t})=>e([t.value,r&&"horizontal"===n?1:0])+e.bandwidth():null;function fm({layoutService:e,active:t={},inactive:r={}}){return{consume:[{context:"selection",data:["selectionDimension","end","color","major"],style:{active:{strokeWidth:e.meta.isContinuous?0:2,stroke:"#000",opacity:e=>{var t,r;return!0===(null===(t=e.data)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)?0:1},...t},inactive:{opacity:e=>{var t,r;return!0===(null===(t=e.data)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)?0:om},...r}}}]}}var pm="max",hm="min";function ym(e,t){return function(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n}(e,t)||function(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n}(e,t)}const gm=(e,t)=>`${e}-${t.id}`,vm=4,bm=12,xm=4;function Mm({chart:e,layoutService:t,dockService:r,markerKey:n,markerType:i}){if(t.meta.isContinuous)return()=>xm+"px";const o={size:void 0},a="horizontal"===r.meta.major.orientation?"width":"height";return t=>{if(!o.size){const r=e.component(n),s=t.resources.scale(ea.SCALE.MAJOR),l=r.rect[a]*s.bandwidth()*.25,u=Math.max(vm,Math.min(bm,l));o.size=("bar"===i?2*u:u)+"px"}return o.size}}const{isDark:Sm}=lt;const Em=({chart:e,models:t,series:r,environment:n})=>{const{layoutService:i,seriesModel:o,colorService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,c=a.getColor(),{fill:d,marker:m}=r.options,{isContinuous:f}=i.meta,p="rtl"===n.options.direction,{orientation:h}=s.meta.major,y="horizontal"===h,g=(r.isPrimary?l:u).query.getExtrema(),v=({end:e})=>{const{value:t}=e;return ym(t,g)},b=gm(ea.COMPONENT.MARKER,r);return{type:"point",key:b,data:{filter:e=>r.ref===e.end.source.field,collection:r.collection},settings:{[y?"x":"y"]:{scale:ea.SCALE.MAJOR,fn:mm({layoutService:i,seriesModel:o,rtl:p,orientation:h}),ref:f?"major":void 0},[y?"y":"x"]:{scale:r.scale,ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(r))}},fill:d?c:"none",opacity:e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)||v(e.datum)?0:1},stroke:e=>{const t=c(e);return d?Sm(t)?function(e){return Fe(e).brighter(.5).toString()}(t):function(e){return Fe(e).darker().toString()}(t):t},size:Mm({chart:e,layoutService:i,dockService:s,markerKey:b,markerType:m}),shape:()=>(({marker:e,horizontal:t,rtl:r})=>{let n;return"triangle"!==e||t||(n=r?"left":"right"),"bar"===e&&(n=t?"horizontal":"vertical"),n?{type:e,direction:n}:{type:e}})({marker:m,horizontal:y,rtl:p})},brush:fm({layoutService:i,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:om}}})}};function Cm({property:e="end",isHorizontal:t,isColor:r,fallback:n,rtl:i}){return function(o){const{datum:a,resources:{scale:s}}=o,l=s(ea.SCALE.MAJOR),u=s(ea.SCALE.COLOR),c=t&&i?[...a.points].reverse():a.points,d=c.reduce(((t,r,n)=>{const i="NaN"===r[e].value||Number.isNaN(r[e].value),o=c[n+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(r):t.push(r),t}),[]),m="group-by-measure"===l.type?e=>l([e.major.value,e.typeIndex.value]):e=>l(e.major.value),f=d.map(m),p=Math.min(...f),h=Math.max(...f)-p,y=0===h?1:h,g=f.map(((e,t)=>0===t?0:t===f.length-1?1:(e-p)/y)),v=[];for(let t=0;t<d.length;t++){const i=d[t],o=i.color&&i.color.value,a=r?o||n:u(o)||n,s=0===t,l=t===d.length-1,c=g[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))v[t-1].virtual||v.push({virtual:!0});else{const r=d[t-1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?v.push({color:a,offset:s?0:Math.max(0,parseFloat((c-(c-g[t-1])/2).toFixed(5)))}):v.push({color:a,offset:c});const n=d[t+1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?v.push({color:a,offset:l?1:Math.max(0,parseFloat((c+(g[t+1]-c)/2).toFixed(5)))}):v.push({color:a,offset:c})}}const b=v.reduce(((e,t,r)=>{if(t.virtual){const t=v[r-1],n=v[r+1],i=t.offset+(n.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:n.color,offset:i})}else e.push(t);return e}),[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:b}}}function qm({environment:e,models:t,measureIndex:r}){const{layoutService:n,colorService:i,dockService:o}=t,a="rtl"===e.options.direction,{hasMultipleMeasures:s}=n.meta,{mode:l,type:u,nil:c}=i.getSettingsForMeasure(r),d="horizontal"===o.meta.major.orientation;if(!l||"constant"===u)return i.getColor();if("measure"===l&&"categorical"===u)return i.getColor();const m=n.getHyperCubeValue(`qMeasureInfo.${r}.color`);if(null!=m&&m.on)return"byExpression"===m.mode?Cm({isHorizontal:d,isColor:!0,fallback:c,rtl:a}):i.getColor();const f=n.getLayoutValue("color",{}),p=!f.auto&&"byExpression"===f.mode,h=!!f.colorExpression;if(p&&!h)return c;const y=!f.auto&&"byMeasure"===f.mode&&f.byMeasureDef&&void 0!==f.byMeasureDef.activeMeasureIndex;return s||!y?Cm({isHorizontal:d,isColor:"color"===u,fallback:c,rtl:a}):"continuous"===u?function({isHorizontal:e,rtl:t}){return function(r){const{datum:{points:n},resources:{scale:i}}=r,o=i(ea.SCALE.COLOR),a=n.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e))),offset:Math.min(1,Math.max(0,(e-s)/c))})));return{type:"gradient",x1:!e&&t?1:0,x2:e||t?0:1,y1:e?1:0,y2:0,stops:d}}}({isHorizontal:d,rtl:a}):function({isHorizontal:e,isArea:t,fallback:r,rtl:n}){return function(i){const{datum:{points:o},resources:{scale:a}}=i,s=a(ea.SCALE.COLOR),l=o.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),u=Math.min(...l),c=Math.max(...l),d=t?Math.min(0,u):u,m=(t?Math.max(0,c):c)-d,f=0===m?1:m,p=s.domain(),h=[];for(let e=0;e<p.length-1;e++){const t=p[e],n=s(t)||r;h.push({color:n,offset:Math.min(1,Math.max(0,(t-d)/f))});const i=p[e+1];h.push({color:n,offset:Math.min(1,Math.max(0,(i-d)/f))})}return{type:"gradient",x1:!e&&n?1:0,x2:e||n?0:1,y1:e?1:0,y2:0,stops:h}}}({isHorizontal:d,fallback:c,rtl:a})}const Om=({models:e,environment:t,series:r})=>{const{layoutService:n,seriesModel:i,dockService:o,styleModel:a}=e,s="rtl"===t.options.direction,{orientation:l}=o.meta.major,u=mm({layoutService:n,seriesModel:i,rtl:s,orientation:l});return{key:gm(ea.COMPONENT.LINE,r),type:"line",data:{filter:e=>r.ref===e.end.source.field,collection:r.collection},settings:{coordinates:{major:{scale:ea.SCALE.MAJOR,fn:u},minor:{scale:r.scale,ref:"end"}},layers:{curve:a.query.line.getCurveFn(),line:{stroke:qm({models:e,environment:t,measureIndex:r.refIndex}),strokeWidth:a.query.line.getStrokeWidthFn(),strokeDasharray:a.query.line.getStrokeDasharrayFn(),strokeLinejoin:"round"}},connect:r.options.showAsConnections,orientation:o.meta.major.orientation},brush:fm({layoutService:n,active:{stroke:void 0,strokeWidth:void 0,opacity:om},inactive:{opacity:om}})}};var Am={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}},LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone",STEP:"step"},WIDTH:{FULL:{DEFAULT:2,ACTIVE:2},LESS:{DEFAULT:1,ACTIVE:1}},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4}}};function Dm({series:e,layoutService:t}){const{showAsConnections:r}=e.options,n=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:r}=e.end;return"NaN"===r||Number.isNaN(r)}}({layoutService:t}),i=r?(e,t)=>0!==e&&t.slice(0,e).reverse().some((e=>!n({item:e}))):(e,t)=>0!==e&&!n({item:t[e-1]}),o=r?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some((e=>!n({item:e}))):(e,t)=>e!==t.length-1&&!n({item:t[e+1]});return({index:e,items:t})=>({before:i(e,t),after:o(e,t)})}const Nm=3,Im=20;function Tm({models:e,series:t,environment:r}){const{layoutService:n,colorService:i,seriesModel:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u,selectionService:c}=e,d=n.getLayoutValue("dataPoint.show",!1),{orientation:m}=a.meta.major,f="horizontal"===m,p="SPARK"===a.meta.chart.mode,h=i.getColor(),{POINT:y}=Am,g=function({layoutService:e,series:t}){const r={key:void 0,map:void 0},n=Dm({series:t,layoutService:e});return({item:e,items:t})=>{r.key!==t&&(r.key=t,r.map=function({items:e}){return e.reduce(((e,t)=>{const{value:r}=t.line;return e[r]||(e[r]={items:[],keys:[]}),e[r].items.push(t),e[r].keys.push(`${t.major.value}-${t.line.value}`),e}),{})}({items:t}));const{value:i}=e.line,o=r.map[i],a=`${e.major.value}-${i}`,s=o.keys.indexOf(a),{before:l,after:u}=n({index:s,items:o.items});return!l&&!u}}({series:t,layoutService:n}),v="rtl"===r.options.direction,b=(t.isPrimary?l:u).query.getExtrema(),{isContinuous:x}=n.meta,M=({end:e})=>{const{value:t}=e;return ym(t,b)};return{type:"point",key:gm(ea.COMPONENT.POINT,t),data:{filter:e=>t.ref===e.end.source.field,collection:t.collection},preferredSize:()=>({edgeBleed:{top:f?y.SIZE.DEFAULT/2:0}}),settings:{[f?"y":"x"]:{scale:t.scale,ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(r))}},[f?"x":"y"]:{scale:ea.SCALE.MAJOR,fn:mm({layoutService:n,seriesModel:o,rtl:v,orientation:m}),ref:"major"},sizeLimits:{minPx:Nm,maxPx:Im},size:e=>{const{value:t}=e.datum.line;return s.query.point.getSize(t)+"px"},fill:h,opacity:({datum:e,data:t})=>{var r;return null!==(r=e.null)&&void 0!==r&&r.value||M(e)?0:p?g({item:e,items:t.items})?1:0:d||g({item:e,items:t.items})?1:0}},brush:fm({layoutService:n,active:{r:e=>e.r+Am.POINT.SIZE.ACTIVE/2,strokeWidth:1.5,stroke:"#FFFFFF",opacity:e=>{var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||M(e.data))return 0;if(!x||d)return 1;const{event:r,components:n=[]}=(null==c?void 0:c.getSelectionInfo())||{};if("continuousRange"===r)return 0;if("tap"!==r)return 1;return[ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER].some((e=>n.indexOf(e)>=0))?0:1}},inactive:{opacity:e=>1===e.opacity?.5:0}})}}const wm=(e,{dataset:t})=>{var r;if(null!==(r=e.null)&&void 0!==r&&r.value)return"-";const{value:n,label:i,source:o}=e.end,a=t(o.key).field(o.field);return a.raw().isCustomFormatted?i:a.formatter()(n)};function Lm({chart:e,models:t,environment:r,series:n,lineSeries:i}){const{layoutService:o,dockService:a,themeService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,{id:c}=n,d="rtl"===r.options.direction,m=o.getLayoutValue("dataPoint");if(!m)return!1;if(!m.show||!m.showLineLabels)return!1;const f=(n.isPrimary?l:u).query.getExtrema(),p=s.getStyles();return{type:"point-label",key:`${ea.COMPONENT.POINT_LABEL}-${c}`,layout:{displayOrder:2,minimumLayoutMode:rm.VALUE_LABEL},settings:{orientation:a.meta.major.orientation,rtl:d,connect:n.options.showAsConnections,label:t=>wm(t,e),pointValue:e=>e.end.value,majorValue:e=>e.value,target:{labelSpace:ea.COMPONENT.LABEL_SPACE,point:`${ea.COMPONENT.POINT}-${c}`,allPoints:i.map((e=>`${ea.COMPONENT.POINT}-${e.id}`))},lineIndex:"typeIndex",showLabel:e=>!(({end:e})=>ym(e.value,f))(e.data)},style:{fontFamily:p.label.value.fontFamily,fontSize:p.label.value.fontSize,fill:p.label.value.color}}}const Rm=({chart:e,dock:t})=>{let r=t;const n=e.component(`${ea.COMPONENT.SLICED_HAT}-${pm}`),i=e.component(`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.PRIMARY}`),o=e.component(`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.SECONDARY}`);return n?r=`@${ea.COMPONENT.SLICED_HAT}-${pm}`:i?r=`@${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.PRIMARY}`:o&&(r=`@${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.SECONDARY}`),r},km=({dockPosition:e,orientation:t,rtl:r})=>{let n=1;return e!==`@${ea.COMPONENT.SLICED_HAT}-${pm}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.PRIMARY}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.SECONDARY}`||!("horizontal"===t||"vertical"===t&&r)||(n=4),e!==`@${ea.COMPONENT.SLICED_HAT}-${hm}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.PRIMARY}`&&e!==`@${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.SECONDARY}`||"vertical"!==t||r||(n=4),n};function Pm({chart:e,models:t,environment:r,lineSeries:n}){const{layoutService:i,dockService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=i.getLayoutValue("dataPoint",{}),u="rtl"===r.options.direction;if(!n.length)return!1;if(!l.show||!l.showLineLabels)return!1;const c="horizontal"===o.meta.major.orientation,{show:d}=i.getLayoutValue("dimensionAxis",{});if("none"!==d){const{dock:e}=o.meta.major;if(c&&"top"===e)return!1;if(!c&&e===(u?"left":"right"))return!1}const m=u?"left":"right";return{type:"label-space",key:ea.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:rm.LABEL_SPACE,dock:Rm({chart:e,dock:c?"top":m})},settings:{size:10},show:()=>{const t=e.component(`${ea.COMPONENT.LINE}-${n[0].id}`);if(!t||!t.rect)return!1;const r=(c?17:34)/t.rect[c?"height":"width"],i=a.query.getExtrema(),o=e.scale(ea.SCALE.MINOR.PRIMARY)(i.implicit.line.max),l=c||u?o:1-o,d=n.filter((e=>e.isPrimary)).length>0,m=s.query.getExtrema(),f=e.scale(ea.SCALE.MINOR.SECONDARY)(m.implicit.line.max),p=c||u?f:1-f,h=n.filter((e=>!e.isPrimary)).length>0;return d&&l<r||h&&p<r}}}const jm={min:"Min",max:"Max"};function Fm(e,t,r){const{hasExplicitMax:n}=r.meta,{max:i}=r.explicit;return!!n&&Math.max(e,t)>i&&i<=Math.min(e,t)}function Vm(e,t,r){const{hasExplicitMin:n}=r.meta,{min:i}=r.explicit;return!!n&&Math.min(e,t)<i&&i>=Math.max(e,t)}function _m(e,t,r){return Fm(e,t,r)||Vm(e,t,r)}function Bm(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n&&n<=0}function Hm(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n&&n>=0}function $m(e,t){return Bm(e,t)||Hm(e,t)}function zm({extrema:e,type:t}){return!(function({extrema:e,type:t}){return!e.meta["hasExplicit"+jm[t]]}({extrema:e,type:t})||function({extrema:e,type:t}){const r=t===pm?e.implicit.bar.max:e.implicit.bar.min,n=Number(r.toFixed(13));return t===pm?!Bm(n,e):!Hm(n,e)}({extrema:e,type:t}))}var Um=Object.freeze({__proto__:null,isSegmentMaxOutOfBounds:Fm,isSegmentMinOutOfBounds:Vm,isSegmentOutOfBounds:_m,isMaxOutOfBounds:Bm,isMinOutOfBounds:Hm,isOutOfBounds:$m,shouldShowOob:zm});const Ym={min:"Min",max:"Max"},Wm=({chart:e,models:t,markerSeries:r,lineSeries:n,barSeries:i,environment:o,type:a})=>{const{dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,primaryTickModel:c,secondaryTickModel:d,layoutService:m,seriesModel:f,themeService:p,fieldModel:h}=t,y="rtl"===o.options.direction,{dock:g,opposite:v,orientation:b}=s.meta.major,x=l.query.getExtrema(),M=u.query.getExtrema(),S=a===pm,{isBarSeriesGrouped:E}=m.meta,C=(({chart:e,type:t,opposite:r,dock:n})=>{let i=t===pm?r:n;const o=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}`),a=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),s=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`),l=e.component(ea.COMPONENT.LABEL_SPACE),u=e.component(`${ea.COMPONENT.BAR_OOB}-${t}`),c=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`),d=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`);return o?i=`@${ea.COMPONENT.SLICED_HAT}-${t}`:a?i=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`:s?i=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`:u||c||d?l&&t===pm?i="@"+ea.COMPONENT.LABEL_SPACE:u?i=`@${ea.COMPONENT.BAR_OOB}-${t}`:c?i=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`:d&&(i=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`):l&&t===pm&&(i="@"+ea.COMPONENT.LABEL_SPACE),i})({chart:e,type:a,opposite:v,dock:g}),q=mm({layoutService:m,seriesModel:f,rtl:y,orientation:b}),O=n.concat(r);if(!O.length)return!1;const A=S?x.implicit.bar.max:x.implicit.bar.min,D=Number(A.toFixed(13));if(!E&&i.length&&Um[`is${Ym[a]}OutOfBounds`](D,x))return!1;if(!x.meta.hasExplicit&&!M.meta.hasExplicit)return!1;const N=S?"max":"min",I=Math[N](Number(x.implicit.line[N].toFixed(13)),Number(x.implicit.marker[N].toFixed(13))),T=Math[N](Number(M.implicit.line[N].toFixed(13)),Number(M.implicit.marker[N].toFixed(13))),w=O.filter((e=>e.isPrimary)),L=O.filter((e=>!e.isPrimary)),R=w.length>0,k=L.length>0,{major:P,majorNumeric:j}=h.main,F=e=>"NaN"!==e.qNum?e.qNum:0,V=m.meta.isContinuous?j:P;return{type:"data-out-of-bounds-marker",key:`${ea.COMPONENT.DATA_OOB_MARKER}-${a}`,layout:{dock:C,minimumLayoutMode:rm.OUT_OF_BOUNDS_MARKER},data:{extract:O.map((({ref:e,typeIndex:t,options:r})=>({field:P,value:m.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:V},end:{field:e,value:r.showAsZeros?F:void 0},typeIndex:t,null:{field:e,value:e=>"NaN"===e.qNum}}})))},settings:{type:a,primaryExtremum:S?()=>c.query.getMax():()=>c.query.getMin(),secondaryExtremum:S?()=>d.query.getMax():()=>d.query.getMin(),primarySeries:w,secondarySeries:L,orientation:b,rtl:y,major:{scale:ea.SCALE.MAJOR,fn:q},markerOffset:km({dockPosition:C,orientation:b,rtl:y})},brush:fm({layoutService:m}),show:()=>{if(S){if(R&&I>c.query.getMax())return!0;if(k&&T>d.query.getMax())return!0}if(!S){if(R&&I<c.query.getMin())return!0;if(k&&T<d.query.getMin())return!0}return!1},style:{fill:p.getStyles().outOfRange.color}}},Gm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Km({chart:e,models:t,viewState:r,viewCache:n,axis:i}){const o=Dl(),{dockService:a}=t;return({data:t})=>(({items:t})=>{const{rect:r}=e.component(`${ea.COMPONENT.BAR}-${i}`)||{};return(!t.length||!r)&&2})(t)||(()=>{const{min:e,max:t}=r.get("zoom");return o.get([e,t])||o.empty()&&!1})()||(()=>{const e=Gm[a.meta.chart.mode];return 0===Math.abs(n.get("continuousMax")-n.get("continuousMin"))&&e})()||(()=>{const{min:e,max:t}=r.get("zoom"),i=Math.abs(n.get("continuousMax")-n.get("continuousMin")),s=Math.abs(t-e),l=Gm[a.meta.chart.mode],u=function(e,t,r){return e*(1-r)+t*r}(2,l,1-Math.min(s/i/.2,1));return o.set([e,t],Math.max(2,Math.min(l,u)))})()}const Xm=({isContinuous:e,isBarSeriesGrouped:t,styleModel:r,discreteModel:n,isBarSeriesStackedInBothAxis:i})=>e?1:r.query.bar.getHasStyling()?r.query.bar.getHasStrokeWidth()?function(){const e=r.query.bar.getStrokeWidth()/n.query.getItemSize(),t=r.query.bar.getWidthFn()(),i=t+e;return i>1?t-(i-1):t}:r.query.bar.getWidthFn():t||i?.9:.7;function Jm(e){return Math.min(Math.max(0,e),1)}const Zm=({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c,primaryExtremumModel:d,secondaryExtremumModel:m}=t,{isContinuous:f,isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:y}=o.meta,g=e=>e.datum.start?e.datum.start.value:e.scale.min(),v=i?ra.PRIMARY:ra.SECONDARY,b=i?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY;if(!(i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount))return!1;const x=p?{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return Jm(e.scale(t))}},end:{ref:"end",fn:e=>{const t=(e=>e.datum.end?e.datum.end.value:g(e))(e);return Jm(e.scale(t))}}}:{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return Jm(e.scale(t))}},end:{ref:"end",fn:e=>{var t;const r=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?g(e):e.datum.end.value;return Jm(e.scale(r))}}},M=(i?d:m).query.getExtrema(),S=p?({start:e,end:t})=>_m(e.value,t.value,M):({end:e})=>$m(e.value,M);return{type:"box",key:`${ea.COMPONENT.BAR}-${v}`,data:{filter:(()=>{if(p)return;const e=l.query.series(ta.BAR).filter((e=>e.isPrimary===i)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:p?i?ea.COLLECTION.STACKED_PRIMARY:ea.COLLECTION.STACKED_SECONDARY:i?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY},preferredSize:f?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,settings:{orientation:a.meta.minor.orientation,major:{scale:ea.SCALE.MAJOR,fn:dm({layoutService:o,axis:v}),ref:f?{start:"major",end:"major"}:void 0},minor:x,box:{width:Xm({isContinuous:f,isBarSeriesGrouped:h,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:y}),minWidthPx:f?Km({chart:e,models:t,viewState:r,viewCache:n,axis:v}):void 0,fill:s.getColor(),strokeWidth:u.query.bar.getStrokeWidth(),stroke:u.query.bar.getStrokeColor(),minHeightPx:.3,opacity:e=>{var t,r;return!0===(null===(t=e.datum)||void 0===t||null===(r=t.null)||void 0===r?void 0:r.value)||S(e.datum)?0:1}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:fm({layoutService:o,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:om}}})}},Qm=({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c}=t,{isBarSeriesStacked:d,isContinuous:m,isBarSeriesGrouped:f,isBarSeriesStackedInBothAxis:p}=o.meta,h=i?ra.PRIMARY:ra.SECONDARY,y=i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount;if(!d||0===y)return!1;return{key:`${ea.COMPONENT.STACK_BAR}-${h}`,type:"box",data:{collection:i?ea.COLLECTION.STACKED_TOTAL_PRIMARY:ea.COLLECTION.STACKED_TOTAL_SECONDARY},settings:{major:{scale:ea.SCALE.MAJOR,fn:dm({layoutService:o,axis:h}),ref:m?{start:"timeStart",end:"timeEnd"}:void 0},minor:{scale:i?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:a.meta.minor.orientation,box:{width:Xm({isContinuous:m,isBarSeriesGrouped:f,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:p}),minWidthPx:m?Km({chart:e,models:t,viewState:r,viewCache:n,axis:h}):2,opacity:0,fill:s.getColor()},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function ef({style:e,simplifiedPlacement:t}){return r=>lt.isDark(t.background?t.background.fill:r.node.attrs.fill)?e.lightColor:e.darkColor}function tf(e,t){const r="horizontal"===e.dockService.meta.major.orientation;return{placements:t.simplifiedPlacements.map((e=>function({simplifiedPlacement:e,style:t,isHorizontal:r}){const n=e.padding||{left:r?0:4,right:r?0:4,top:r?4:0,bottom:r?4:0};return{position:e.position,justify:e.justify,fill:e.onBackground?t.color:ef({style:t,simplifiedPlacement:e}),overflow:e.overflow,background:e.background,padding:n}}({simplifiedPlacement:e,style:t.style,isHorizontal:r}))),label:t.label}}function rf(e,t,r,n){const i=function(e,t){return function(e,t){if(t&&0===e){const{min:e,max:r}=t;return 0===r&&0===e?1:r<=0?-1:e>=0||r>=-e?1:-1}return e>=0?1:-1}(e,t)}(e,n);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!r||i<0&&r?"right":"left"),o}const nf=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:r,isContinuous:n}=t;return!r||!n},of=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:r,isContinuous:n}=t;return!!r&&(!!n||!1!==e)};function af(e,t,r,n){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:n}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:r}),i}const sf=({models:e,environment:t,isPrimary:r})=>{const{layoutService:n,seriesModel:i}=e,{meta:o}=n,a="rtl"===t.options.direction,s=e.themeService.getStyles(),l=e.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),u=r?ra.PRIMARY:ra.SECONDARY;if(!(r?i.meta.primaryBarSeriesCount:i.meta.secondaryBarSeriesCount)||!nf(l,o))return!1;let c;!o.isBarSeriesStacked&&(c=o.isBarSeriesStacked?1:0);const d={label:e=>wm(e.data,e),simplifiedPlacements:af(c,0===c?1:0,o.isBarSeriesStacked?.5:1,o.isContinuous),style:s.label.value},m=[tf(e,d)],f=[{component:`${ea.COMPONENT.BAR}-${u}`,selector:"rect",strategy:{type:"bar",settings:{direction:t=>rf(t.data.end.value,e.dockService.meta.minor.orientation,a,0),labels:m,fontSize:s.label.value.numFontSize,fontFamily:s.label.value.fontFamily}}}];return{type:"labels",key:`${ea.COMPONENT.BAR_LABEL}-${u}`,layout:{minimumLayoutMode:rm.VALUE_LABEL},settings:{sources:f}}};function lf(e,t,r){const n=[{position:e,onBackground:!0,justify:0,overflow:r}];return t&&n.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:{fill:"#cce6e6e6",padding:{left:2,right:2,top:2,bottom:2}}}),n}function uf({chart:e,models:t,environment:r,isPrimary:n}){const{meta:i}=t.layoutService,o="rtl"===r.options.direction,a=t.themeService.getStyles(),s=t.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),l=n?ra.PRIMARY:ra.SECONDARY;if(0===(n?t.seriesModel.meta.primaryBarSeriesCount:t.seriesModel.meta.secondaryBarSeriesCount)||!of(s,i))return!1;const u=e.formatter(n?ea.FORMATTER.PRIMARY:ea.FORMATTER.SECONDARY)||(e=>e),c=e=>0===e?"":u(e),d={label:e=>c(e.data.sumOfPositives.value),simplifiedPlacements:lf("outside",true,i.isContinuous),style:a.label.value},m={label:e=>c(e.data.sumOfNegatives.value),simplifiedPlacements:lf("opposite",true,i.isContinuous),style:a.label.value},f=[tf(t,d),tf(t,m)];return{type:"labels",key:`${ea.COMPONENT.STACK_BAR_LABEL}-${l}`,layout:{displayOrder:2,minimumLayoutMode:rm.VALUE_LABEL},settings:{sources:[{component:`${ea.COMPONENT.STACK_BAR}-${l}`,selector:"rect",strategy:{type:"bar",settings:{direction:e=>rf(e.data.sumOfPositives.value,t.dockService.meta.minor.orientation,o),labels:f,fontSize:a.label.value.numFontSize,fontFamily:a.label.value.fontFamily}}}]}}}var cf=Object.freeze({__proto__:null,hasMaxHat:function(e,t){const{hasExplicitMax:r}=t.meta,{max:n}=t.explicit;return!!r&&e>n&&n>0},hasMinHat:function(e,t){const{hasExplicitMin:r}=t.meta,{min:n}=t.explicit;return!!r&&e<n&&n<0}});const df={min:"Min",max:"Max"};function mf({chart:e,models:t,type:r,viewCache:n,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,styleModel:c,discreteModel:d}=t,{isBarSeriesStacked:m,isContinuous:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h}=a.meta,y=m?Qm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}):Zm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}),g=o?l.query.getExtrema():u.query.getExtrema(),v=r===pm,b=o?ra.PRIMARY:ra.SECONDARY;if(!y)return!1;if(function(e,t){return!e.meta["hasExplicit"+df[t]]}(g,r)||function(e,t,r){const n=r?e.implicit.bar.max:e.implicit.bar.min,i=Number(n.toFixed(13));return!cf[`has${df[t]}Hat`](i,e)}(g,r,v)||function(e,t,r){const n=r?e=>e<0:e=>e>0;return e.meta["hasExplicit"+df[t]]&&n(e.explicit[t])}(g,r,v))return!1;let x="end";m&&(x=v?"sumOfPositives":"sumOfNegatives");const M=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.scale(o?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY)[r]()));const S=(({chart:e,type:t,isPrimary:r,dock:n})=>{let i=n;const o=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),a=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`);return o&&a&&(i=r?n:`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),i})({chart:e,type:r,isPrimary:o,dock:v?s.meta.minor.end:s.meta.minor.start});return{type:"box-sliced-hat",key:`${ea.COMPONENT.SLICED_HAT}-${r}-${b}`,layout:{dock:S},data:y.data,settings:{orientation:y.settings.orientation,major:y.settings.major,minor:y.settings.minor,hat:U({},y.settings.box,{fill:m?"#999":y.settings.box.fill,alignment:1,opacity:1,show:function(e){const t=M(),r=function(e){if("number"!=typeof e)return e;const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e}(e.datum[x].value);return v?r>t:r<t},width:Xm({isContinuous:f,isBarSeriesGrouped:p,styleModel:c,discreteModel:d,isBarSeriesStackedInBothAxis:h}),strokeWidth:c.query.bar.getStrokeWidth(),stroke:c.query.bar.getStrokeColor()})},brush:fm({layoutService:a})}}const ff={min:"Min",max:"Max"},pf={sumOfPositives:"sumOfNegatives",sumOfNegatives:"sumOfPositives"};function hf({chart:e,models:t,type:r,viewCache:n,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,themeService:c}=t,{end:d,start:m}=s.meta.minor,{isBarSeriesStacked:f}=a.meta,p=f?Qm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}):Zm({chart:e,models:t,viewCache:n,viewState:i,isPrimary:o}),h=o?l.query.getExtrema():u.query.getExtrema(),y=r===pm?h.implicit.bar.max:h.implicit.bar.min,g=Number(y.toFixed(13)),v=o?ra.PRIMARY:ra.SECONDARY;if(!p)return!1;if(!Um[`is${ff[r]}OutOfBounds`](g,h))return!1;const b=(({chart:e,type:t,end:r,start:n,isPrimary:i})=>{let o=t===pm?r:n;const a=e.component(ea.COMPONENT.LABEL_SPACE),s=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`),l=e.component(`${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`),u=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`),c=e.component(`${ea.COMPONENT.BAR_OOB}-${t}-${ra.SECONDARY}`);return s?o=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.PRIMARY}`:l?o=`@${ea.COMPONENT.SLICED_HAT}-${t}-${ra.SECONDARY}`:u&&c&&!i?o=`@${ea.COMPONENT.BAR_OOB}-${t}-${ra.PRIMARY}`:a&&t===pm&&(o="@"+ea.COMPONENT.LABEL_SPACE),o})({chart:e,type:r,end:d,start:m,isPrimary:o});let x="end";f&&(x=r===pm?"sumOfPositives":"sumOfNegatives");return{type:"box-out-of-bounds",key:`${ea.COMPONENT.BAR_OOB}-${r}-${v}`,layout:{dock:b},data:p.data,settings:{orientation:p.settings.orientation,major:p.settings.major,minor:p.settings.minor,dockValue:le.getDockValue(r===pm?d:m),oob:U({},p.settings.box,{fill:c.getStyles().outOfRange.color,alignment:1,opacity:1,show:function(e){var t;if(!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value))return!1;const n=f&&0===e.datum[x].value,i=Um[`is${ff[r]}OutOfBounds`](e.datum[x].value,h,r);return(!n||function({type:e,item:t,prop:r,extrema:n}){const i=t.datum[pf[r]].value;return 0!==i&&Um[`is${ff[e]}OutOfBounds`](i,n,e)}({type:r,item:e,prop:x,extrema:h}))&&i}})},brush:fm({layoutService:a})}}function yf(e){return Math.min(Math.max(0,e),1)}const gf=({chart:e,models:t,type:r,isPrimary:n})=>{const{discreteModel:i,styleModel:o,seriesModel:a,layoutService:s}=t;if(!(n?a.meta.primaryBarSeriesCount:a.meta.secondaryBarSeriesCount))return!1;const{isBarSeriesStacked:l,isContinuous:u,isBarSeriesGrouped:c,isBarSeriesStackedInBothAxis:d}=s.meta,m=e.scale(n?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY),f=n?ra.PRIMARY:ra.SECONDARY,p=n?t.primaryExtremumModel.query.getExtrema():t.secondaryExtremumModel.query.getExtrema(),h=r===pm;if(!zm({extrema:p,type:r}))return!1;const y=e=>e.datum.start?e.datum.start.value:e.scale.min(),g=(e,t="end")=>e.datum[t]?e.datum[t].value:y(e);return{type:"box",key:`${ea.COMPONENT.GHOST_BAR_OOB}-${r}-${f}`,data:{filter:(()=>{if(l)return;const e=a.query.series(ta.BAR).filter((e=>e.isPrimary===n)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:l?n?ea.COLLECTION.STACKED_TOTAL_PRIMARY:ea.COLLECTION.STACKED_TOTAL_SECONDARY:n?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY},settings:{orientation:t.dockService.meta.minor.orientation,major:{scale:ea.SCALE.MAJOR,fn:dm({layoutService:s,axis:f}),ref:u?{start:"major",end:"major"}:void 0},minor:{scale:n?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,start:{ref:"start",fn:e=>{const t=y(e);return yf(e.scale(t))}},end:l?"max"===r?{ref:"sumOfPositives",fn:e=>{const t=g(e,"sumOfPositives");return yf(e.scale(t))}}:{ref:"sumOfNegatives",fn:e=>{const t=g(e,"sumOfNegatives");return yf(e.scale(t))}}:{ref:"end",fn:e=>{const t=g(e);return yf(e.scale(t))}}},box:{width:Xm({isContinuous:u,isBarSeriesGrouped:c,styleModel:o,discreteModel:i,isBarSeriesStackedInBothAxis:d}),stroke:"transparent",fill:"none",opacity:0,show:e=>{let t="end";l&&(t=h?"sumOfPositives":"sumOfNegatives");const r=e.datum[t]?e.datum[t].value:m.max();return h?r>m.max():r<m.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function vf(e,t,r,n,i){const o=[{position:e,justify:0,overflow:r,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&o.push({position:"inside",onBackground:!1,justify:n||i?0:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}const bf=({chart:e,models:t,type:r,environment:n,isPrimary:i})=>{const{layoutService:o,dockService:a,primaryExtremumModel:s,secondaryExtremumModel:l,themeService:u,seriesModel:c}=t,d=u.getStyles(),{meta:m}=o,{isBarSeriesStacked:f}=m,p=e.formatter(i?ea.FORMATTER.PRIMARY:ea.FORMATTER.SECONDARY),h=o.getLayoutValue("dataPoint.showBarLabels",!1),y="horizontal"===a.meta.major.orientation,g="rtl"===n.options.direction;if(!(i?c.meta.primaryBarSeriesCount:c.meta.secondaryBarSeriesCount)||!f&&!nf(h,m)||f&&!of(h,m))return!1;const v=i?s.query.getExtrema():l.query.getExtrema();if(!v.meta.hasExplicit)return!1;const b=r===pm?v.implicit.bar.max:v.implicit.bar.min;if(!(r===pm?Bm(b,v):Hm(b,v)))return!1;let x=e=>wm(e.data,e);m.isBarSeriesStacked&&(x=r===pm?function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(Bm(e.data.sumOfPositives.value,v)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value;return p?p(t):t}return""}:function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(Hm(e.data.sumOfNegatives.value,v)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value;return p?p(t):t}return""});const M={label:x,simplifiedPlacements:vf("outside",true,m.isContinuous,y,g),style:d.label.value},S={label:x,simplifiedPlacements:vf("opposite",true,m.isContinuous,y,g),style:d.label.value},E=[tf(t,M),tf(t,S)],C=i?ra.PRIMARY:ra.SECONDARY,q="horizontal"===a.meta.major.orientation?"down":"right",O=[{component:`${ea.COMPONENT.GHOST_BAR_OOB}-${r}-${C}`,selector:"rect",strategy:{type:"bar",settings:{direction:q,labels:E,fontSize:d.label.value.numFontSize,fontFamily:d.label.value.fontFamily}}}];return{key:`${ea.COMPONENT.BAR_OOB_LABEL}-${r}-${C}`,type:"labels",layout:{minimumLayoutMode:rm.VALUE_LABEL},settings:{sources:O}}},xf=({chart:e,models:t,viewState:r,viewCache:n})=>[Zm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),Zm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1})],Mf=({chart:e,models:t,viewState:r,viewCache:n})=>[Qm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),Qm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1})],Sf=({chart:e,models:t,environment:r})=>{const{isBarSeriesStacked:n}=t.layoutService.meta;if(n){return[uf({chart:e,models:t,environment:r,isPrimary:!0}),uf({chart:e,models:t,environment:r,isPrimary:!1})]}return[sf({models:t,environment:r,isPrimary:!0}),sf({models:t,environment:r,isPrimary:!1})]},Ef=({chart:e,models:t,viewCache:r,viewState:n})=>[mf({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!0}),mf({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!0}),mf({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!1}),mf({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!1})],Cf=({chart:e,models:t,viewCache:r,viewState:n})=>[hf({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!0}),hf({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!0}),hf({chart:e,models:t,type:"max",viewCache:r,viewState:n,isPrimary:!1}),hf({chart:e,models:t,type:"min",viewCache:r,viewState:n,isPrimary:!1})],qf=({chart:e,models:t})=>[gf({chart:e,models:t,type:"max",isPrimary:!0}),gf({chart:e,models:t,type:"min",isPrimary:!0}),gf({chart:e,models:t,type:"max",isPrimary:!1}),gf({chart:e,models:t,type:"min",isPrimary:!1})],Of=({chart:e,models:t,environment:r})=>[bf({chart:e,models:t,type:"max",environment:r,isPrimary:!0}),bf({chart:e,models:t,type:"min",environment:r,isPrimary:!0}),bf({chart:e,models:t,type:"max",environment:r,isPrimary:!1}),bf({chart:e,models:t,type:"min",environment:r,isPrimary:!1})],Af=({chart:e,environment:t,models:r,viewState:n,viewCache:i})=>{const{seriesModel:o}=r,a=o.query.series(ta.BAR).slice(-1),s=o.query.series(ta.LINE),l=o.query.series(ta.MARKER);return[...xf({chart:e,models:r,viewState:n,viewCache:i}),...Mf({chart:e,models:r,viewState:n,viewCache:i}),...s.map((e=>Om({models:r,environment:t,series:e}))),...s.map((e=>Tm({models:r,series:e,environment:t}))),...l.map((n=>Em({chart:e,models:r,series:n,environment:t}))),...s.map((n=>Lm({chart:e,models:r,environment:t,series:n,lineSeries:s}))),...Sf({chart:e,models:r,environment:t}),...Ef({chart:e,models:r,viewCache:i,viewState:n}),...Cf({chart:e,models:r,viewCache:i,viewState:n}),...qf({chart:e,models:r}),...Of({chart:e,models:r,environment:t}),Wm({chart:e,models:r,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"max"}),Wm({chart:e,models:r,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"min"}),Pm({chart:e,models:r,environment:t,lineSeries:s})]},Df=0,Nf=1,If=3;function Tf({models:e}){const{dockService:t,seriesModel:r,layoutService:n,themeService:i}=e,{auto:o,spacing:a}=n.getLayoutValue("gridLine",{});if(!o&&a===Df)return!1;const s=i.getStyles(),l=r.meta.primarySeries.length>0;return{key:ea.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:rm.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!o&&a===Nf)||((e,t)=>t%2==0),stroke:s.grid.line.major.color},minorTicks:{show:!o&&a===If,stroke:s.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:l?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY}}function wf({models:e}){const{primaryExtremumModel:t,primaryTickModel:r,themeService:n,dockService:i,seriesModel:o}=e,a=t.query.getExtrema();return!!(o.meta.primarySeries.length>0&&a.meta.includesZero)&&{key:ea.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:rm.GRID_LINE},show:()=>r.query.getMin()<=0&&r.query.getMax()>=0,lines:{["horizontal"===i.meta.minor.orientation?"x":"y"]:[{value:0,scale:ea.SCALE.MINOR.PRIMARY,line:{stroke:n.getStyles().grid.line.highContrast.color}}]}}}function Lf({models:e}){const{layoutService:t,themeService:r}=e,{isContinuous:n,isTime:i}=t.meta;if(!n)return[];const o=r.getStyles(),a={type:"grid-line",layout:{minimumLayoutMode:rm.GRID_LINE},ticks:{stroke:o.grid.line.major.color},minorTicks:{show:!1,stroke:o.grid.line.minor.color}};return i?[U(!0,{},a,{key:"time-inner-grid",x:{scale:ea.SCALE.MAJOR_INNER},ticks:{stroke:o.grid.line.minor.color}}),U(!0,{},a,{key:"time-outer-grid",x:{scale:ea.SCALE.MAJOR}})]:[U(!0,{},a,{key:"continuous-grid",x:{scale:ea.SCALE.MAJOR},minorTicks:{show:!0}})]}function Rf({models:e}){return[Tf({models:e}),wf({models:e}),...Lf({models:e})]}function kf({models:e,environment:t,actions:r}){const{layoutService:n,dockService:i,propertiesModel:o,appModel:a,genericObjectModel:s,themeService:l}=e,u=o.query.getProperties(),c=n.getLayoutValue("dimensionAxis");if(!c)return!1;const{show:d}=c;if("all"!==d&&"title"!==d)return!1;const{orientation:m}=i.meta.major,f=l.getStyles();return{type:"data-title",key:ea.COMPONENT.AXIS_TITLE.MAJOR,layout:{dock:i.meta.major.dock,minimumLayoutMode:rm.AXIS_TITLE.MAJOR[m.toUpperCase()]},settings:{hyperCube:n.getHyperCube(),hyperCubeDef:u&&u.qHyperCubeDef,isDimension:!0,disabled:()=>!r.interact.enabled(),model:s,app:a,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0},style:{fontFamily:f.axis.title.fontFamily,fontSize:f.axis.title.fontSize,color:f.axis.title.color}}}const Pf=(e,t,r)=>e.query.seriesByAxis(r).map((e=>({...t[e.refIndex],explicitColumn:e.refIndex})));function jf({models:e,environment:t,actions:r}){const{layoutService:n,dockService:i,seriesModel:o,propertiesModel:a,appModel:s,genericObjectModel:l,themeService:u}=e,c=a.query.getProperties(),d=n.getLayoutValue("measureAxes");if(!d||!d.length)return!1;const m=u.getStyles(),{measureAxes:f}=o.meta;return f.filter((e=>e.isPrimary?"all"===d[0].show||"title"===d[0].show:"all"===d[1].show||"title"===d[1].show)).map((e=>{const a=n.getHyperCube(),{isPrimary:u}=e,d=o.query.seriesByAxis(u).length>1,f={type:"data-title",key:u?ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY:ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,layout:{dock:u?i.meta.minor.dock:i.meta.minorSecondary.dock,minimumLayoutMode:rm.AXIS_TITLE.MINOR},settings:{hyperCube:a,hyperCubeDef:c&&c.qHyperCubeDef,isDimension:!1,explicitItemInfos:Pf(o,a.qMeasureInfo,u),onChangeToAlternative:({oldItem:e,newItem:t})=>{t.qDef.series=e.qDef.series;const r=e.qAttributeExpressions.findIndex((e=>"colorByExpression"===e.id));if(-1!==r){const n=e.qAttributeExpressions.splice(r,1)[0];t.qAttributeExpressions.unshift(n)}},disabled:()=>!r.interact.enabled(),model:l,app:s,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0,skipAttributeExpressions:!0},style:{fontFamily:m.axis.title.fontFamily,fontSize:m.axis.title.fontSize,color:m.axis.title.color}};return d&&(f.settings.padding="0",f.settings.minWidth="auto"),f}))}function Ff({models:e,environment:t,actions:r}){return[kf({models:e,environment:t,actions:r}),...jf({models:e,environment:t,actions:r})]}function Vf({models:e,environment:t,viewState:r,viewCache:n}){const{discreteModel:i,layoutService:o,dockService:a,continuousModel:s,themeService:l}=e,{isSnapshot:u,isDiscrete:c,isContinuous:d}=o.meta,m="rtl"===t.options.direction;return!(u&&!d)&&function({layoutService:e,dockService:t,discrete:r,continuousDataModel:n,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=dd({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,f={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?n.getDimensionCardinality()>1:r.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>ud({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(f.settings.style="slim",f.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(f.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(f.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&&(f.settings.injections=()=>[ld({layoutService:e,discrete:r})]),f}({viewState:r,viewCache:n,discrete:i,continuousDataModel:s,layoutService:o,dockService:a,themeService:l,rtl:m,scrollbarOverride:{predicate:()=>c,value:sd.OPTIONS.BAR.value},deviceType:t.deviceType})}function _f({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i}){const{layoutService:o}=t,a=Zm({chart:e,models:t,viewState:r,viewCache:n,isPrimary:i});if(!a)return!1;const s=i?ra.PRIMARY:ra.SECONDARY;return a.key=`${ea.COMPONENT.MINI_CHART.BAR}-${s}`,a.data.collection=o.meta.isBarSeriesStacked?i?ea.COLLECTION.REDUCED_STACKED_PRIMARY:ea.COLLECTION.REDUCED_STACKED_SECONDARY:i?ea.COLLECTION.REDUCED_PRIMARY:ea.COLLECTION.REDUCED_SECONDARY,a.settings.box.minWidthPx=void 0,a.settings.minor.scale=i?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,a.settings.major.scale=ea.SCALE.REDUCED,a.layout={dock:"@scrollbar"},a}function Bf({environment:e,models:t}){const r=t.styleModel.query.line.getStrokeDasharrayFn();return t.seriesModel.query.series(ta.LINE).map((n=>{const i=Om({models:t,environment:e,series:n});return i.key=gm(ea.COMPONENT.MINI_CHART.LINE,n),i.data.collection=ea.COLLECTION.REDUCED,i.settings.coordinates.minor.scale=n.isPrimary?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,i.settings.coordinates.major.scale=ea.SCALE.REDUCED,i.settings.layers.line.strokeWidth=1,i.settings.layers.line.strokeDasharray=(...e)=>void 0===r(...e)?void 0:"1, 1",i.layout={dock:"@scrollbar"},i}))}function Hf({models:e,environment:t}){return e.seriesModel.query.series(ta.MARKER).map((r=>{const n=Em({models:e,environment:t,series:r});return n.key=gm(ea.COMPONENT.MINI_CHART.MARKER,r),n.data.collection=ea.COLLECTION.REDUCED,n.settings.y.scale=r.isPrimary?ea.SCALE.MINOR.REDUCED_PRIMARY:ea.SCALE.MINOR.REDUCED_SECONDARY,n.settings.x.scale=ea.SCALE.REDUCED,n.layout={dock:"@scrollbar"},n}))}function $f({chart:e,models:t,viewState:r,viewCache:n,environment:i}){return Hd(t)?[_f({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!0}),_f({chart:e,models:t,viewState:r,viewCache:n,isPrimary:!1}),...Bf({environment:i,models:t}),...Hf({models:t,environment:i})]:[]}function zf({models:e,environment:t}){const{type:r}=e.colorService.getSettings();if("categorical"!==r)return!1;const n=de({key:ea.COMPONENT.LEGEND_TOOLTIP,rtl:"rtl"===t.options.direction}),i=e.themeService.getStyles();return U(!0,n,{settings:{filter:e=>function({nodes:e}){return e.filter((e=>e.data&&e.key===ea.COMPONENT.LEGEND_CATEGORICAL))}({nodes:e}),extract:e=>function({context:e}){return[[{content:e.node.data.label,style:{"font-weight":"bold","text-align":"left"},colspan:2}]]}({context:e}),placement:"pointer"},scale:ea.SCALE.COLOR,style:{content:{fontFamily:i.fontFamily}}})}function Uf({colorSettings:e,nodes:t}){let r=t.filter((e=>e.data[ea.SCALE.COLOR]&&(e=>e.data[ea.SCALE.COLOR].value===e.data.end.value)(e)))[0];return r||(null!=e&&e.field&&([r]=t.filter((t=>{var r,n;return(null===(r=t.data[ea.SCALE.COLOR])||void 0===r||null===(n=r.source)||void 0===n?void 0:n.field)===e.field}))),r||t[0])}const Yf=({models:e,rtl:t})=>{const{detectTextDirection:r}=he,n=e.colorService.getSettings();return function({context:e,nodes:i}){const o=Uf({colorSettings:n,nodes:i}),a=function({colorSettings:e,context:t,node:r}){const{color:n}=r.data;if("color"===e.type||!n||!e.fieldType)return;const{value:i,label:o}=n,{key:a,field:s}=n.source,{dataset:l}=t.resources,u=l(a).field(s).formatter();if(u&&"measure"===e.fieldType)return Number.isNaN(i)?"-":u(n.value);const c=o||i;return Number.isNaN(c)||"NaN"===c?"-":c}({colorSettings:n,context:e,node:o});if(void 0===a)return!1;const s=function({colorSettings:e,context:t,node:r}){if(e.label)return e.label;const{color:n}=r.data;if("color"!==e.type&&n){const{dataset:e}=t.resources,{key:r,field:i}=n.source;return e(r).field(i).title()}}({colorSettings:n,context:e,node:o}),l=function({node:e}){const{data:t,attrs:r}=e;return t.fillColor?t.fillColor:r&&r.fill?r.fill:void 0}({node:o}),u=e.h("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{label:t?[":",s]:[s,":"],value:t?[a,u]:[u,a],labelDirection:r(s),valueDirection:r(a)}}};function Wf({chart:e,models:t,rtl:r,translator:n}){const{detectTextDirection:i}=he,{tooltipModel:o,layoutService:a}=t,s=Yf({models:t,rtl:r}),l=function({rtl:e}){const{detectTextDirection:t}=he;return function({node:r,dataset:n}){var i,o;const{segment:a,end:s}=r.data,{value:l,label:u,source:c}=a||s,{key:d,field:m}=c,f=n(d).field(m),p=f.title();let h;return h=f.raw().isCustomFormatted?u:""===l||Number.isNaN(l)||!0===(null===(i=r.data)||void 0===i||null===(o=i.null)||void 0===o?void 0:o.value)?"-":f.formatter()(l),{label:e?[":",p]:[p,":"],value:h,labelDirection:t(p),valueDirection:t(l)}}}({rtl:r});return function({context:t}){const u=t.node.childrenNodes,{data:c}=u[0],{dataset:d}=t.resources,m=c.label,f=s({context:t,nodes:u}),p={dataId:c.value,title:{label:m,direction:i(m)},color:f},h=u.map((t=>l({chart:e,node:t,dataset:d}))).filter(((e,t,r)=>t===r.findIndex((t=>t.label[0]===e.label[0]&&t.value===e.value))));if(p.measures=f?h.filter((e=>e.label[0]!==f.label[0]||e.value!==f.value[1])):h,o.query.useCustomTooltip()){var y,g;const e=a.getLayout();e.tooltip.hideBasic&&(p.measures=[],p.color=void 0);const{customTooltipInfoAttrExpsArr:s,customTooltipAttrExpsArr:l}=xa({nodes:[u[0]],layout:e,dataset:d});if([p.customTitle]=s.filter((e=>e.id===ia.CUSTOM.TITLE)).map((e=>{const t=e;return t.direction=i(p.customTitle),t})),[p.customDescription]=s.filter((e=>e.id===ia.CUSTOM.DESCRIPTION)).map((e=>{const t=e;return t.direction=i(p.customDescription),t})),p.customMeasures=l.map((e=>{const t=e;return t.label=r?[":",t.label]:[t.label,":"],t.value=""===t.value||"NaN"===t.value?"-":t.value,t.valueDirection=i(e.value),t.labelDirection=i(e.label),e})),null!==(y=(g=o.query).useTooltipChart)&&void 0!==y&&y.call(g))if(o.query.hasChartLimitation()){ma.destroyVisualization({customTooltipModel:o.query.getCustomTooltipModel()});const e=n.get("properties.tooltip.notselectedmessage");p.customLimitation=e}else{const r=ma.createContainer({ctx:t,layout:e});p.customChart=r}let c=[];u.forEach((e=>{var t,r;(null===(t=e.data)||void 0===t||null===(r=t.customTooltipImages)||void 0===r?void 0:r.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(c=e.data.customTooltipImages)})),c.length>0&&(p.customImages=c)}return p}}function Gf(e){return(null==e?void 0:e.type)||ta.BAR}const Kf={circle:"circle",square:"rect",diamond:"path",triangle:"path",bar:"rect"},Xf=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`];const Jf=({chart:e,seriesModel:t,value:r})=>{const n=function({value:e,chart:t,seriesModel:r}){const n=r.meta.allSeries,i=[];return n.forEach((r=>{const n=Gf(r);n===ta.BAR?i.push(...t.findShapes("rect").filter((t=>-1!==Xf.indexOf(t.key)&&t.data.typeIndex.value===r.typeIndex&&t.data.major.value===e))):n===ta.LINE?i.push(...t.findShapes("circle").filter((t=>t.key===`${ea.COMPONENT.POINT}-${r.id}`&&t.data.major.value===e))):i.push(...t.findShapes(Kf[r.options.marker]).filter((t=>t.key===`${ea.COMPONENT.MARKER}-${r.id}`&&t.data.major.value===e)))})),i}({chart:e,seriesModel:t,value:r});if(0===n.lenght)return null;return{bounds:Qo.combineBounds(n.map((e=>e.bounds))),data:n.map((e=>e.data)),childrenNodes:n,key:n[0].key}},Zf=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${pm}`,`${ea.COMPONENT.BAR_OOB}-${hm}`,`${ea.COMPONENT.BAR_OOB}-${pm}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${hm}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${pm}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${hm}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${pm}`,`${ea.COMPONENT.SLICED_HAT}-${hm}`,`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.SECONDARY}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${pm}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${hm}`,ea.COMPONENT.AXIS.MAJOR],Qf=({chart:e,models:t,nodes:r})=>{const{seriesModel:n}=t,{pointComponentKeys:i,markerComponentKeys:o}=n.meta,a=[...i,...o],s=[...Zf,...a];return r.length?(({chart:e,nodes:t,seriesModel:r})=>{const n=[],i=[];for(let o=0;o<t.length;++o){const{value:a}=t[o].data||{};if(void 0!==a&&-1===i.indexOf(a)){i.push(a);const t=Jf({chart:e,seriesModel:r,value:a});t&&n.push(t)}}return n})({chart:e,nodes:r.filter((e=>(({node:e})=>s.map((t=>-1!==e.key.indexOf(t))).some((e=>!0===e)))({node:e}))),seriesModel:n}):[]};function ep({chart:e,models:t,environment:r}){const n=t.seriesModel.query.all(),i="rtl"===r.options.direction,{translator:o}=r,{appModel:a,tooltipModel:s,propertiesModel:l}=t,u=null==s?void 0:s.query.getCustomTooltipModel(),c=null==l?void 0:l.query.getProperties(),d=de({key:ea.COMPONENT.TOOLTIP,rtl:i}),m=function({chart:e,models:t,rtl:r,translator:n}){const i=Wf({chart:e,models:t,rtl:r,translator:n});return function({context:e}){const t=i({context:e}),{dataId:n,title:o,color:a,measures:s,customTitle:l,customDescription:u,customMeasures:c,customImages:d,customChart:m,customLimitation:f}=t,p={dataId:n,title:[{content:o.label,style:{"font-weight":"bold","text-align":r?"right":"left",direction:o.direction},colspan:2}],color:void 0,measures:[]};return a&&(p.color=[{content:a.label,style:{"text-align":r?"right":"left",direction:a.labelDirection}},{content:a.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:a.valueDirection}}]),p.measures=s.map((e=>[{content:e.label,style:{"text-align":r?"right":"left",direction:e.labelDirection}},{content:e.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:e.valueDirection}}])),(l||u)&&0===c.length&&0===s.length&&(p.title=[]),l&&(p.customTitle=[{content:l.title,style:{"font-weight":"bold","text-align":r?"right":"left",direction:l.direction},colspan:2}]),u&&(p.customDescription=[{content:u.value,style:{"text-align":r?"right":"left",direction:u.direction},colspan:2}]),c&&(p.customMeasures=c.map((e=>[{content:e.label,style:{"text-align":r?"right":"left",direction:e.labelDirection}},{content:e.value,style:{"text-align":r?"left":"right","vertical-align":"middle",direction:e.valueDirection}}]))),m&&(p.customChart=m),f&&(p.customLimitation=ya.getFooterRow(f,e)),d&&(p.customImages=d.map((t=>ya.getImageRow(t,e)))),p}}({chart:e,models:t,rtl:i,translator:o,series:n});let f=[];return U(!0,d,{settings:{filter:r=>Qf({chart:e,models:t,nodes:r}),extract:e=>{var r,n,i;if(e&&(f=null!==(r=e.node)&&void 0!==r&&r.childrenNodes?[...e.node.childrenNodes]:[e.node],null!==(n=t.layoutService)&&void 0!==n&&null!==(i=n.meta)&&void 0!==i&&i.isContinuous)){const e=[];for(let t=0;t<f.length;t++){var o,a;null!==(o=f[t].data)&&void 0!==o&&null!==(a=o.selectionDimension)&&void 0!==a&&a.value&&(e[t]={data:{value:f[t].data.selectionDimension.value}})}f=e}return m({context:e})},content:({h:e,data:t,style:r})=>{const n=t,{visible:a,hidden:s}=function({sections:e}){const t={visible:[],hidden:[]};return e.reduce(((e,r)=>((e<7?t.visible:t.hidden).push(r),((e,t)=>{const r=void 0===t.color?0:1,{length:n}=t.measures;return e+1+r+n+(t.customLimitation||t.customChart||t.customImages&&t.customImages.length>0?7:0)})(e,r))),0),t}({sections:n}),l=a.reduce(((e,t)=>{const{title:r,color:n,measures:i,customTitle:o,customDescription:a,customMeasures:s,customImages:l,customChart:u,customLimitation:c}=t;return o&&e.push(o),a&&e.push(a),e.push(r),n&&e.push(n),e.push(...i),s&&e.push(...s),u&&e.push(u),c&&e.push(c),l&&e.push(...l),e}),[]);return s.length&&l.push(function({count:e,translator:t,rtl:r}){const{detectTextDirection:n}=he,i=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:i,style:{"font-weight":"bold","text-align":r?"right":"left",direction:n(i)},colspan:2}]}({count:s.length,rtl:i,translator:o})),l.map((t=>e("tr",{},function(e,{h:t,style:r}){return e.map((e=>{const n={style:{...r.cell||{},...e.style||{}},class:e.class};return e.colspan&&(n.colspan=e.colspan),t("td",n,e.content)}))}(t,{h:e,style:r}))))},placement:"bounds",afterShow:()=>{s.query.useTooltipChart()&&s.query.useCustomTooltip()&&!s.query.hasChartLimitation()&&ma.show({app:a,properties:c,selectedNodes:f,customTooltipModel:u,rtl:i})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function tp({chart:e,models:t,environment:r}){return[zf({models:t,environment:r}),ep({chart:e,models:t,environment:r})]}function rp({models:e}){const{layoutService:t,dockService:r}=e,{isContinuous:n,isTime:i}=t.meta,o=t.getLayoutValue("dimensionAxis");if(!o||"none"===o.show||"title"===o.show)return[!1];if(!n)return[!1];const a=rm.AXIS.MAJOR[r.meta.major.orientation.toUpperCase()];return i?[{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,scale:ea.SCALE.MAJOR_INNER,layout:{dock:"@"+ea.COMPONENT.AXIS.TIME_INNER,minimumLayoutMode:a}},{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,scale:ea.SCALE.MAJOR,layout:{dock:"@"+ea.COMPONENT.AXIS.TIME_OUTER,minimumLayoutMode:a}}]:[{type:"axis-overlay",key:ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,scale:ea.SCALE.MAJOR,layout:{dock:"@"+ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,minimumLayoutMode:a}}]}function np({chart:e,models:t,environment:r}){const{refLineModel:n,layoutService:i,colorService:o,dockService:a,themeService:s,appLayoutModel:l,seriesModel:u}=t,c=l.qLocaleInfo,{options:d,theme:m}=r,f="rtl"===d.direction,p=u.query.series(ta.BAR).filter((e=>e.isPrimary)),h=u.query.series(ta.BAR).filter((e=>!e.isPrimary)),y=u.query.series(ta.LINE),g=u.query.series(ta.MARKER),v=u.query.all(),b=v.some((e=>e.isPrimary)),x=v.some((e=>!e.isPrimary)),M=b&&x,S={resolveUIColor:o.getPaletteColor},E=b?Jo({refLineModel:n,layoutService:i,colorModel:S,dock:M?a.meta.minor.dock:a.meta.minor.opposite,scale:ea.SCALE.MINOR.PRIMARY,style:s.getStyles(),formatter:ea.FORMATTER.PRIMARY,theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE_LABEL}):[],C=x?Jo({refLineModel:n,layoutService:i,colorModel:S,dock:M?a.meta.minor.opposite:a.meta.minor.dock,scale:ea.SCALE.MINOR.SECONDARY,style:s.getStyles(),formatter:ea.FORMATTER.SECONDARY,theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE_LABEL,path:"refLine.refLines2"}):[];return[!!b&&Ko({refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MINOR.PRIMARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ea.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE,minimumLayoutMode:rm.REFERENCE_LINE}),!!x&&Ko({refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MINOR.SECONDARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ea.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE,path:"refLine.refLines2",minimumLayoutMode:rm.REFERENCE_LINE}),Ko({isDimension:!0,refLineModel:n,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ea.SCALE.MAJOR,axis:"horizontal"===a.meta.major.orientation?"x":"y",rtl:f,key:ea.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:p.length?`${ea.COMPONENT.BAR}-${ra.PRIMARY}`:h.length?`${ea.COMPONENT.BAR}-${ra.SECONDARY}`:y.length?`${ea.COMPONENT.LINE}-${y[0].id}`:g.length?`${ea.COMPONENT.MARKER}-${g[0].id}`:`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,minimumLayoutMode:rm.REFERENCE_LINE}),...E,...C,...Jo({isDimension:!0,refLineModel:n,layoutService:i,colorModel:S,dock:a.meta.major.opposite,scale:ea.SCALE.MAJOR,style:s.getStyles(),theme:m,localeInfo:c,rtl:f,key:ea.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function ip(e){return"NaN"===e.qMin&&"NaN"===e.qMax}var op=[{key:"NoDataExist",alignment:"center",condition:({layoutService:e})=>{const{x:t,y:r}=e.meta.size;return t*r==0}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>{const{isContinuous:t}=e.meta;if(!t)return!1;const r=e.getHyperCubeValue("qDimensionInfo.0");return r&&(r.qMax<r.qMin||"NaN"===r.qMax)}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>e.getHyperCubeValue("qMeasureInfo").every(ip)},{key:"DataRangeIncludingZero",alignment:"bottom",condition:({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n})=>{if(!1===e.getLayout().showDisclaimer&&n.isEnabled("SHOW_DISCLAIMER"))return!1;const i=e.getLayoutValue("measureAxis.logarithmic",!1),o=t.query.getExtrema(),a=r.query.getExtrema();return i&&(o.meta.includesZero||a.meta.includesZero)}}];function ap({environment:e,models:t}){const{flags:r,translator:n,options:i}=e,{layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=function({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n}){let i,o;for(let a=0,s=op.length;a<s;a++){i=op[a];try{o=i.condition({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:r,flags:n})}catch(e){throw Error("failing disclaimer condition",e)}if(o)return i}return!1}({layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,flags:r});if(!l)return!1;return function(e,t,r){if(!e)return!1;const{translator:n}=t,{rtl:i}=r;return{key:"disclaimer",type:"disclaimer",layout:{dock:G[e].alignment},settings:{label:n.get("Object.Disclaimer."+e),rtl:i}}}(l.key,{translator:n},{rtl:"rtl"===i.direction})}function sp({layoutService:e}){return!!Hd({layoutService:e})&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:ea.SCALE.REDUCED,brush:"selection",fill:"#6CB33F",opacity:.2}}}function lp({models:e,environment:t}){const{layoutService:r,colorService:n,dockService:i,seriesModel:o,selectionService:a}=e,{hasLineSeries:s,isContinuous:l,hasMultipleMeasures:u,isGroupedByMeasure:c}=r.meta;if(!s)return!1;const{options:d}=t,m=r.getLayoutValue("color",{}),f=e=>e.filter((e=>Gf(e)===ta.LINE)).map((e=>({key:gm(ea.COMPONENT.LINE,e),typeIndex:e.typeIndex}))),p=!m.auto&&"byMeasure"===m.mode&&m.byMeasureDef&&void 0!==m.byMeasureDef.activeMeasureIndex,h=r.getHyperCubeValue("qMeasureInfo").map((e=>{var t;return null===(t=e.color)||void 0===t?void 0:t.on}));return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:ea.COLLECTION.LINE},settings:{getSelectionInfo:()=>{var e;return(null==a||null===(e=a.getSelectionInfo)||void 0===e?void 0:e.call(a))||{}},seriesInfo:{primary:f(o.meta.primarySeries),secondary:f(o.meta.secondarySeries)},selectionValues:{"qHyperCube/qDimensionInfo/0":l?e=>e.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value,"qHyperCube/qMeasureInfo/X":e=>e.end.value},colorSettings:e=>n.getSettingsForMeasure(e),colorByData:e=>!h[e]&&p,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:o.meta.barSeriesCount,orientation:i.meta.major.orientation,rtl:"rtl"===d.direction}}}function up({models:{fieldModel:e}}){return{[ea.FORMATTER.PRIMARY]:{data:{fields:e.main.minorsPrimary}},[ea.FORMATTER.SECONDARY]:{data:{fields:e.main.minorsSecondary}}}}function cp({model:e,layoutService:t,definitionPath:r="/qHyperCubeDef"}){return{fetch(t,n){const i={qStart:t,qEnd:n,qNbrPoints:this.computeNbrOfBins(),qMaxNbrTicks:300,qMaxNumberLines:this.computeMaxNumberLines()};return e.getHyperCubeContinuousData(r,i,!1)},shouldFetchReduced(){const{qHyperCube:e}=t.getLayout();return e.qSize.qcy*e.qMeasureInfo.length>=2e3},computeNbrOfBins(){const{qHyperCube:e}=t.getLayout();if(!this.shouldFetchReduced())return 2e3;let r=e.qMeasureInfo.length||1,n=4+2*(r-1);return e.qDimensionInfo.length>1&&(r=Math.max(1,Math.min(12,t.meta.size.dimensions[1])),n=4),Math.ceil(2e3/(r*n))},computeMaxNumberLines(){const{qHyperCube:e}=t.getLayout();return e.qDimensionInfo.length>1&&!this.shouldFetchReduced()?t.meta.size.dimensions[1]+1:12}}}function dp(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function mp({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:r}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:r})},getSnapshotData(){const r=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in r&&"min"in r.zoom&&"max"in r.zoom?function({zoom:e}){return{zoom:e}}(r):function({scrollOffset:e=0,viewRange:t=0},r){let n=r+e,i=n+t;return 1===t&&0===e&&(n=r-.5,i=r+.5),{zoom:{min:n,max:i}}}(r,t.get("continuousMin"))}}}function fp(){const e=()=>{},t=[],r={};return e.set=(e,n)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),r[e]=n},e.forEach=e=>{t.forEach(((t,n)=>e(r[t],n)))},e.has=e=>e in r,e}function pp(e,t,r){return r[0]&&r[0][1]&&r[0][1].qElemNumber>-1?function({start:e,end:t,matrix:r}){const n=[],i=fp(),o=fp();for(let a=0;a<r.length;a++){const s=r[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&&n.push(s)}return i.forEach(((e,t)=>n.splice(t,0,e))),o.forEach((e=>n.push(e))),n}({start:e,end:t,matrix:r}):function({start:e,end:t,matrix:r}){const n=[];let i,o;for(let a=0;a<r.length;a++){const s=r[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&n.push(s)}return i&&n.unshift(i),o&&n.push(o),n}({start:e,end:t,matrix:r})}function hp(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function yp(e,t,r){const n={qDataPages:(r.qDataPages||[]).map((r=>{const n=pp(e,t,r.qMatrix),i=hp(r.qArea,n);return{...r,qArea:i,qMatrix:n}}))};return r.qAxisData&&r.qAxisData.qAxis&&(n.qAxisData=function(e,t,r){return{qAxis:r.qAxis.map((r=>({qName:r.qName,qTags:r.qTags,qTicks:r.qTicks.reduce(((r,n)=>((n.qStart>=e&&n.qStart<=t||n.qEnd>=e&&n.qEnd<=t||n.qStart<e&&n.qEnd>t)&&r.push(n),r)),[])})))}}(e,t,r.qAxisData)),n}function gp(e){return e.qIsOtherCell}function vp({qDataPages:e=[]}={},t={}){const r=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(gp)){const r=e[0].qElemNumber;t[r]=void 0}})),Object.keys(t).length}(r):function(e){let t=0;return e.forEach((e=>{e.some(gp)||t++})),t}(r)}const bp={command:{processDataPage:()=>{}}};var xp={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[,r]=e.domain();for(let e=0;e<t.length;e++){const n=t[e],i=t[e+1];n.data={},i||1===n.end?i?(n.data.start=n.value,n.data.end=i.value,n.end=i.position):(n.data.start=n.value,n.data.end=n.value):(n.data.start=n.value,n.data.end=r,n.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,r=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 n=t[0];r.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],n.data.start]},x:0,y:0,width:n.start*this.rect.width,height:this.rect.height})}return r}};function Mp(e,t=1){if(t%2==0)return e;let r=Math.round(e);return e-r>0?r+=.5:r-=.5,r}function Sp(e,t){const{localProps:{size:r},props:{anchor:n}}=t,i=function({props:e,localProps:{size:t},style:r,renderer:n}){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=>n.measureText({text:e,fontSize:r.label.fontSize,fontFamily:r.label.fontFamily});return{resolve:(e,n)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=n;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const m={x:c+i,y:i,width:d-2*i,height:t.height-2*i},f=s(l[0]+"…").width,p=Math.max(0,m.width-u.width),h=Math.max(0,m.height-u.height),y=o*p,g=a*h;return{show:m.width>=Math.min(f,u.width),text:l,dx:y,dy:g,rect:m,style:r.label,segment:{x:c+y,width:u.width+2*i}}}}}(t),o=function({localProps:{size:e},style:t,scale:r,props:n}){const[i,o]=r.domain(),a=Math.max(0,Math.min(1,n.guideLine.major.justify));return{resolve:(r,n)=>{const s=a*n.width,l=Mp(n.x+s,t.majorGuideLine.strokeWidth);return{show:r.value>=i&&r.value<=o,x1:l,y1:0,x2:l,y2:Mp(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine}}}}(t),a=e.map((e=>{const t=function(e,t,r){const n=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[r],0)*t.width,y:0,width:n,height:t.height}}(e,r,n);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const r=e.length;if(r<2)return;const n=e[r-1],i=t[r-1].label;if(n&&n.start===n.end)for(let e=r-2;e>-1;e--){const r=t[e].label;r.show=r.show&&(o=r.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 Ep(e,t){const r=function({localProps:{size:e},props:t,style:r}){return{resolve:n=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=Mp(n.position*e.width,r.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:Mp(i,r.minorGuideLine.strokeWidth),x2:o,y2:Mp(t.guideLine.minor.size+i,r.minorGuideLine.strokeWidth),style:r.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(r.resolve):[]}function Cp(e){return e.filter((e=>e.show)).map((e=>U({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2})))}var qp={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}),r=t.filter((e=>!e.isMinor)),n=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:r}){const n=Mp(1,t.line.strokeWidth);return{show:r.line.show,x1:Mp(0,t.line.strokeWidth),y1:n,x2:Mp(e.width,t.line.strokeWidth),y2:n,style:t.line}}(this),this.state.major=Sp(r,this),this.state.minor=Ep(n,this)},render(){return[...Cp([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>U({},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"})))),...Cp(this.state.major.map((e=>e.guideLine))),...Cp(this.state.minor.map((e=>e.guideLine)))];var e}};function Op(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,r)=>e.qStart===t.qTicks[r].qStart&&e.qEnd===t.qTicks[r].qEnd))}function Ap(e){return e.qTags.indexOf("$qualified")>-1}function Dp({qAxis:e}){const t=[],r=[];for(let n=0;n<e.length;n++){const i=n+1,o=e[n],a=e[i];Op(o,a)?(Ap(a)?(t.push(i),r.push(n)):(t.push(n),r.push(i)),n++):(t.push(n),r.push(n))}return{qualified:t,nonQualified:r}}function Np({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(r){let n,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(r)){const e=t[l+1];if(i=u.index,n=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(r)){o="auto",s=!0;break}if(e&&e.queries.inner(r)){o=e.index;const n=t[l+2];n&&n.queries.minor(r)&&(a=n.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[n+1];e&&e.queries.minor(r)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function Ip({qTicks:e,measureText:t=(()=>({width:0})),cache:r={},scale:n}){const i=r;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(n(e.qStart)-n(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const r=n.clamp();return n.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(n(e.qStart)-n(e.qEnd)),width:t(""+e.qText).width+16}))),n.clamp(r),i.rangeAndWidth}}}function Tp({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:r})=>e>r*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:r})=>e>r*t)),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:r=>r>=t*e.count()}}function wp({qualified:e,nonQualified:t,qAxis:r,measureText:n,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Ip,queryFactory:s=Tp}={attributesFactory:Ip,queryFactory:Tp}){const l=r.map(((e,t)=>function(e,t){const{qTicks:r}=e,l=a({qTicks:r,measureText:n,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 Lp({qAxis:e=[],measureText:t=(()=>({width:0})),cache:r={},reqAutoFitWidth:n=0,scale:i},{metaFactory:o=wp,mapper:a=Dp,resolver:s=Np}={metaFactory:wp,mapper:Dp,resolver:Np}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:n,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const n=r.key({distance:t});if(r.get(n))return r.get(n);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=m.resolve(t);return r.set(n,i),i}}}function Rp(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const kp=Rp(0).getTime();function Pp(e){return(e.getTime()-kp)/86400/1e3}var jp=new Date,Fp=new Date;function Vp(e,t,r,n){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(r){return e(r=new Date(r-1)),t(r,1),e(r),r},i.round=function(e){var t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=function(e,r){return t(e=new Date(+e),null==r?1:Math.floor(r)),e},i.range=function(r,n,o){var a,s=[];if(r=i.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return s;do{s.push(a=new Date(+r)),t(r,o),e(r)}while(a<r&&r<n);return s},i.filter=function(r){return Vp((function(t){if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(i.count=function(t,n){return jp.setTime(+t),Fp.setTime(+n),e(jp),e(Fp),Math.floor(r(jp,Fp))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(n?function(t){return n(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var _p=Vp((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()})),Bp=Vp((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()})),Hp=Vp((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()})),$p=Vp((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 zp(e){return Vp((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}))}var Up=zp(0);zp(1),zp(2),zp(3),zp(4),zp(5),zp(6);var Yp=Vp((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()})),Wp=Vp((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()}));Wp.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Vp((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var Gp=Wp;const Kp=1,Xp=2,Jp=3,Zp=4,Qp=5,eh=6;function th({timeScale:e,labels:t,distance:r,isDayOrShorter:n,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:r});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,r,n,i,o){function a(e){return Gp.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=_p.count(e,t),l=Bp.count(e,t),u=Hp.count(e,t),c=$p.count(e,t),d=Up.count(e,t),m=Yp.count(e,t),f=Gp.count(e,t),p=r/n.second.width-1,h=r/n.minute.width-1,y=r/n.date.width-1,g=r/n.year.width-1,v={type:"year",desc:"year",count:f,interval:Gp.every(1),formatter:n.year.formatter,offset:e=>Gp.offset(e,-1),floor:Gp.floor};if(s<=p)v.type=Kp,v.desc="second",v.count=s,v.interval=_p.every(1),v.formatter=n.second.formatter,v.offset=e=>_p.offset(e,-1),v.floor=_p.floor;else if(s/2<=p)v.type=Kp,v.desc="every other second",v.count=s/2,v.interval=_p.every(2),v.formatter=n.second.formatter,v.offset=e=>_p.offset(e,-2),v.floor=_p.floor;else if(s/5<=p)v.type=Kp,v.desc="every 5 second",v.count=s/5,v.interval=_p.every(5),v.formatter=n.second.formatter,v.offset=e=>_p.offset(e,-5),v.floor=_p.floor;else if(s/15<=p)v.type=Kp,v.desc="every 15 second",v.count=s/15,v.interval=_p.every(15),v.formatter=n.second.formatter,v.offset=e=>_p.offset(e,-15),v.floor=_p.floor;else if(s/30<=p)v.type=Kp,v.desc="every 30 second",v.count=s/30,v.interval=_p.every(30),v.formatter=n.second.formatter,v.offset=e=>_p.offset(e,-30),v.floor=_p.floor;else if(l<=h)v.type=Xp,v.desc="minute",v.count=l,v.interval=Bp.every(1),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-1),v.floor=Bp.floor;else if(l/2<=h)v.type=Xp,v.desc="every 2 minute",v.count=l/2,v.interval=Bp.every(2),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-2),v.floor=Bp.floor;else if(l/5<=h)v.type=Xp,v.desc="every 5 minute",v.count=l/5,v.interval=Bp.every(5),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-5),v.floor=Bp.floor;else if(l/10<=h)v.type=Xp,v.desc="every 10 minute",v.count=l/10,v.interval=Bp.every(10),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-10),v.floor=Bp.floor;else if(l/15<=h)v.type=Xp,v.desc="every 15 minute",v.count=l/15,v.interval=Bp.every(15),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-15),v.floor=Bp.floor;else if(l/30<=h)v.type=Xp,v.desc="every 30 minute",v.count=l/30,v.interval=Bp.every(30),v.formatter=n.minute.formatter,v.offset=e=>Bp.offset(e,-30),v.floor=Bp.floor;else if(u<=h)v.type=Jp,v.desc="hour",v.count=u,v.interval=Hp.every(1),v.formatter=n.minute.formatter,v.offset=e=>Hp.offset(e,-1),v.floor=Hp.floor;else if(u/2<=h)v.type=Jp,v.desc="every 2 hour",v.count=u/2,v.interval=Hp.every(2),v.formatter=n.minute.formatter,v.offset=e=>Hp.offset(e,-2),v.floor=Hp.floor;else if(u/3<=h)v.type=Jp,v.desc="every 3 hour",v.count=u/3,v.interval=Hp.every(3),v.formatter=n.minute.formatter,v.offset=e=>Hp.offset(e,-3),v.floor=Hp.floor;else if(u/6<=h)v.type=Jp,v.desc="every 6 hour",v.count=u/6,v.interval=Hp.every(6),v.formatter=n.minute.formatter,v.offset=e=>Hp.offset(e,-6),v.floor=Hp.floor;else if(u/12<=h||i)v.type=Jp,v.desc="every 12 hour",v.count=u/12,v.interval=Hp.every(12),v.formatter=n.minute.formatter,v.offset=e=>Hp.offset(e,-12),v.floor=Hp.floor;else if(c<=y)v.type=Zp,v.desc="day",v.count=c,v.interval=$p.every(1),v.formatter=n.date.formatter,v.offset=e=>$p.offset(e,-1),v.floor=$p.floor;else if(c/2<=y)v.type=Zp,v.desc="every 2 day",v.count=c/2,v.interval=$p.every(2),v.formatter=n.date.formatter,v.offset=e=>$p.offset(e,-2),v.floor=$p.floor;else if(c/3<=y)v.type=Zp,v.desc="every 3 day",v.count=c/3,v.interval=$p.every(3),v.formatter=n.date.formatter,v.offset=e=>$p.offset(e,-3),v.floor=$p.floor;else if(d<=y)v.type=Zp,v.desc="week",v.count=d,v.interval=Up.every(1),v.formatter=n.date.formatter,v.offset=e=>Up.offset(e,-1),v.floor=$p.floor;else if(d/2<=y)v.type=Zp,v.desc="every 2 week",v.count=d/2,v.interval=Up.every(2),v.formatter=n.date.formatter,v.offset=e=>Up.offset(e,-2),v.floor=$p.floor;else if(m<=y)v.type=Qp,v.desc="month",v.count=m,v.interval=Yp.every(1),v.formatter=n.date.formatter,v.offset=e=>Yp.offset(e,-1),v.floor=$p.floor;else if(m/3<=y)v.type=Qp,v.desc="quarter",v.count=m/3,v.interval=Yp.every(3),v.formatter=n.date.formatter,v.offset=e=>Yp.offset(e,-3),v.floor=$p.floor;else if(m/6<=y)v.type=Qp,v.desc="half year",v.count=m/6,v.interval=Yp.every(6),v.formatter=n.date.formatter,v.offset=e=>Yp.offset(e,-6),v.floor=$p.floor;else if(f<=g)v.type=eh,v.desc="year",v.count=f,v.interval=Gp.every(1),v.formatter=n.year.formatter,v.offset=e=>Gp.offset(e,-1),v.floor=Gp.floor;else if(f/2<=g)v.type=eh,v.desc="every 2 year",v.count=f/2,v.interval=a(2),v.formatter=n.year.formatter,v.offset=e=>Gp.offset(e,-2),v.floor=Gp.floor;else if(f/5<=g)v.type=eh,v.desc="every 5 year",v.count=f/5,v.interval=a(5),v.formatter=n.year.formatter,v.offset=e=>Gp.offset(e,-5),v.floor=Gp.floor;else if(f/10<=g)v.type=eh,v.desc="every 10 year",v.count=f/10,v.interval=a(10),v.formatter=n.year.formatter,v.offset=e=>Gp.offset(e,-10),v.floor=Gp.floor;else{const e=Math.floor(f/g);v.type=eh,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=n.year.formatter,v.offset=t=>Gp.offset(t,-e),v.floor=Gp.floor}return v}(s,l,r,t.all(),n,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 m=d.map(((e,t,r)=>{const n=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+n),formatter:c.formatter}}));let f=[];if(!o&&c.type<=Jp){const r=t.getFormat("date"),n=e.ticks($p.every(1));n.length&&s.getUTCDate()!==n[0].getUTCDate()&&n.unshift($p.offset(n[0],-1)),f=(n.length?n:[$p.floor(s)]).map(((e,t,n)=>{const i=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:r.formatter}}))}return{inner:m,outer:f}}const rh={};function nh(e,t,r,n){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...r)),formatter:n}}function ih(e,t,r){const{generator:n,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=function(){return gt.apply($i(Cn,En,xn,vn,gn,yn,un,ln,Nn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}().domain([Rp(l),Rp(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof n?n:{type:n};let m;m="d3"===d.type?(e,i)=>th({timeScale:c,labels:r,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Rp(n.initialMin)}):e=>function(e,t,r,n,i,o=!1){if(rh[[t,r,n,n,o]])return rh[[t,r,n,n,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Rp(r),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=n-r,m=t/(i-n),f=m/1440,p=m/86400,h=366*m,y=3*m*30,g=a.second.width/p,v=a.minute.width/f,b=a.date.width/y,x=a.year.width/h;let M,S,E,C=0,q=0,O=null,A=null,D=null,N=null,I=null,T=null;const w={outer:[],inner:[]};for(g<1?(O=1,q=1/86400):g<2?(O=2,q=1/86400*2):g<5?(O=5,q=1/86400*5):g<10?(O=10,q=1/86400*10):g<30?(O=30,q=1/86400*30):v<1?(A=1,q=1/1440):v<2?(A=2,q=1/1440*2):v<5?(A=5,q=1/1440*5):v<10?(A=10,q=1/1440*10):v<30?(A=30,q=1/1440*30):v<60?(D=1,q=1/24):v<120?(D=2,q=2/24):v<360?(D=6,q=.25):v<720?(D=12,q=.5):b<1/90?(q=1,N=1):b<2/90?(q=2,N=2):b<7/90?(q=7,N=7):b<31/90?(I=1,q=31):b<1?(I=3,q=90):x<1?(T=1,q=366):x<2?(T=2,q=732):x<5?(T=5,q=1826.25):(T=10,q=3652.5),S=Math.floor((d+r%1)/q);C<i;){E=S+1,M=T?nh("year",[l+S*T,0,1],[l+E*T,0,1],a.year.formatter):I?nh("month",[l,u+S*I,1],[l,u+E*I,1],a.date.formatter):N?nh("day",[l,u,c+S*N],[l,u,c+E*N],a.date.formatter):D?nh("hour",[l,u,c,0+S*D],[l,u,c,0+E*D],a.minute.formatter):A?nh("minute",[l,u,c,0,0+S*A],[l,u,c,0,0+E*A],a.minute.formatter):nh("second",[l,u,c,0,0,0+S*O],[l,u,c,0,0,0+E*O],a.second.formatter),C=Pp(M.start),w.inner.push(M);const e=Math.floor(C);if(!(o||T||I||N)){const t={type:"day",start:Rp(e),end:Rp(e+1),formatter:a.date.formatter,qStart:e};w.outer[w.outer.length-1]&&w.outer[w.outer.length-1].qStart===t.qStart||w.outer.push(t)}S++}return w.min=n,w.max=i,rh[[t,r,n,n,o]]=w,w}(r,e,d.min,l,u,"T"===s.qType);const f={transform:(t=[],{isMinor:r=!1}={})=>t.map((t=>{let n;n="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();r&&e.clamp(!1);const a=e(n),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:n,position:a,start:s,end:l,label:t.qText,isMinor:r,data:r?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,r)=>m(t,r)[a].map((t=>{let r;return r="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:r,label:t.formatter(r),isMinor:!1,data:{start:Pp(t.start),end:Pp(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return f}const oh=/t+/i;const ah={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 sh(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 lh="continuousPan";var uh={model:function({model:e,layoutService:t,dataProcessorModel:r=bp,viewCache:n,viewState:i,definitionPath:o},a={}){const{engineFetcherFactory:s=cp,snapshotFetcherFactory:l=mp,cacheFetcherFactory:u=dp,cache:c={initial:{},merged:{}}}=a,d=s({model:e,layoutService:t,definitionPath:o}),m=l({layoutService:t,viewCache:n}),f=u({cache:c}),p=e=>{throw e.isHandled=!0,e};let h,y,g;return{update(e){var r,o;({initialMin:y,initialMax:g}=function(e={}){let{qMin:t,qMax:r}=e;return t=Number.isNaN(+t)?0:t,r=Number.isNaN(+r)?0:r,{initialMin:t,initialMax:r}}(e.qHyperCube.qDimensionInfo[0])),n.set("continuousMin",y),n.set("continuousMax",g),n.set("minimiumZoomSpan",(r=y,o=g,Math.max(1e-6,2.3841857910156157e-7*(o-r)))),h=t.meta.isSnapshot?m:d,t.meta.isSnapshot&&({zoom:{min:y,max:g}}=m.getSnapshotData()),i.preventSet("zoom",{min:y,max:g})},updateLayout(e){const{qDataPages:r,qAxisData:n}=e;return t.setHyperCubeValue("qDataPages",r),t.setHyperCubeValue("qAxisData",n),t.setHyperCubeValue("qMode","S"),e},initialFetch(){return h.fetch(y,g).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=hp(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),c.initial=t,c.merged=t,e})).then((e=>yp(y,g,e))).then((e=>this.updateLayout(e))).catch(p)},fetch:(e,t)=>h.fetch(e,t).then((e=>function(e,t){const r={};return r.qDataPages=(e.qDataPages||[]).map(((e,r)=>{const n=function(e,t){if(!t||!t.length||!t[0].length)return e;const r=t[0][0].qNum,n=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<r?i.push(e[t]):a.qNum>n&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[r].qMatrix),i=hp(e.qArea,n);return{...e,qArea:i,qMatrix:n}})),e.qAxisData&&e.qAxisData.qAxis&&(r.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const r=t.qAxis.map((e=>e.qName)),n=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=r.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=n[a];for(let r=0,n=o.qTicks.length;r<n;r++){const n=o.qTicks[r];n.qStart<e?s.push(n):n.qStart>t&&l.push(n)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),r}(c.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),c.merged=e,e))).then((r=>yp(e,t,r))).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then((r=>yp(e,t,r))),fetchMinMaxData:()=>Promise.resolve(c.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return U({},e,{...c.initial})},getInitialLayout(){const e=this.getInitialCube();return U({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>vp(c.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e;t.qDataPages=c.merged.qDataPages,t.qAxisData=c.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:r,continuousDataModel:n}=e;function i(e,r,i){return n[e](r,i).then((e=>(n.updateLayout(e),t(),e)))}const o=Nl(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:n,max:a})=>!r.meta.isContinuous||e===n&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((r=>(o(e,t),r)))},onZoomIntercept:function({viewCache:e}){let t=NaN,r=NaN,n=NaN;return(i,o)=>(t=e.get("continuousMin"),r=e.get("continuousMax"),n=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<n?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(r,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:r},{threshold:n=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return Il(((e,n)=>{const l=(e=>r.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,r){let{x:n}=e;return n-=t.element.getBoundingClientRect().left,n-=r.rect.x,Math.max(0,Math.min(1,n/r.rect.width))}(e,r,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),f=m-(n>0?.7071067811865475:1.4142135623730951)*m,p=c+f*u,h=d-f*(1-u),y=p<a?a-p:0,g=h>s?h-s:0;t.set("zoom",{min:Math.max(p-g,a),max:Math.min(h+y,s)})}}),n)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:r,viewState:n,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:lh,pointers:1,threshold:10,enable(n,i){return this.started===lh||!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{continuousPanstart(r){r.preventDefault(),this.started=lh;const{min:i,max:o}=n.get("zoom");this[lh]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},continuousPanmove(e){e.preventDefault();const{span:t,min:r,max:o,size:a}=this[lh],s=-e.deltaX/a;n.set("zoom",{min:Math.min(r+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:xp,timeAxis:qp},picassoScales:{time:function e(t,r={}){const n=function(e,t,r){const n={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?n[i]=o(r):"object"!==a||Array.isArray(o)?n[i]="undefined"===a?t[i]:o:n[i]=U(!0,{},t[i],o)})),n}(t,ah,r),{qAxis:i}=n,o=nn(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let r=+e.min,n=+e.max;return Number.isNaN(r)&&Number.isNaN(n)&&Array.isArray(t)&&t.length&&(r=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),n=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),r===n&&(r-=.5,n+=.5),{min:Number.isNaN(+r)?0:r,max:Number.isNaN(+n)?1:n}}(n,i);let u,c,d=[];const m=function(e){return Number.isNaN(+e)?NaN:o(e)};m.ticks=({distance:e,resolve:t=u.resolve}={})=>{const r=t(e),o=r[n.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+r.minor)){const e=c.transform(i[r.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,r.isDayOrShorter)),d},m.invert=e=>o.invert(e),m.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),m.range=e=>Array.isArray(e)?o.range(e):o.range(),m.norm=e=>(sh(a,m),a.instance(e)),m.normInvert=e=>(sh(a,m),a.instance.invert(e)),m.copy=()=>e(t,r),m.clamp=(e=!0)=>(o.clamp(e),o.clamp()),m.min=()=>Math.min(s,l),m.max=()=>Math.max(s,l),o.range(n.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=n.invert;const f=function(e){const t={},{measureText:r,fn:n,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&&oh.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=n(o[e].pattern),o[e].width=Math.max(o[e].width,r(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:r}=t;if(!r)return o.date;const n=Rp(t[0].data.start),i=Rp(t[r-1].data.start);return $p.count(n,i)/r>=1?o.date:Hp.count(n,i)/r>0?o.minute:Bp.count(n,i)/r>0?o.second:o.date},t}(n);return c=ih(o.copy(),n,f),u=Lp({qAxis:i,measureText:n.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:n.cache,scale:m}),m.data=()=>({fields:[{formatter:m.formatter,id:()=>"qHyperCube/"+n.field,key:()=>n.field,raw:Ol(r,"fields.0.raw",(()=>({})))}]}),m.formatter=()=>f.getFormatFromTicks(d).formatter,m}}};const ch=e=>e.meta.seriesComponentKeys[0];const{event:{onZoom:dh}}=uh,mh=[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${pm}`,`${ea.COMPONENT.BAR_OOB}-${hm}`,`${ea.COMPONENT.BAR_OOB}-${pm}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${hm}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR_OOB}-${pm}-${ra.SECONDARY}`,`${ea.COMPONENT.BAR_OOB}-${hm}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${pm}`,`${ea.COMPONENT.SLICED_HAT}-${hm}`,`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.PRIMARY}`,`${ea.COMPONENT.SLICED_HAT}-${pm}-${ra.SECONDARY}`,`${ea.COMPONENT.SLICED_HAT}-${hm}-${ra.SECONDARY}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${pm}`,`${ea.COMPONENT.DATA_OOB_MARKER}-${hm}`,ea.COMPONENT.AXIS.MAJOR];function fh({chart:e,models:t,actions:r,viewState:n,viewCache:i,environment:o}){const{appModel:a,layoutService:s,seriesModel:l,tooltipModel:u,flags:c}=t,{pointComponentKeys:d,markerComponentKeys:m,barComponentKeys:f}=l.meta,p=[...d,...m],h=[...f],y=[...mh,...p],g=u.query.getCustomTooltipModel(),v=ch(l),b=g.utils,x=Nl(b.displayTooltip,b.DEBOUNCE_THRESHOLD),M=s.meta.isContinuous?dh({chart:e,viewState:n,viewCache:i},{rtl:"rtl"===o.options.direction,threshold:50,targetKey:v}):()=>{},S=()=>e.component(ea.COMPONENT.LEGEND_TOOLTIP),E=()=>e.component(ea.COMPONENT.TOOLTIP),C=()=>{(()=>{const e=S();e&&e.show&&e.emit("hide")})(),(()=>{const e=E();e&&e.show&&(e.emit("hide"),u.query.useCustomTooltip()&&x&&x({},e,{nodes:[],opts:{app:a,flags:c},customTooltipModel:g,hide:!0}))})()};return{type:"native",events:{wheel(t){const n={x:t.clientX,y:t.clientY},i=e.componentsFromPoint(n);if(r.interact.enabled()){const[e]=i.filter((e=>e.key===ea.COMPONENT.LEGEND_CATEGORICAL));((e,t)=>{if(t){const r=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;t.emit(r>=0?"next":"prev"),e.preventDefault()}})(t,e)}if(r.scroll.enabled()){const[e]=i.filter((e=>e.key===v));e&&(M(n,Math.sign(-t.deltaY)),t.preventDefault())}C()},mousemove(n){if(!r.tooltip.enabled())return;const i=e.componentsFromPoint({x:n.clientX,y:n.clientY}),o=S();o&&o.show&&(i.some((e=>e.key===ea.COMPONENT.LEGEND_CATEGORICAL))?o.emit("show",n):o.emit("hide"));const s=E();if(s&&s.show)if(i.some((e=>-1!==y.indexOf(e.key)))){const r=[],{x:o,y:d}=function({chart:e,e:t}){const{left:r,top:n}=e.element.getBoundingClientRect();return{x:(t.center?t.center.x:t.clientX)-r,y:(t.center?t.center.y:t.clientY)-n}}({chart:e,e:n});if(i.some((e=>p.indexOf(e.key)>-1))&&r.push(...e.shapesAt({cx:o,cy:d,r:3},{components:p.map((e=>({key:e})))})),i.some((e=>h.indexOf(e.key)>-1))&&r.push(...e.shapesAt({x:o,y:d},{components:h.map((e=>({key:e})))})),u.query.useCustomTooltip()&&b.checkIfPromisesExist({customTooltipModel:g})){let i=[];if(0===r.length&&(r.push(...b.getNodes(n,e)),1===r.length&&r[0].key===ea.COMPONENT.AXIS.MAJOR)){var l;const n=Qf({chart:e,models:t,nodes:r});null!=n&&n.length&&null!==(l=n[0].childrenNodes)&&void 0!==l&&l.length&&(i=n[0].childrenNodes)}x(n,s,{nodes:r,extractedNodes:i,opts:{app:a,flags:c},customTooltipModel:g})}else s.emit("show",n,r.length?{nodes:r}:void 0)}else s.emit("hide")},mouseup(e){2===e.button&&C()},mouseleave(){C()}}}}const ph=uh.interactions.areaPan;function hh({chart:e,models:t,environment:r,viewState:n,viewCache:i,actions:o,selectables:a}){const{layoutService:s,dockService:l,discreteModel:u,colorService:c}=t,d="rtl"===r.options.direction,m=function({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...xd({componentKey:e,chart:t,actions:r,viewState:n,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:Md({componentKey:e,chart:t,actions:r,layoutService:o})}}({componentKey:"scrollbar",chart:e,actions:o,viewState:n,viewCache:i,discrete:u,layoutService:s,dockService:l,rtl:d}),f={type:"hammer",enable:!0,gestures:[...c.custom.legendInteractions(),...a.gestures.sort(((e,t)=>(t.prio||0)-(e.prio||0))),...m.gestures]},p=[fh({chart:e,models:t,actions:o,viewState:n,viewCache:i,environment:r}),m.native];return s.meta.isDiscrete&&(f.gestures.push(...u.interactions.gestures),p.push(u.interactions.native)),s.meta.isContinuous&&f.gestures.push(ph({targetKey:ch(t.seriesModel),chart:e,actions:o,viewState:n,viewCache:i}),function({targetKey:e,chart:t,actions:r,viewState:n,viewCache:i,rtl:o}){const a={last:0,diff:0},s=uh.event.onZoom({viewCache:i,viewState:n,chart:t},{threshold:100,rtl:o,targetKey:e});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:"continuousPinchZoom",pointers:2,threshold:0,enable:(n,i)=>!i||!!r.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{continuousPinchZoomstart(e){a.last=e.scale,e.preventDefault()},continuousPinchZoommove(e){const t=e.scale-a.last;Math.abs(t)>.01&&s(e.center,t>0?1:-1),a.last=e.scale,e.preventDefault()}}}}({targetKey:ch(t.seriesModel),chart:e,actions:o,viewState:n,viewCache:i,rtl:d})),[f,...p]}const yh=({key:e,componentTargetKey:t,requireFailure:r,recognizeWith:n},i)=>({key:"event:"+e,type:"Pan",requireFailure:r,recognizeWith:n,options:{event:"lasso",enable(e,r){if("lasso"===this.started||!r)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:r.center.x,y:r.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)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end","lasso")}}});const gh=({targets:e,requireFailure:t,recognizeWith:r,components:n,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:r,options:{event:i,interval:10,pointers:1,enable(t,r){return!r||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const r=function(e,t){const r=t.element.getBoundingClientRect();let n,i;return e.center?(({x:n}=e.center),({y:i}=e.center)):(n=e.clientX,i=e.clientY),{x:n-r.left,y:i-r.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:r.x,cy:r.y,r:u}:r,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),m=this.chart.component("tooltip"),f="mouse"!==t.pointerType&&m&&m.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),r=e.some((e=>"legend-cat"===e.type));if(!d.length&&r||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&n){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof n?n(t,d):n;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i)}}if(m&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const r=s.getNodes(t,this.chart);l(t,m,{nodes:r,opts:o,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else f&&m.emit("hide")}}}};const vh=({key:e,requireFailure:t,recognizeWith:r,eventName:n="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:r,options:{event:`${n}-${e}-tap`,interval:10,pointers:1,enable:(t,r)=>!!r&&(!!i.actions.select.enabled()&&(!(!r.target||"INPUT"!==r.target.nodeName)||!(!r.target||!r.target.hasAttribute("data-other-value"))&&(r.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${n}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const bh=({eventName:e,key:t,fillTargets:r=[],requireFailure:n,recognizeWith:i},o,a)=>({key:"event:"+t,type:"Pan",requireFailure:n,recognizeWith:i,options:{event:e,enable(n,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!==r.indexOf(e.key)));return 0===a.length&&function(e,t){const{target:r}=e.srcEvent;return!(!r||0!==(r.getAttribute("data-key")||"").indexOf(t+"-"))}(i,t)?(this.started=e,!0):a.length>0}},events:{[e+"start"](r){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),r.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(a+"Start",r),this.started=e},[e+"move"](e){e.preventDefault(),this.chart.component(t).emit(a+"Move",e)},[e+"end"](r){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),r.preventDefault(),this.chart.component(t).emit(a+"End",r),o.actions.select.emit("end",e),this.started=!1}}});function xh(e,t){const r=function(e){const{key:t,targets:r,fillTargets:n,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:r.map((e=>"@"+e)).join(",")},on:m?{bubbleEnd(){m()}}:{},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:n,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),n=bh(e,t,"range");return{interactions:[e.onEdited?vh(e,t):null,n].filter(Boolean),components:[r]}}const Mh=/axis|legend/;function Sh({actions:e,models:t}){const{seriesModel:r,layoutService:n,colorService:i,tooltipModel:o,flags:a}=t,s=n.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1);return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[gh(e,t)],components:[]}}({targets:[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...r.query.series(ta.MARKER).map((e=>gm(ea.COMPONENT.MARKER,e))),...r.query.series(ta.LINE).map((e=>gm(ea.COMPONENT.POINT,e))),ea.COMPONENT.AXIS.MAJOR,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.LEGEND_CATEGORICAL],components:(e,t)=>{const[r]=t,{key:n}=r,i={key:n,action:e.srcEvent.ctrlKey||s?"set":"toggle",contexts:["selection"]};return-1===[ea.COMPONENT.AXIS.MAJOR,ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ea.COMPONENT.LEGEND_CATEGORICAL].indexOf(n)&&(i.data=["selectionDimension"]),[i]}},{actions:e,isLocked:e=>e.some((e=>"legend-cat"===e.type))?i.isSelectionLocked({isMeasureSelectionLocked:n.meta.isDimensionLocked}):n.meta.isDimensionLocked,hitRadius:e=>(e=>e.some((e=>Mh.test(e.type))))(e)?0:3,customTooltipModel:o.query.getCustomTooltipModel(),debouncer:Nl,flags:a})}function Eh({actions:e,models:t}){const{layoutService:r,dockService:n,seriesModel:i}=t,{isDiscrete:o,isDimensionLocked:a}=r.meta;if(!o||a)return!1;const s=[...i.meta.seriesComponentKeys,ea.COMPONENT.AXIS.MAJOR];return function(e,t){const r=function(e){const{key:t,targets:r,components:n,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:r.map((e=>"@"+e)).join(",")},settings:{multiple:!0,brush:{components:n},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:[bh(e,t,"area")],components:[r]}}({eventName:"discreteRange",key:"discrete-range-brush",components:[{key:s[0],contexts:["selection"],action:"set",data:["selectionDimension"]}],targets:s,fillTargets:[ea.COMPONENT.AXIS.MAJOR],dock:n.meta.major.dock},{actions:e})}const Ch={components:[],interactions:[]};function qh({actions:e,chart:t,models:r}){const n=function({actions:e,models:t}){const{dockService:r,seriesModel:n,layoutService:i}=t;return!i.meta.isDimensionLocked&&!i.meta.isBarSeriesStacked&&xh({eventName:"minorRange",key:"minor-range-brush",targets:[ea.COMPONENT.AXIS.MINOR.PRIMARY,`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,...n.query.series(ta.MARKER).filter((e=>e.isPrimary)).map((e=>gm(ea.COMPONENT.MARKER,e))),...n.query.series(ta.LINE).filter((e=>e.isPrimary)).map((e=>gm(ea.COMPONENT.POINT,e)))],fillTargets:[ea.COMPONENT.AXIS.MINOR.PRIMARY],dock:r.meta.minor.dock,scale:ea.SCALE.MINOR.PRIMARY,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:e,models:r})||Ch,i=function({actions:e,models:t}){const{dockService:r,seriesModel:n,layoutService:i}=t;return!i.meta.isDimensionLocked&&!i.meta.isBarSeriesStacked&&xh({eventName:"minorRange-secondary",key:"minor-secondary-range-brush",targets:[ea.COMPONENT.AXIS.MINOR.SECONDARY,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...n.query.series(ta.MARKER).filter((e=>!e.isPrimary)).map((e=>gm(ea.COMPONENT.MARKER,e))),...n.query.series(ta.LINE).filter((e=>!e.isPrimary)).map((e=>gm(ea.COMPONENT.POINT,e)))],fillTargets:[ea.COMPONENT.AXIS.MINOR.SECONDARY],dock:r.meta.minorSecondary.dock,scale:ea.SCALE.MINOR.SECONDARY,onEdited(){e.select.emit("end","minorRange-secondary")}},{actions:e})}({actions:e,models:r})||Ch,o=Eh({actions:e,models:r})||Ch,a=function({actions:e,chart:t,models:r}){const{layoutService:n,dockService:i,seriesModel:o}=r,{isContinuous:a,isTime:s}=n.meta;if(!a)return!1;const l=s?[ea.COMPONENT.AXIS_OVERLAY.TIME_INNER,ea.COMPONENT.AXIS_OVERLAY.TIME_OUTER]:[ea.COMPONENT.AXIS_OVERLAY.CONTINUOUS];return xh({eventName:"continuousRange",key:"continuous-range-brush",targets:[`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,...o.query.series(ta.MARKER).map((e=>gm(ea.COMPONENT.MARKER,e))),...o.query.series(ta.LINE).map((e=>gm(ea.COMPONENT.POINT,e))),...l],fillTargets:l,dock:i.meta.major.dock,scale:s?ea.SCALE.MAJOR_INNER:ea.SCALE.MAJOR,observeBrush:!0,multiple:!0,toLabel({datum:e,data:r,scale:n}){const i=s?n.formatter():t.formatter(ea.FORMATTER.PRIMARY),o=t.scale(ea.SCALE.MAJOR).max(),a=t.brushSelectionIncludeMax&&e===o;return`${e!==Math.max(...r)||a?"":"<"}${i(e)}`}},{actions:e})}({actions:e,chart:t,models:r})||Ch,s=function({actions:e,models:t}){const{colorService:r,layoutService:n}=t,[i]=r.custom.legendComponents(),o=r.custom.wrappedScales(),{isDimensionLocked:a}=n.meta;if(a||!i)return!1;const s=ea.SCALE.COLOR+"Range",{type:l,key:u}=i,c=o[s];return!("legend-seq"!==l||!c||c.min>=c.max)&&xh({eventName:"legendRange",key:"legend-range-brush",targets:[u],fillTargets:[u],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:i.layout.dock,scale:s,bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e})}({actions:e,models:r})||Ch;return{components:[...n.components,...i.components,...o.components,...a.components,...s.components],interactions:[...n.interactions,...i.interactions,...o.interactions,...a.interactions,...s.interactions]}}function Oh({actions:e,models:t}){const{layoutService:r,seriesModel:n}=t,{seriesComponentKeys:i}=n.meta;if(r.meta.isDimensionLocked)return{components:[],interactions:[]};return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const r={key:"lasso",...e},n=(({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}}}))(r);return{interactions:[yh(r,t)],components:[n]}}({key:"lasso",componentTargetKey:i[0],components:i.map((e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]})))},{actions:e})}function Ah({picasso:e,chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a}){const{colorService:s,pluginService:l}=r,u=r.layoutService.getLayout(),{options:c}=n,d=function(e,t){return{layoutModes:J.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}(0,{logicalSize: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:u,options:c}),minCenterRatio:0}),m=function({chart:e,models:t,environment:r,viewState:n,viewCache:i,actions:o}){var a;const{colorService:s,layoutService:l,dockService:u}=t,c=ap({environment:r,models:t});return"center"===(null==c||null===(a=c.layout)||void 0===a?void 0:a.dock)?[c]:[...Rf({models:t}),...im({models:t}),...Af({chart:e,models:t,environment:r,viewState:n,viewCache:i}),lp({models:t,environment:r}),...cm({models:t,environment:r}),...Ff({models:t,environment:r,actions:o}),Wi({viewState:n,viewCache:i,layoutService:l,dockService:u}),...rp({models:t}),...np({chart:e,models:t,environment:r}),Vf({models:t,environment:r,viewState:n,viewCache:i}),...s.custom.legendComponents(),sp(t),...$f({chart:e,models:t,viewState:n,viewCache:i,environment:r}),...tp({chart:e,models:t,environment:r}),c].filter(Boolean)}({chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a}),f=function({actions:e,chart:t,models:r}){const{layoutService:n}=r,i=n.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),o=Sh({actions:e,models:r});if(i)return{components:[...o.components],gestures:[...o.interactions]};const a=qh({actions:e,chart:t,models:r}),s=Oh({actions:e,models:r});return{components:[...o.components,...a.components,...s.components],gestures:[...o.interactions,...a.interactions,...s.interactions]}}({actions:a,chart:t,models:r}),p=l.extendComponents([...m,...f.components]);return{collections:$d({models:r}),scales:tm({picasso:e,models:r,viewState:i,viewCache:o,environment:n}),components:p,formatters:up({models:r}),interactions:hh({chart:t,models:r,environment:n,viewState:i,viewCache:o,actions:a,selectables:f}),strategy:d,palettes:s.getPalettes()}}const Dh=({models:{layoutService:e,fieldModel:t,appLayoutModel:r}})=>({type:"q",key:ea.DATA.MAIN,data:e.getHyperCube(),config:{virtualFields:t.virtuals,localeInfo:r.qLocaleInfo}}),Nh=({models:{layoutService:e,fieldModel:t,continuousModel:r,appLayoutModel:n}})=>e.meta.isContinuous?[{type:"q",key:ea.DATA.REDUCED,data:r.getInitialCube(),config:{virtualFields:t.virtuals,localeInfo:n.qLocaleInfo}}]:[],{event:{onZoomIntercept:Ih,onZoomChange:Th}}=uh,wh=[ea.COMPONENT.AXIS_TITLE.MAJOR,ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,ea.COMPONENT.GRID_LINE,ea.COMPONENT.ZERO_LINE],Lh=({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l})=>{(({chart:e,models:t,viewState:n,viewCache:i})=>{r((()=>{if(!t||!n||!i)return;const{layoutService:r,continuousModel:o,refLineModel:a,seriesModel:s}=t,{miniComponentKeys:l}=s.meta,u=()=>{a&&a.update(),e.update({partialData:!0,excludeFromUpdate:[...wh,...l]})};n.onChanged("scrollOffset",u),r.meta.isContinuous&&(n.onChanged("zoom",Th({layoutService:r,continuousDataModel:o},u)),n.intercept("zoom",Ih({viewCache:i})))}),[t,n,i])})({chart:t,models:n,viewState:a,viewCache:s}),(({picasso:e,chart:t,models:r,environment:n,viewState:o,viewCache:a,actions:s})=>{const[,l]=i((async()=>{if(null==t||!t.update||!r||!n)return;const{layoutService:i,colorService:l,discreteModel:u}=r;function c(i=!1){t.update({settings:Ah({picasso:e,chart:t,models:r,environment:n,viewState:o,viewCache:a,actions:s}),data:i&&[Dh({models:r}),...Nh({models:r}),...l.getData()]})}const d=i.getDataPages();i.setDataPages([]),c(!0),i.setDataPages(d),i.meta.isContinuous||await u.command.initialize(),c(!1)}),[null==t?void 0:t.update,r,n]);if(l)throw l})({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l})};function Rh(){return(Rh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var kh={exports:{}};function Ph(){}function jh(){}jh.resetWarningCache=Ph;kh.exports=function(){function e(e,t,r,n,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:jh,resetWarningCache:Ph};return r.PropTypes=r,r}();var Fh=kh.exports;function Vh(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function _h({d:e,size:t,style:r={},viewBox:n="0 0 16 16"}){const i={fontSize:Vh(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...r};return q.createElement("i",{style:i},q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:n,fill:"currentColor"},q.createElement("path",{d:e})))}const Bh={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},Hh={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},$h="M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z",zh={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},Uh={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function Yh(e,t,r){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:r}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(r,"qHyperCubeDef.");let n=Qi.generate(t,r);n&&n.length&&(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(n,!0))}))}function Wh(e,t,r,n,i,o){e.getEffectiveProperties().then((a=>{const s=U(!0,{},a),l=s.qHyperCubeDef[n][t],u=s.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[n][r];u.qAttributeDimensions=l.qAttributeDimensions,l.qAttributeDimensions=[],o||(u.qAttributeExpressions=l.qAttributeExpressions,l.qAttributeExpressions=[]),s.qHyperCubeDef[n][t]=u,s.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[n][r]=l,i&&i({oldItem:l,newItem:u,oldProperties:a,newProperties:s,model:e}),Yh(e,a,s)}))}function Gh({dir:e,dock:t,altList:r,model:n,translator:i,app:o,onChange:a}){return 0===r.length?null:{dir:e,dock:t,getAlternatives(){const e=r.map((e=>function(e,t,r){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:r.get("Object.ErrorMessage.MissingDimension")));const n=e.qDef.qLabelExpression;if(n)return t.evaluate(n);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t})))));return Promise.all(e)},changeTo(e,t){Wh(n,e,t,"qDimensions",a)}}}function Kh(e,t,r,n="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){r.drillUp(n,t,e)}};var i}function Xh({altList:e,app:t,dir:r,dock:n,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:r,dock:n,getAlternatives(){const r=e.map((e=>function(e,t,r){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:r.get("Object.ErrorMessage.MissingMeasure")));const n=e.qDef.qLabelExpression;if(n)return t.evaluate(n);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t})))));return Promise.all(r)},changeTo(e,t){Wh(i,e,t,"qMeasures",o,a)}}}function Jh(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle}}const Zh={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},Qh=({children:e,...t})=>q.createElement(O,Rh({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e);function ey(){function e({title:e,selected:t,onClick:r}){const n=he.detectTextDirection(e);return q.createElement(N,{button:!0,onClick:r,style:{textAlign:"start"}},q.createElement(I,{style:{minWidth:32}},q.createElement(_h,{d:t?$h:""})),q.createElement(T,{primaryTypographyProps:{dir:n}},e))}function t({alignTo:t,changeTo:r,current:n,dir:i,dock:o,list:a,onClose:s,show:l}){const u=a.map(((t,n)=>q.createElement(e,{key:t.id,title:t.title,onClick:()=>r(n)})));return q.createElement(A,Rh({anchorEl:t,open:l,onClose:s},Zh[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),q.createElement(D,{dense:!0,dir:i,component:"nav"},q.createElement(e,{title:n,selected:!0,onClick:s}),u))}e.propTypes={title:Fh.string.isRequired,selected:Fh.bool,onClick:Fh.func.isRequired},e.defaultProps={selected:!1},t.propTypes={alignTo:Fh.any,changeTo:Fh.func.isRequired,current:Fh.string.isRequired,dir:Fh.string.isRequired,dock:Fh.string.isRequired,list:Fh.array,onClose:Fh.func.isRequired,show:Fh.bool.isRequired},t.defaultProps={list:[],alignTo:null};class r extends q.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive()},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=q.createRef()}componentDidMount(){const{selections:e}=this.props;e&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),e.addListener("activated",this.onSelectionsActivated),e.addListener("deactivated",this.onSelectionsDeactivated),e.addListener("canceled",this.onSelectionsDeactivated))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.index,e),this.closePopover()}openPopover(){this.state.closeTime&&Date.now()-this.state.closeTime<20||this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e})}))}closePopover(){this.setState({open:!1,closeTime:Date.now()})}render(){const{titleData:e,popover:r,translator:n,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l}=this.props,u={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",...this.props.style},c=e.breadcrumbs.length,d=i||this.state.inSelection,m=e.breadcrumbs.map(((t,r)=>q.createElement(Qh,{style:{display:"flex",alignItems:"center",color:d&&"rgba(89, 89, 89, 0.8)",pointerEvents:d?"none":"auto"},key:r,onClick:()=>d?void 0:e.drillUp(c-r),title:t},q.createElement("span",{style:u},t),q.createElement(_h,Rh({},Uh,{size:"small",style:{margin:"0 8px"}}))))),f=r&&!this.state.open?this.openPopover:this.closePopover,p=!r||i||this.state.inSelection,h={display:"flex",alignItems:"center",width:"100%",color:p&&"rgba(89, 89, 89, 0.8)",height:!o&&p&&"20px",lineHeight:!o&&p&&"20px",border:!o&&p&&"none"};this.state.open&&(h.background="rgba(0,0,0,0.08)");a&&(h.padding=a),s&&(h.minWidth=s);const y=he.detectTextDirection(e.text),g=q.createElement(Qh,{style:h,onClick:p?void 0:f,title:e.text,tabIndex:p?-1:0,onFocus:p?void 0:e=>{this.state.closeTime&&Date.now()-this.state.closeTime<20||(e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px")},onBlur:p?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()}},e.locked&&q.createElement(_h,Rh({},Hh,{size:"small",title:n.get("Tooltip.selections.locked")})),q.createElement("span",{style:u,dir:y},e.text),r&&q.createElement(_h,Rh({},zh,{size:"small",style:{margin:"0 8px"}})));return q.createElement(q.Fragment,null,e.drilldown&&q.createElement(_h,Rh({},Bh,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),m,q.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:l?"auto":"none"}},g),r&&q.createElement(t,{dock:r.dock,dir:r.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo}))}}function n(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function i(e){return!e.isDimension&&te(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return r.propTypes={disabled:Fh.bool.isRequired,padding:Fh.string,minWidth:Fh.string,titleData:Fh.shape({breadcrumbs:Fh.arrayOf(Fh.string).isRequired,drilldown:Fh.bool.isRequired,index:Fh.number.isRequired,locked:Fh.bool.isRequired,text:Fh.string.isRequired,popoverText:Fh.string.isRequired,drillUp:Fh.func}).isRequired,popover:Fh.shape({dir:Fh.string.isRequired,dock:Fh.string.isRequired,changeTo:Fh.func.isRequired,getAlternatives:Fh.func.isRequired}),translator:Fh.shape({get:Fh.func.isRequired}).isRequired,selections:Fh.shape({isActive:Fh.func,addListener:Fh.func,removeListener:Fh.func}),style:Fh.shape({fontSize:Fh.string,color:Fh.string,fontFamily:Fh.string}).isRequired,isDimension:Fh.bool.isRequired,hasAlternative:Fh.bool.isRequired},r.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){return this.settings.settings.isDimension||i(this.settings.settings)?28:20},render(){const{settings:{app:e,disabled:t,explicitItemInfos:o,hyperCube:a,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:m,rtl:f,selections:p,skipAttributeExpressions:h,translator:y},layout:{dock:g}}=this.settings,v="top"!==g&&"bottom"!==g||!f?"ltr":"rtl",b=function(e,t){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center"};return"left"===e?(r.width=t.height+"px",r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left"):"right"===e&&(r.width=t.height+"px",r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left"),r}(g,this.rect),x=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,M=x&&x[l?"qDimensions":"qMeasures"]||[],S=o||a[l?"qDimensionInfo":"qMeasureInfo"],E=l?Gh:Xh,C=l?Kh:Jh,O=c&&c.colorSupport&&c.modifiers&&E({altList:M,app:e,dir:f?"rtl":"ltr",dock:n(g),model:c,onChange:d,skipAttributeExpressions:h,translator:y}),A=(D=this.settings.settings).isDimension&&te(D,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||i(this.settings.settings);var D;const N=S.map(((e,n)=>{const i="number"==typeof e.explicitColumn?e.explicitColumn:n,o=C(e,i,c),a=n===S.length-1;return q.createElement(q.Fragment,{key:e.cId},q.createElement(r,{popover:O,titleData:o,model:c,translator:y,selections:p,disabled:t(),style:this.style,isDimension:l,padding:m,minWidth:u,hasAlternative:A}),!a&&q.createElement("span",null,", "))}));return q.createElement("div",{style:b,dir:v},N)}}}function ty(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e<t?t:e>r?r:e}function ry(e){if(e.type)return e;if("#"===e.charAt(0))return ry(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length/3,"}"),"g"),r=e.match(t);return r&&1===r[0].length&&(r=r.map((function(e){return e+e}))),r?"rgb(".concat(r.map((function(e){return parseInt(e,16)})).join(", "),")"):""}(e));var t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(r))throw new Error(["Material-UI: unsupported `".concat(e,"` color."),"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()."].join("\n"));var n=e.substring(t+1,e.length-1).split(",");return{type:r,values:n=n.map((function(e){return parseFloat(e)}))}}function ny(e){var t=e.type,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),"".concat(t,"(").concat(r.join(", "),")")}function iy(e){var t="hsl"===(e=ry(e)).type?ry(function(e){var t=(e=ry(e)).values,r=t[0],n=t[1]/100,i=t[2]/100,o=n*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),ny({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function oy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ay(){return(ay=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function sy(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ly(){return(ly=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function uy(e){return(uy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cy(e){return(cy="function"==typeof Symbol&&"symbol"===uy(Symbol.iterator)?function(e){return uy(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":uy(e)})(e)}function dy(e){return e&&"object"===cy(e)&&!Array.isArray(e)}function my(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},n=r.clone?ly({},e):e;return dy(e)&&dy(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(dy(t[i])&&i in e?n[i]=my(e[i],t[i],r):n[i]=t[i])})),n}var fy=["xs","sm","md","lg","xl"];function py(e){var t=e.values,r=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,n=e.unit,i=void 0===n?"px":n,o=e.step,a=void 0===o?5:o,s=sy(e,["values","unit","step"]);function l(e){var t="number"==typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var n=fy.indexOf(t)+1;return n===fy.length?l(e):"@media (min-width:".concat(r[e]).concat(i,") and ")+"(max-width:".concat(r[fy[n]]-a/100).concat(i,")")}return ay({keys:fy,values:r,up:l,down:function(e){var t=fy.indexOf(e)+1,n=r[fy[t]];return t===fy.length?l("xs"):"@media (max-width:".concat(("number"==typeof n&&t>0?n:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return r[e]}},s)}function hy(e,t,r){var n;return ay({gutters:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ay({paddingLeft:t(2),paddingRight:t(2)},r,oy({},e.up("sm"),ay({paddingLeft:t(3),paddingRight:t(3)},r[e.up("sm")])))},toolbar:(n={minHeight:56},oy(n,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),oy(n,e.up("sm"),{minHeight:64}),n)},r)}var yy={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},gy={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},vy={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"},by={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},xy={black:"#000",white:"#fff"},My={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:xy.white,default:vy[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)"}},Sy={text:{primary:xy.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:vy[800],default:"#303030"},action:{active:xy.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 Ey(e,t,r,n){e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=function(e,t){if(e=ry(e),t=ty(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;return ny(e)}(e.main,n):"dark"===t&&(e.dark=function(e,t){if(e=ry(e),t=ty(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]*=1-t;return ny(e)}(e.main,1.5*n)))}function Cy(e){var t=e.primary,r=void 0===t?{light:yy[300],main:yy[500],dark:yy[700]}:t,n=e.secondary,i=void 0===n?{light:gy.A200,main:gy.A400,dark:gy.A700}:n,o=e.error,a=void 0===o?{light:by[300],main:by[500],dark:by[700]}:o,s=e.type,l=void 0===s?"light":s,u=e.contrastThreshold,c=void 0===u?3:u,d=e.tonalOffset,m=void 0===d?.2:d,f=sy(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function p(e){return function(e,t){var r=iy(e),n=iy(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,Sy.text.primary)>=c?Sy.text.primary:My.text.primary}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(e=ay({},e)).main&&e[t]&&(e.main=e[t]),Ey(e,"light",r,m),Ey(e,"dark",n,m),e.contrastText||(e.contrastText=p(e.main)),e}var y={dark:Sy,light:My};return my(ay({common:xy,type:l,primary:h(r),secondary:h(i,"A400","A200","A700"),error:h(a),grey:vy,contrastThreshold:c,getContrastText:p,augmentColor:h,tonalOffset:m},y[l]),f,{clone:!1})}function qy(e){return Math.round(1e5*e)/1e5}var Oy={textTransform:"uppercase"};function Ay(e,t){var r="function"==typeof t?t(e):t,n=r.fontFamily,i=void 0===n?'"Roboto", "Helvetica", "Arial", sans-serif':n,o=r.fontSize,a=void 0===o?14:o,s=r.fontWeightLight,l=void 0===s?300:s,u=r.fontWeightRegular,c=void 0===u?400:u,d=r.fontWeightMedium,m=void 0===d?500:d,f=r.fontWeightBold,p=void 0===f?700:f,h=r.htmlFontSize,y=void 0===h?16:h,g=r.allVariants,v=r.pxToRem,b=sy(r,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,M=v||function(e){return"".concat(e/y*x,"rem")},S=function(e,t,r,n,o){return ay({fontFamily:i,fontWeight:e,fontSize:M(t),lineHeight:r},'"Roboto", "Helvetica", "Arial", sans-serif'===i?{letterSpacing:"".concat(qy(n/t),"em")}:{},{},o,{},g)},E={h1:S(l,96,1,-1.5),h2:S(l,60,1,-.5),h3:S(c,48,1.04,0),h4:S(c,34,1.17,.25),h5:S(c,24,1.33,0),h6:S(m,20,1.6,.15),subtitle1:S(c,16,1.75,.15),subtitle2:S(m,14,1.57,.1),body1:S(c,16,1.5,.15),body2:S(c,14,1.43,.15),button:S(m,14,1.75,.4,Oy),caption:S(c,12,1.66,.4),overline:S(c,12,2.66,1,Oy)};return my(ay({htmlFontSize:y,pxToRem:M,round:qy,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:m,fontWeightBold:p},E),b,{clone:!1})}function Dy(){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 Ny=["none",Dy(0,2,1,-1,0,1,1,0,0,1,3,0),Dy(0,3,1,-2,0,2,2,0,0,1,5,0),Dy(0,3,3,-2,0,3,4,0,0,1,8,0),Dy(0,2,4,-1,0,4,5,0,0,1,10,0),Dy(0,3,5,-1,0,5,8,0,0,1,14,0),Dy(0,3,5,-1,0,6,10,0,0,1,18,0),Dy(0,4,5,-2,0,7,10,1,0,2,16,1),Dy(0,5,5,-3,0,8,10,1,0,3,14,2),Dy(0,5,6,-3,0,9,12,1,0,3,16,2),Dy(0,6,6,-3,0,10,14,1,0,4,18,3),Dy(0,6,7,-4,0,11,15,1,0,4,20,3),Dy(0,7,8,-4,0,12,17,2,0,5,22,4),Dy(0,7,8,-4,0,13,19,2,0,5,24,4),Dy(0,7,9,-4,0,14,21,2,0,5,26,4),Dy(0,8,9,-5,0,15,22,2,0,6,28,5),Dy(0,8,10,-5,0,16,24,2,0,6,30,5),Dy(0,8,11,-5,0,17,26,2,0,6,32,5),Dy(0,9,11,-5,0,18,28,2,0,7,34,6),Dy(0,9,12,-6,0,19,29,2,0,7,36,6),Dy(0,10,13,-6,0,20,31,3,0,8,38,7),Dy(0,10,13,-6,0,21,33,3,0,8,40,7),Dy(0,10,14,-6,0,22,35,3,0,8,42,7),Dy(0,11,14,-7,0,23,36,3,0,9,44,8),Dy(0,11,15,-7,0,24,38,3,0,9,46,8)],Iy={borderRadius:4};function Ty(){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 r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return 0===r.length?e(1):1===r.length?e(r[0]):r.map((function(t){var r=e(t);return"number"==typeof r?"".concat(r,"px"):r})).join(" ")};return Object.defineProperty(r,"unit",{get:function(){return t}}),r.mui=!0,r}var wy={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)"},Ly={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195},Ry=function(e){return"".concat(Math.round(e),"ms")},ky={easing:wy,duration:Ly,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.duration,n=void 0===r?Ly.standard:r,i=t.easing,o=void 0===i?wy.easeInOut:i,a=t.delay,s=void 0===a?0:a;return sy(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof n?n:Ry(n)," ").concat(o," ").concat("string"==typeof s?s:Ry(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))}},Py={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};const jy=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,r=void 0===t?{}:t,n=e.mixins,i=void 0===n?{}:n,o=e.palette,a=void 0===o?{}:o,s=e.shadows,l=e.spacing,u=e.typography,c=void 0===u?{}:u,d=sy(e,["breakpoints","mixins","palette","shadows","spacing","typography"]),m=Cy(a),f=py(r),p=Ty(l),h=ay({breakpoints:f,direction:"ltr",mixins:hy(f,p,i),overrides:{},palette:m,props:{},shadows:s||Ny,typography:Ay(m,c),spacing:p},my({shape:Iy,transitions:ky,zIndex:Py},d));return h}({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:'"QlikView Sans", "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 Fy=L({productionPrefix:"q699e",disableGlobal:!0,seed:""});function Vy(){function e({x:e,y:t,width:r,height:n,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(r)?a.width:r,a.height=Number.isNaN(n)?a.height:n,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:r=document.createElement.bind(document)}=t;let n,i=e();const o={element:()=>n,root:()=>n,appendTo:e=>(n||(n=r("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),render(e){if(!n)return!1;const t=i.scaleRatio.x,r=i.scaleRatio.y;return n.style.left=Math.round(i.margin.left+i.x*t)+"px",n.style.top=Math.round(i.margin.top+i.y*r)+"px",n.style.width=Math.round(i.width)+"px",n.style.height=Math.round(i.height)+"px",n.style.transform=`scale(${t}, ${r})`,n.style.transformOrigin="top left",w.render(function(e,t){return q.createElement(R,{generateClassName:t},q.createElement(k,{theme:jy},e))}(e,Fy),n),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(n&&w.unmountComponentAtNode(n),o),destroy(){n&&n.parentElement&&(w.unmountComponentAtNode(n),n.parentElement.removeChild(n)),n=null},size:t=>(t&&(i=e(t)),i)};return o}}function _y(){return function(e){e.renderer("react",Vy()),e.component("data-title",ey()),e.component("disclaimer",function(){class e extends q.Component{render(){const{label:e,spanStyle:t}=this.props;return q.createElement(q.Fragment,null,q.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:Fh.string.isRequired,spanStyle:Fh.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:r},layout:{dock:n}}=this.settings,i="top"!==n&&"bottom"!==n||!r?"ltr":"rtl",o=function(e,t){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":r.width=t.height+"px",r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=t.height+"px",r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left";break;case"center":r.width=t.width+"px",r.height=t.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}(n,this.rect),a="center"===n?t:"* "+t,s="center"!==n?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return q.createElement("div",{style:o,dir:i},q.createElement(q.Fragment,null,q.createElement(e,{label:a,spanStyle:s})))}}}())}}function By(e,t,r,n){const i=function(t){const r=String(t);return e(r)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,n?r-1:0]),a=i([t.data.value,n?0:r-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(n){const i=e.pxScale(n);return i===e?this:By(i,t,r)},i}function Hy(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},r={},n={}){const i=t(e,r,n),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),By(i,a,l,e.invert)}))}const $y={getDefaultSettings:({size:e=10,fill:t="#999",alignment:r}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:r}),createOob({oob:e,dockValue:t,boxCenter:r,rendWidth:n,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=n,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=n,d=t<.5?180:0),a(U({},e,{[s]:r*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function zy({i:e,width:t,height:r,resolved:n,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==n.major.settings.binStart?(l=n.major.items[e].binStart,u=n.major.items[e].binEnd,s=n.major.settings.binStart.scale):(s=n.major.settings.major.scale,l=s?n.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=U({},{major:l,majorEnd:u},n.minor.items[e]);i.forEach((t=>{d[t]=n[t].items[e]}));const m=o?r:t,f=function({bandwidth:e,width:t,minWidthPx:r,maxWidthPx:n,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(n))?i:n/i);return a=Number.isNaN(Number(r))?a:Math.max(r/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),p=(c-f)/2,h=p+d.major+f/2;return{item:d,boxCenter:h,boxWidth:f,boxPadding:p,rendWidth:t,rendHeight:r}}function Uy({keys:e,data:t,defaultSettings:r,style:n,settings:i,width:o,height:a,resolver:s}){const l=U(!0,{},r||{},n||{}),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:U(!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:U(!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 m=i.minor||{};let f;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:U(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let r=0,n=e.length;r<n;r++)f=e[r],p[f]=s.resolve({data:t,defaults:l[f],settings:i[f],scaled:u});return p}const Yy=["oob"];const Wy={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:r}=this.settings.settings,n="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=Uy({keys:Yy,data:i,defaultSettings:{oob:$y.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:r,resolved:n,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=zy}){const l=[],{items:u}=n.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:f,rendHeight:p}=s({i:c,width:e,height:t,resolved:n,keys:i,flipXY:r,calcKey:"oob"}),h=u[c].data,y=[];if(d.oob.show){y.push($y.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:f,rendHeight:p,flipXY:r,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:y};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:n,resolved:l,keys:Yy,symbol:s,dockValue:r})}},Gy={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Ky=["hat"];function Xy(e,t=!0){let r="";for(let t=0;t<e.length;t++){const n=e[t];r+=0===t?`M${n.x} ${n.y}`:`L${n.x} ${n.y}`,r+=" "}return t&&(r+="Z"),r}function Jy({item:e,boxWidth:t,boxPadding:r,rendWidth:n,rendHeight:i,flipXY:o}){let a="x",s="y",l=n,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=n,c=1-c);const d=(r+e.major)*l;let m=[{[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 f=U({},e.hat,{type:"path",d:Xy(m)});m=[{[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[f,U({},e.hat,{type:"path",d:Xy(m)})]}const Zy={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,r="horizontal"===this.settings.settings.orientation,{data:n,style:i,resolver:o}=this,a=Uy({keys:Ky,data:n,defaultSettings:Gy,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a;return function({width:e,height:t,flipXY:r,resolved:n,keys:i,_calcItemRenderingOpts:o=zy}){const a=[],{items:s}=n.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f}=o({i:l,width:e,height:t,resolved:n,keys:i,flipXY:r,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...Jy({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f,flipXY:r}));const y={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(y)}return a}({items:l,settings:s,width:e,height:t,flipXY:r,resolved:a,keys:Ky})}};var Qy="unclassified",eg="equal-equal",tg="equal-higher",rg="equal-lower",ng="equal-void",ig="higher-equal",og="higher-higher-acute",ag="higher-higher-obtuse",sg="higher-lower-negative",lg="higher-lower-positive",ug="higher-void",cg="lower-equal",dg="lower-higher-negative",mg="lower-higher-positive",fg="lower-lower-acute",pg="lower-lower-obtuse",hg="lower-void",yg="void-equal",gg="void-higher",vg="void-lower",bg="void-void";function xg(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function Mg(e,t,r){const n=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.sqrt((t.x-r.x)**2+(t.y-r.y)**2),o=Math.sqrt((r.x-e.x)**2+(r.y-e.y)**2);return Math.acos((i*i+n*n-o*o)/(2*i*n))*(180/Math.PI)}function Sg({previous:e,current:t,next:r}){const n=e&&e.value,i=t&&t.value,o=r&&r.value;return e||r?e?r?n===i?i===o?eg:i<o?tg:rg:i===o?n>i?ig:cg:n>i?i<o?Mg(e,t,r)>90?ag:og:xg(e,t)>xg(e,r)?lg:sg:i>o?Mg(e,t,r)>90?pg:fg:xg(e,t)>xg(e,r)?mg:dg:n===i?ng:n>i?ug:hg:i===o?yg:i<o?gg:vg:bg}function Eg({bounds:e,size:t}){const{x:r,y:n,width:i,height:o}=e,{insideStrategy:a}=t;return"center"===a?Math.floor(r+i/2)>=0&&Math.ceil(r+i/2)<=t.width&&Math.floor(n+o/2)>=0&&Math.ceil(n+o/2)<=t.height:Math.floor(r+i)>0&&Math.ceil(r)<t.width&&Math.floor(n+o/2)>=0&&Math.ceil(n+o/2)<=t.height}const Cg=1,qg=0;function Og({node:e,line:t,groupIndex:r,extract:n,style:i,measureText:o,size:a,horizontal:s,rtl:l,meta:u,showLabel:c}){const d=n.label(e.data);if("string"!=typeof d&&"number"!=typeof d||""===d)return!1;const m=o({fontFamily:i.fontFamily,fontSize:i.fontSize,text:d}),{localBounds:f}=e,{"stroke-width":p}=e.attrs,h=n.pointValue(e.data),y={x:f.x+f.width/2,y:f.y+f.height/2,width:m.width+2*Cg,height:m.height+2*qg},g=`${y.x}-${y.y}`,v=!s&&!l,b=s?a.height:a.width,x=(s?y.y:y.x)/b,M=(v?1-x:x)<=(b<=200?.25:.1),S={key:g,node:e,line:t,group:r,value:h,labelMeasurements:m,bounds:y,inside:Eg({bounds:f,size:a}),border:p?p/2:0,classification:Qy,setClassification(e){S.classification=e},preferences:[],setPreferences(e){S.preferences.push(...e)},placement:void 0,setPlacement(e){S.placement=e},duplicate:!1,setDuplicate(){S.duplicate=!0},extreme:u.getExtreme(g),elite:M,show:c(e)};return S}function Ag({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}){const l=function({nodes:e}){const t={top:[],right:[],bottom:[],left:[]},r=e.map((e=>{const{localBounds:t}=e,r={x:t.x+t.width/2,y:t.y+t.height/2};return{key:`${r.x}-${r.y}`,center:r}})),n=r.reduce(((e,t)=>((!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e)),{});return t.top=r.filter((e=>e.center.y===n.top.center.y)).map((e=>e.key)),t.right=r.filter((e=>e.center.x===n.right.center.x)).map((e=>e.key)),t.bottom=r.filter((e=>e.center.y===n.bottom.center.y)).map((e=>e.key)),t.left=r.filter((e=>e.center.x===n.left.center.x)).map((e=>e.key)),{getExtrema:e=>({top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}),getExtreme:e=>{const{top:r,right:n,bottom:i,left:o}=t;return[r,n,i,o].some((t=>-1!==t.indexOf(e)))}}}({nodes:e});return function({nodes:e,by:t,lineIndex:r}){const n=e.reduce(((e,n,i)=>{const o=t(n.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:n,line:n.data[r].value}),e}),{});return Object.keys(n).map((e=>n[e])).sort(((e,t)=>e.index-t.index)).map((e=>e.items))}({nodes:e,by:t.majorValue,lineIndex:t.lineIndex}).map(((e,u)=>e.map((e=>({line:e.line,item:Og({node:e.node,line:e.line,groupIndex:u,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,meta:l,showLabel:s})}))).filter((e=>e.item)).reduce(((e,t)=>(e[t.line]=t.item,e)),{}))).filter((e=>Object.keys(e).length))}var Dg={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"},Ng={[eg]:[Dg.TOP,Dg.BOTTOM],[tg]:[Dg.BOTTOM,Dg.BOTTOM_RIGHT],[rg]:[Dg.TOP,Dg.TOP_RIGHT],[ng]:[Dg.TOP,Dg.BOTTOM],[ig]:[Dg.LEFT,Dg.BOTTOM_LEFT,Dg.TOP,Dg.TOP_RIGHT],[og]:[Dg.BOTTOM,Dg.BOTTOM_LEFT,Dg.LEFT,Dg.TOP_RIGHT],[ag]:[Dg.BOTTOM,Dg.TOP],[sg]:[Dg.TOP,Dg.TOP_RIGHT,Dg.RIGHT],[lg]:[Dg.BOTTOM,Dg.BOTTOM_LEFT,Dg.LEFT],[ug]:[Dg.TOP],[cg]:[Dg.TOP],[dg]:[Dg.TOP,Dg.TOP_LEFT],[mg]:[Dg.BOTTOM_RIGHT],[fg]:[Dg.TOP,Dg.TOP_LEFT,Dg.LEFT,Dg.TOP_RIGHT,Dg.RIGHT],[pg]:[Dg.TOP,Dg.BOTTOM],[hg]:[Dg.TOP],[yg]:[Dg.TOP],[gg]:[Dg.TOP,Dg.BOTTOM],[vg]:[Dg.TOP,Dg.BOTTOM,Dg.LEFT],[bg]:[Dg.TOP]};function Ig({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}){const l=Ag({nodes:e,extract:t,style:r,measureText:n,size:i,horizontal:o,rtl:a,showLabel:s}),u=[...l.reduce(((e,t)=>(e.push(...Object.keys(t).map((e=>t[e]))),e)),[])],[c]=u,d=function({groups:e,threshold:t}){const r=e.map((e=>Object.keys(e).map((t=>e[t])))),n={};for(let e=0;e<=r.length;e++){const t=r[e];if(t)for(let e=0;e<t.length;e++){const r=t[e],{line:i}=r;n[i]||(n[i]=[]),n[i].push(r.bounds)}}const i=Object.keys(n).map((e=>n[e])),o=[];for(let e=0;e<i.length;e++)for(let r=0;r<i[e].length-1;r++){const n=i[e][r],a=i[e][r+1],s={x1:n.x,y1:n.y,x2:a.x,y2:a.y},l=s.x1-s.x2,u=s.y1-s.y2;Math.sqrt(l*l+u*u)>t&&o.push(s)}return o}({groups:l,threshold:c.node.localBounds.height}),m={getItems:()=>u,getLines:()=>d};return function({groups:e}){for(let t=0;t<e.length;t++){const r=Object.keys(e[t]).map((r=>e[t][r]));for(let n=0;n<r.length;n++){const i=r[n],o=Sg({previous:e[t-1]&&e[t-1][i.line],current:i,next:e[t+1]&&e[t+1][i.line]});i.setClassification(o)}}}({groups:l}),m.getItems().forEach((e=>e.setPreferences(Ng[e.classification]))),m}function Tg({item:e,placement:t,size:r}){return t.x>=0-r.edgeBleed.left&&t.x<=r.width-e.bounds.width+r.edgeBleed.right&&t.y>=0-r.edgeBleed.top&&t.y<=r.height-e.bounds.height}function wg({line1:e,line2:t}){const r=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(0===r)return!1;const n=((t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1))/r,i=((e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1))/r;return n>=0&&n<=1&&i>=0&&i<=1}function Lg({candidate:e,lines:t,rects:r}){return!!r.some((t=>function({rect1:e,rect2:t}){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)}({rect1:t,rect2:e})))||t.some((t=>function({line:e,rect:t}){const r={x:t.x,y:t.y},n={x:t.x+t.width,y:t.y},i={x:t.x+t.width,y:t.y+t.height},o={x:t.x,y:t.y+t.height},a={x1:n.x,y1:n.y,x2:i.x,y2:i.y},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:r.x,y2:r.y};return wg({line1:e,line2:{x1:r.x,y1:r.y,x2:n.x,y2:n.y}})||wg({line1:e,line2:a})||wg({line1:e,line2:s})||wg({line1:e,line2:l})}({line:t,rect:e})))}const Rg={x:0,width:0,y:0,height:0};const kg=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Pg=({item:e})=>({x:e.bounds.x,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),jg=({item:e})=>({x:e.bounds.x+e.node.localBounds.width/2+e.border,y:e.bounds.y-e.bounds.height/2}),Fg=({item:e})=>({x:e.bounds.x,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Vg=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y+e.node.localBounds.height/2+e.border}),_g=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Bg=({item:e})=>({x:e.bounds.x-e.bounds.width-e.node.localBounds.width/2-e.border,y:e.bounds.y-e.bounds.height/2}),Hg=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border});var $g=2.5,zg=4;const Ug=[Dg.TOP,Dg.TOP_LEFT,Dg.TOP_RIGHT],Yg=[Dg.BOTTOM,Dg.BOTTOM_LEFT,Dg.BOTTOM_RIGHT];function Wg({position:e}){const t={x:$g,width:-2*$g,y:0,height:0},r=Ug.indexOf(e)>-1,n=Yg.indexOf(e)>-1;return r&&(t.y=zg,t.height=-zg),n&&(t.height=-zg),t}function Gg({cx:e,cy:t,r:r,degrees:n}){const i=n*(Math.PI/180);return{x:Math.round(e+r*Math.sin(i)),y:Math.round(t+r*-Math.cos(i))}}function Kg({coordinates:e,degrees:t,item:r}){const n={x:e.x,y:e.y};return t<=90?n.y-=r.bounds.height:t>180&&t<=270?n.x-=r.bounds.width:t>270&&(n.y-=r.bounds.height,n.x-=r.bounds.width),n}function Xg({item:e,validator:t,force:r=!1}){const n=function({item:e}){return[e.node.localBounds.height/2*Math.sqrt(2)]}({item:e}),i=e.bounds.x,o=e.bounds.y;for(let a=0;a<n.length;a++){const s=n[a];for(let n=40;n<=180;n+=15){const a=Kg({coordinates:Gg({cx:i,cy:o,r:s,degrees:n}),degrees:n,item:e});if(t({item:e,placement:a,ignoreLines:r}).valid)return a}for(let n=320;n>180;n-=15){const a=Kg({coordinates:Gg({cx:i,cy:o,r:s,degrees:n}),degrees:n,item:e});if(t({item:e,placement:a,ignoreLines:r}).valid)return a}}return!1}function Jg({item:e,validator:t,force:r=!1}){const n=[...e.preferences,...Object.keys(Dg).map((e=>Dg[e])).filter((t=>-1===e.preferences.indexOf(t)))],i={[Dg.TOP]:kg,[Dg.TOP_RIGHT]:Pg,[Dg.RIGHT]:jg,[Dg.BOTTOM_RIGHT]:Fg,[Dg.BOTTOM]:Vg,[Dg.BOTTOM_LEFT]:_g,[Dg.LEFT]:Bg,[Dg.TOP_LEFT]:Hg},o=[];for(let a=0;a<n.length;a++){const s=n[a],l=i[s]({item:e}),u=Wg({position:s}),c=t({item:e,placement:l,adjustment:u,ignoreLines:r});if(r&&c.inside&&o.push(l),c.valid)return l}const a=()=>Xg({item:e,validator:t,force:r});if(r){const e=a();return e||(o[0]||undefined)}return(e.extreme||e.elite)&&a()||undefined}function Zg({model:e,size:t,all:r}){const n={},i=e.getItems(),o=[...i.map((e=>({x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2})))],a=[],s=e.getLines();i.forEach((e=>{const{data:i}=e.node;if(!e.show||!e.inside||i.null&&i.null.value||i.interpolated&&i.interpolated.value)return;const{key:l}=e;if(n[l])return void e.setDuplicate();n[l]=!0;const u=function({size:e,lines:t,placements:r}){return function({item:n,placement:i,adjustment:o=Rg,ignoreLines:a=!1}){const s={inside:Tg({item:n,placement:i,size:e}),collides:!0,valid:!1};return s.inside?(s.collides=Lg({candidate:{x:i.x+o.x,y:i.y+o.y,width:n.bounds.width+o.width,height:n.bounds.height+o.height},lines:a?[]:t,rects:r}),s.valid=!s.collides,s):s}}({size:t,lines:s,placements:o}),c=Jg({item:e,validator:u});c?(c.height=e.bounds.height,c.width=e.bounds.width,o.push(c),e.setPlacement(c)):r&&a.push({item:e,validator:u})})),a.forEach((e=>{const{item:t,validator:r}=e,n=Jg({item:t,validator:r,force:!0});n&&(n.height=t.bounds.height,n.width=t.bounds.width,o.push(n),t.setPlacement(n))}))}var Qg={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,connect:!1,all:!1,label:()=>{},showLabel:()=>!0,pointValue:()=>{},majorValue:()=>{},target:{labelSpace:"label-space-component",point:"point-component",allPoints:[]},lineIndex:"line",insideStrategy:"edge"},style:{fontFamily:"QlikView Sans, sans-serif",fontSize:"12px",fill:"#333"}},preferredSize(){const e={edgeBleed:{top:0,right:0,left:0}},t=this.chart.component(this.settings.settings.target.labelSpace);if(!t||!t.rect)return e;const{orientation:r,rtl:n}=this.settings.settings,i="horizontal"===r;if(t.show(n)){const{size:r}=t.settings.settings;e.edgeBleed.top=i?r:0,e.edgeBleed[n?"left":"right"]=i?0:r}return e},render(){if(!this.chart.component(this.settings.settings.target.point))return[];const{allPoints:e}=this.settings.settings.target,t=e.length?e=>this.settings.settings.target.allPoints.includes(e.key):e=>e.key===this.settings.settings.target.point,r=this.chart.findShapes("circle").filter(t);if(!r.length)return[];const{settings:n}=this.settings,i="horizontal"===n.orientation,o=i?"x":"y";r.sort(((e,t)=>e.localBounds[o]-t.localBounds[o]));const a={label:n.label,pointValue:n.pointValue,majorValue:n.majorValue,lineIndex:n.lineIndex},{height:s,width:l,edgeBleed:u}=this.rect,c={height:s,width:l,edgeBleed:u,insideStrategy:n.insideStrategy},{style:d}=this,m=Ig({nodes:r,extract:a,style:d,measureText:this.renderer.measureText,size:c,horizontal:i,rtl:n.rtl,showLabel:n.showLabel});return function({model:e}){e.getItems().sort(((e,t)=>e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1))}({model:m}),Zg({model:m,size:c,all:n.all}),m.getItems().filter((e=>e.placement&&e.node.key===this.settings.settings.target.point)).map((e=>({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2,fontSize:d.fontSize,fontFamily:d.fontFamily,fill:d.fill,text:a.label(e.node.data),baseline:"central",anchor:"middle"})))}},ev={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};var tv={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",primaryExtremum:()=>{},secondaryExtremum:()=>{},primarySeries:[],secondarySeries:[],orientation:"horizontal",rtl:!1,major:{scale:"major-scale"},markerOffset:1,size:10},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e=[]}=this.data;if(!e.length)return[];const{type:t,orientation:r,rtl:n,markerOffset:i,size:o,major:a,primarySeries:s,secondarySeries:l}=this.settings.settings,u=this.settings.settings.primaryExtremum(),c=this.settings.settings.secondaryExtremum(),d=s.length&&void 0!==u,m=l.length&&void 0!==c;if(!d&&!m)return[];const f=s.map((e=>e.ref)),p=l.map((e=>e.ref)),h=function({type:e,primaryExtremum:t,secondaryExtremum:r,primaryItems:n=[],secondaryItems:i=[],primarySeries:o=[],secondarySeries:a=[]}){const s=[];return[...o,...a].forEach((o=>{const a=o.isPrimary?t:r,l=o.isPrimary?n:i;s.push((({type:e,extremum:t,separateStacking:r,items:n})=>{const i="max"===e?e=>e>t:e=>e<t,o=r?e=>i(e.point.value<0?e.start.value:e.end.value):e=>i(e.end.value);return n.filter(o)})({type:e,extremum:a,items:l}))})),(({items:e})=>{const t=[],r=[];return e.forEach((e=>{const{value:n}=e.major;t[n]||(t[n]=!0,r.push(e))})),r})({items:s.reduce(((e,t)=>e.concat(t)),[])})}({type:t,primaryExtremum:u,secondaryExtremum:c,primaryItems:e.filter((e=>f.includes(e.end.source.field))),secondaryItems:e.filter((e=>p.includes(e.end.source.field))),primarySeries:s,secondarySeries:l});if(!h.length)return[];const y="horizontal"===r,g=this.rect[y?"width":"height"],v=this.resolver.resolve({data:{items:h},settings:{major:a},scaled:{major:g}}),b=("max"===t?90:-90)-(y?0:90)-(!y&&n?180:0),x=o/2*i,{fill:M}=this.settings.style;return v.items.map((e=>function({symbol:e,size:t,fill:r,startAngle:n,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:r,stroke:"#205891",strokeWidth:0,sides:3,startAngle:n,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:o,fill:M,startAngle:b,x:y?g*e.major:x,y:y?x:g*e.major,data:e.data})))}};function rv({x:e,y:t,size:r,stroke:n,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:n||o,strokeWidth:i,x1:e-r/2,y1:t,x2:e+r/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*r}]}}function nv({chart:e,seriesInfo:t}){const r={primary:{paths:[],map:{}},secondary:{paths:[],map:{}}},n=[...t.primary.map((e=>e.key)),...t.secondary.map((e=>e.key))];return e.findShapes("path").filter((e=>n.some((t=>t===e.key)))).reduce(((e,r)=>((t.primary.some((e=>e.key===r.key))?e.primary:e.secondary).paths.push(r),e)),r),{getLine:(e,t)=>{const n=t?r.primary:r.secondary;if(!n.map[e]){const[t]=n.paths.filter((t=>t.data&&t.data.typeIndex.value===e));n.map[e]=t}return n.map[e]}}}function iv({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function ov({brush:e,chart:t}){const r=e.brush.ranges();if(!r.length)return!1;const n=t&&t.scale(ea.SCALE.MAJOR),i=n&&n.max&&n.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return r.some((t=>t.min<=e&&o(e,t.max)))}}function av({brush:e,selectionInfo:t,items:r,selectionValues:n,colorByData:i,chart:o}){const a=e.brushes();if(!a.length)return[];const s=a[0],{minorRange:l,legendRange:u,legendTap:c}=t,d=0===s.id.indexOf("qHyperCube/qMeasureInfo/")?"qHyperCube/qMeasureInfo/X":s.id;let m=[u?e=>e.color.value:n[d]].filter(Boolean);if(i&&l&&m.push((e=>e.color.value)),!i&&c&&(m=[e=>e.color.value]),!m.length)return[];const f=function({brush:e,chart:t}){return("value"===e.type?iv:ov)({brush:e,chart:t})}({brush:s,chart:o});return f?r.reduce(((e,t,r)=>(m.some((e=>f({value:e(t)})))&&e.push({item:t,index:r}),e)),[]):[]}function sv({chart:e,selected:t,connection:r,gradient:n,fallback:i}){const o=e.scale(ea.SCALE.COLOR),a=t.filter((e=>-1!==r.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e)))||i,offset:Math.min(1,Math.max(0,(e-s)/c))}))),m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:h}}function lv({chart:e,selected:t,connection:r,gradient:n,fallback:i}){const o=e.scale(ea.SCALE.COLOR),a=t.filter((e=>-1!==r.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a)-s,u=0===l?1:l,c=o.domain(),d=[];for(let e=0;e<c.length-1;e++){const t=c[e],r=o(t)||i;d.push({color:r,offset:Math.min(1,Math.max(0,(t-s)/u))});const n=c[e+1];d.push({color:r,offset:Math.min(1,Math.max(0,(n-s)/u))})}const m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:h}}function uv({property:e,chart:t,connection:r,attrs:n,colorSettings:i,colorByData:o,selected:a,hasMultipleMeasures:s,groupedByMeasure:l,itemsPerGroup:u,orientation:c,rtl:d}){const m=n[e];if("gradient"!==m.type)return m;const{type:f,nil:p}=i;if(s||!o)return function({chart:e,selected:t,connection:r,gradient:n,fallback:i,orientation:o,isColorCode:a,groupedByMeasure:s,itemsPerGroup:l,rtl:u}){const c=e.scale(ea.SCALE.MAJOR),d=e.scale(ea.SCALE.COLOR),m=s?e=>c([e,0])+c.bandwidth()*l/2:e=>c(e),f=t.filter((e=>-1!==r.indexOf(e.index))),p=("vertical"===o&&u?f.reverse():f).map((e=>e.item)),h=p.map((e=>m(e.major.value))),y=Math.min(...h),g=Math.max(...h)-y,v=0===g?1:g,b=h.map(((e,t)=>0===t?0:t===h.length-1?1:(e-y)/v)),x=[];for(let e=0;e<p.length;e++){const t=p[e],r=a?t.color.value:d(t.color.value)||i,n=b[e];x.push({color:r,offset:0===e?0:Math.max(0,x[x.length-1].offset)}),x.push({color:r,offset:e===p.length-1?1:Math.max(0,parseFloat((n+(b[e+1]-n)/2).toFixed(5)))})}return{type:"gradient",x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2,stops:x}}({chart:t,selected:a,connection:r,gradient:m,fallback:p,orientation:c,isColorCode:"color"===f,groupedByMeasure:l,itemsPerGroup:u,rtl:d});return("continuous"===f?sv:lv)({chart:t,selected:a,connection:r,gradient:m,fallback:p})}function cv({chart:e,pathModel:t,colorSettings:r,colorByData:n,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:u,selected:c,connections:d,rtl:m,count:f}){const p=t.getLine(l,u),{attrs:h}=p,y=function({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map((e=>{const t=e.substring(0,1),r={letter:t,x:0,y:0,raw:e},n=e.substring(1).split(",");return"M"===t||"L"===t?([r.x]=n,[,r.y]=n):"C"===t&&([,,,,r.x]=n,[,,,,,r.y]=n),r}))}({d:h.d});return d.map((t=>function({chart:e,colorSettings:t,colorByData:r,hasMultipleMeasures:n,groupedByMeasure:i,itemsPerGroup:o,orientation:a,selected:s,connection:l,commands:u,attrs:c,rtl:d,count:m}){return{path:l.map(((e,t)=>{const r=u[e];return 0!==t||"M"===r.letter?r.raw:`M${r.x},${r.y}`})).join(""),attrs:c,stroke:uv({property:"stroke",chart:e,connection:l,attrs:c,selected:s,colorSettings:t,colorByData:r,hasMultipleMeasures:n,groupedByMeasure:i,itemsPerGroup:o,orientation:a,rtl:d,count:m})}}({chart:e,colorSettings:r,colorByData:n,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,selected:c,connection:t,commands:y,attrs:h,rtl:m,count:f})))}function dv({chart:e,pathModel:t,seriesInfo:r,brush:n,selectionInfo:i,items:o,selectionValues:a,colorSettings:s,colorByData:l,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,rtl:f}){const p=function({items:e,seriesInfo:t}){const r=e.reduce(((e,r,n)=>{const i=r.typeIndex.value;var o;return e[i]||(e[i]={key:i,items:[],index:n,measureIx:null===(o=r.colorMeasureIdx)||void 0===o?void 0:o.value,primary:t.primary.some((e=>e.typeIndex===i))}),e[i].items.push(r),e}),{});return Object.keys(r).map((e=>r[e])).sort(((e,t)=>e.index-t.index)).map((e=>({lineKey:e.key,items:e.items,primary:e.primary,measureIx:e.measureIx})))}({items:function({items:e,selectionInfo:t,seriesInfo:r}){return e.filter((e=>{if("NaN"===e.end.value||Number.isNaN(e.end.value))return!1;const{minorRange:n,minorRangePrimary:i}=t;return!n||(i?r.primary:r.secondary).some((t=>t.typeIndex===e.typeIndex.value))}))}({items:o,selectionInfo:i,seriesInfo:r}),seriesInfo:r}),{lines:h}=p.reduce(((r,o)=>{const p=av({brush:n,selectionInfo:i,items:o.items,selectionValues:a,colorByData:l,chart:e});if(p.length<2)return r;const h=function({selected:e}){return e.reduce(((e,t)=>{const{index:r}=t;if(e.length){const t=e[e.length-1];r===t[t.length-1]+1?t.push(r):e.push([r])}else e.push([r]);return e}),[]).filter((e=>e.length>1))}({selected:p});return h.length?(r.lines.push(...cv({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,lineKey:o.lineKey,primary:o.primary,selected:p,connections:h,rtl:f,count:o.items.length})),r):r}),{lines:[]}),y=[];return h.forEach((e=>y.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"}))),y}var mv={require:["chart","renderer"],defaultSettings:{settings:{seriesInfo:{primary:[],secondary:[]},selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,groupedByMeasure:!1,itemsPerGroup:1,orientation:"vertical",rtl:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach((e=>this.state.brush.removeListener(e.type,e.fn))),this.state.listeners.length=0},created(){this.state={pathModel:nv({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),brush:this.chart.brush("selection"),listeners:[],selectionInfo:{minorRange:!1,minorRangePrimary:!1,legendRange:!1,legendTap:!1}}},mounted(){this.addListener("update",(()=>{this.state.selectionInfo=this.settings.settings.getSelectionInfo();const e=dv({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl});this.renderer.render(e)})),this.addListener("end",(()=>{this.renderer.render([])}))},render(){this.state.pathModel=nv({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),this.state.selectionInfo=this.settings.settings.getSelectionInfo();return dv({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl})},destroyed(){this.removeListeners()}};const fv="QlikView Sans, sans-serif";var pv=[["object.comboChart","","fontFamily"],["object.comboChart","outOfRange","color","#999"],["object.comboChart","axis.title","color"],["object.comboChart","axis.title","fontSize","13px"],["object.comboChart","axis.title","fontFamily",fv],["object.comboChart","axis.label.name","color","#595959"],["object.comboChart","axis.label.name","fontSize","12px"],["object.comboChart","axis.label.name","fontFamily",fv],["object.comboChart","axis.line.major","color","#cccccc"],["object.comboChart","axis.line.minor","color","#e6e6e6"],["object.comboChart","label.value","fontFamily",fv],["object.comboChart","label.value","fontSize","12px"],["object.comboChart","label.value","numFontSize","12px",e=>parseInt(e,10)],["object.comboChart","label.value","color","#595959"],[!1,"label.value","lightColor","#E6E6E6"],[!1,"label.value","darkColor","#595959"]];const hv={line:"bar",circle:"circle",diamond:"diamond",triangle:"triangle",rect:"square"},yv=e=>void 0===e.marker?hv.circle:hv[e.marker],gv=e=>void 0===e.markerFill||e.markerFill;function vv({series:e,layoutService:t}){switch(Gf(e)){case ta.MARKER:return(e=>({marker:yv(e),fill:gv(e)}))(e);case ta.LINE:return(e=>{const t=e.getLayoutValue("nullMode","gap");return{showAsGaps:"gap"===t,showAsConnections:"connect"===t,showAsZeros:"zero"===t}})(t);default:return{}}}function bv(e=na,t){return t?e.axis===ra.PRIMARY:e.axis===ra.PRIMARY||Gf(e)===ta.BAR}var xv={exports:{}};var Mv={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var Sv="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=Mv,n=Sv,i=(t=e.exports={}).re=[],o=t.src=[],a=t.t={};let s=0;const l=(e,t,r)=>{const l=s++;n(l,t),a[e]=l,o[l]=t,i[l]=new RegExp(t,r?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION",`(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${o[a.NUMERICIDENTIFIER]}|${o[a.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${o[a.NUMERICIDENTIFIERLOOSE]}|${o[a.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${o[a.PRERELEASEIDENTIFIER]}(?:\\.${o[a.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${o[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[a.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD",`(?:\\+(${o[a.BUILDIDENTIFIER]}(?:\\.${o[a.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${o[a.MAINVERSION]}${o[a.PRERELEASE]}?${o[a.BUILD]}?`),l("FULL",`^${o[a.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${o[a.MAINVERSIONLOOSE]}${o[a.PRERELEASELOOSE]}?${o[a.BUILD]}?`),l("LOOSE",`^${o[a.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",o[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),l("XRANGEIDENTIFIER",o[a.NUMERICIDENTIFIER]+"|x|X|\\*"),l("XRANGEPLAIN",`[v=\\s]*(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:${o[a.PRERELEASE]})?${o[a.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:${o[a.PRERELEASELOOSE]})?${o[a.BUILD]}?)?)?`),l("XRANGE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",o[a.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${o[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${o[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${o[a.LONECARET]}${o[a.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${o[a.LONECARET]}${o[a.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${o[a.GTLT]}\\s*(${o[a.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]}|${o[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${o[a.XRANGEPLAIN]})\\s+-\\s+(${o[a.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${o[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[a.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0.0.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}(xv,xv.exports);const Ev=["includePrerelease","loose","rtl"];var Cv=e=>e?"object"!=typeof e?{loose:!0}:Ev.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const qv=/^[0-9]+$/,Ov=(e,t)=>{const r=qv.test(e),n=qv.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var Av={compareIdentifiers:Ov,rcompareIdentifiers:(e,t)=>Ov(t,e)};const Dv=Sv,{MAX_LENGTH:Nv,MAX_SAFE_INTEGER:Iv}=Mv,{re:Tv,t:wv}=xv.exports,Lv=Cv,{compareIdentifiers:Rv}=Av;class kv{constructor(e,t){if(t=Lv(t),e instanceof kv){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>Nv)throw new TypeError(`version is longer than ${Nv} characters`);Dv("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?Tv[wv.LOOSE]:Tv[wv.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Iv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Iv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Iv||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<Iv)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(e){if(Dv("SemVer.compare",this.version,this.options,e),!(e instanceof kv)){if("string"==typeof e&&e===this.version)return 0;e=new kv(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof kv||(e=new kv(e,this.options)),Rv(this.major,e.major)||Rv(this.minor,e.minor)||Rv(this.patch,e.patch)}comparePre(e){if(e instanceof kv||(e=new kv(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(Dv("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return Rv(r,n)}while(++t)}compareBuild(e){e instanceof kv||(e=new kv(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(Dv("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return Rv(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}var Pv=kv;const{MAX_LENGTH:jv}=Mv,{re:Fv,t:Vv}=xv.exports,_v=Pv,Bv=Cv;var Hv=(e,t)=>{if(t=Bv(t),e instanceof _v)return e;if("string"!=typeof e)return null;if(e.length>jv)return null;if(!(t.loose?Fv[Vv.LOOSE]:Fv[Vv.FULL]).test(e))return null;try{return new _v(e,t)}catch(e){return null}};const $v=Hv;var zv=(e,t)=>{const r=$v(e,t);return r?r.version:null};const Uv=Hv;var Yv=(e,t)=>{const r=Uv(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const Wv=Pv;var Gv=(e,t,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new Wv(e,r).inc(t,n).version}catch(e){return null}};const Kv=Pv;var Xv=(e,t,r)=>new Kv(e,r).compare(new Kv(t,r));const Jv=Xv;var Zv=(e,t,r)=>0===Jv(e,t,r);const Qv=Hv,eb=Zv;var tb=(e,t)=>{if(eb(e,t))return null;{const r=Qv(e),n=Qv(t),i=r.prerelease.length||n.prerelease.length,o=i?"pre":"",a=i?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==n[e])return o+e;return a}};const rb=Pv;var nb=(e,t)=>new rb(e,t).major;const ib=Pv;var ob=(e,t)=>new ib(e,t).minor;const ab=Pv;var sb=(e,t)=>new ab(e,t).patch;const lb=Hv;var ub=(e,t)=>{const r=lb(e,t);return r&&r.prerelease.length?r.prerelease:null};const cb=Xv;var db=(e,t,r)=>cb(t,e,r);const mb=Xv;var fb=(e,t)=>mb(e,t,!0);const pb=Pv;var hb=(e,t,r)=>{const n=new pb(e,r),i=new pb(t,r);return n.compare(i)||n.compareBuild(i)};const yb=hb;var gb=(e,t)=>e.sort(((e,r)=>yb(e,r,t)));const vb=hb;var bb=(e,t)=>e.sort(((e,r)=>vb(r,e,t)));const xb=Xv;var Mb=(e,t,r)=>xb(e,t,r)>0;const Sb=Xv;var Eb=(e,t,r)=>Sb(e,t,r)<0;const Cb=Xv;var qb=(e,t,r)=>0!==Cb(e,t,r);const Ob=Xv;var Ab=(e,t,r)=>Ob(e,t,r)>=0;const Db=Xv;var Nb=(e,t,r)=>Db(e,t,r)<=0;const Ib=Zv,Tb=qb,wb=Mb,Lb=Ab,Rb=Eb,kb=Nb;var Pb=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return Ib(e,r,n);case"!=":return Tb(e,r,n);case">":return wb(e,r,n);case">=":return Lb(e,r,n);case"<":return Rb(e,r,n);case"<=":return kb(e,r,n);default:throw new TypeError("Invalid operator: "+t)}};const jb=Pv,Fb=Hv,{re:Vb,t:_b}=xv.exports;var Bb=(e,t)=>{if(e instanceof jb)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=Vb[_b.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),Vb[_b.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;Vb[_b.COERCERTL].lastIndex=-1}else r=e.match(Vb[_b.COERCE]);return null===r?null:Fb(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)},Hb=$b;function $b(e){var t=this;if(t instanceof $b||(t=new $b),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}function zb(e,t,r){var n=t===e.head?new Wb(r,null,t,e):new Wb(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function Ub(e,t){e.tail=new Wb(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Yb(e,t){e.head=new Wb(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Wb(e,t,r,n){if(!(this instanceof Wb))return new Wb(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}$b.Node=Wb,$b.create=$b,$b.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},$b.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},$b.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},$b.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ub(this,arguments[e]);return this.length},$b.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Yb(this,arguments[e]);return this.length},$b.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},$b.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},$b.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},$b.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},$b.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},$b.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},$b.prototype.map=function(e,t){t=t||this;for(var r=new $b,n=this.head;null!==n;)r.push(e.call(t,n.value,this)),n=n.next;return r},$b.prototype.mapReverse=function(e,t){t=t||this;for(var r=new $b,n=this.tail;null!==n;)r.push(e.call(t,n.value,this)),n=n.prev;return r},$b.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},$b.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},$b.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},$b.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},$b.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new $b;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;for(;null!==i&&n<t;n++,i=i.next)r.push(i.value);return r},$b.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new $b;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;null!==i&&n>t;n--)i=i.prev;for(;null!==i&&n>e;n--,i=i.prev)r.push(i.value);return r},$b.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<r.length;n++)i=zb(this,i,r[n]);return o},$b.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{!function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}($b)}catch(oc){}const Gb=Hb,Kb=Symbol("max"),Xb=Symbol("length"),Jb=Symbol("lengthCalculator"),Zb=Symbol("allowStale"),Qb=Symbol("maxAge"),ex=Symbol("dispose"),tx=Symbol("noDisposeOnSet"),rx=Symbol("lruList"),nx=Symbol("cache"),ix=Symbol("updateAgeOnGet"),ox=()=>1;const ax=(e,t,r)=>{const n=e[nx].get(t);if(n){const t=n.value;if(sx(e,t)){if(ux(e,n),!e[Zb])return}else r&&(e[ix]&&(n.value.now=Date.now()),e[rx].unshiftNode(n));return t.value}},sx=(e,t)=>{if(!t||!t.maxAge&&!e[Qb])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Qb]&&r>e[Qb]},lx=e=>{if(e[Xb]>e[Kb])for(let t=e[rx].tail;e[Xb]>e[Kb]&&null!==t;){const r=t.prev;ux(e,t),t=r}},ux=(e,t)=>{if(t){const r=t.value;e[ex]&&e[ex](r.key,r.value),e[Xb]-=r.length,e[nx].delete(r.key),e[rx].removeNode(t)}};class cx{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const dx=(e,t,r,n)=>{let i=r.value;sx(e,i)&&(ux(e,r),e[Zb]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var mx=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[Kb]=e.max||1/0;const t=e.length||ox;if(this[Jb]="function"!=typeof t?ox:t,this[Zb]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[Qb]=e.maxAge||0,this[ex]=e.dispose,this[tx]=e.noDisposeOnSet||!1,this[ix]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[Kb]=e||1/0,lx(this)}get max(){return this[Kb]}set allowStale(e){this[Zb]=!!e}get allowStale(){return this[Zb]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[Qb]=e,lx(this)}get maxAge(){return this[Qb]}set lengthCalculator(e){"function"!=typeof e&&(e=ox),e!==this[Jb]&&(this[Jb]=e,this[Xb]=0,this[rx].forEach((e=>{e.length=this[Jb](e.value,e.key),this[Xb]+=e.length}))),lx(this)}get lengthCalculator(){return this[Jb]}get length(){return this[Xb]}get itemCount(){return this[rx].length}rforEach(e,t){t=t||this;for(let r=this[rx].tail;null!==r;){const n=r.prev;dx(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[rx].head;null!==r;){const n=r.next;dx(this,e,r,t),r=n}}keys(){return this[rx].toArray().map((e=>e.key))}values(){return this[rx].toArray().map((e=>e.value))}reset(){this[ex]&&this[rx]&&this[rx].length&&this[rx].forEach((e=>this[ex](e.key,e.value))),this[nx]=new Map,this[rx]=new Gb,this[Xb]=0}dump(){return this[rx].map((e=>!sx(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[rx]}set(e,t,r){if((r=r||this[Qb])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,i=this[Jb](t,e);if(this[nx].has(e)){if(i>this[Kb])return ux(this,this[nx].get(e)),!1;const o=this[nx].get(e).value;return this[ex]&&(this[tx]||this[ex](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[Xb]+=i-o.length,o.length=i,this.get(e),lx(this),!0}const o=new cx(e,t,i,n,r);return o.length>this[Kb]?(this[ex]&&this[ex](e,t),!1):(this[Xb]+=o.length,this[rx].unshift(o),this[nx].set(e,this[rx].head),lx(this),!0)}has(e){if(!this[nx].has(e))return!1;const t=this[nx].get(e).value;return!sx(this,t)}get(e){return ax(this,e,!0)}peek(e){return ax(this,e,!1)}pop(){const e=this[rx].tail;return e?(ux(this,e),e.value):null}del(e){ux(this,this[nx].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[nx].forEach(((e,t)=>ax(this,t,!1)))}};class fx{constructor(e,t){if(t=yx(t),e instanceof fx)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new fx(e.raw,t);if(e instanceof gx)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!qx(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&Ox(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=hx.get(t);if(r)return r;const n=this.options.loose,i=n?xx[Mx.HYPHENRANGELOOSE]:xx[Mx.HYPHENRANGE];e=e.replace(i,Fx(this.options.includePrerelease)),vx("hyphen replace",e),e=e.replace(xx[Mx.COMPARATORTRIM],Sx),vx("comparator trim",e,xx[Mx.COMPARATORTRIM]),e=(e=(e=e.replace(xx[Mx.TILDETRIM],Ex)).replace(xx[Mx.CARETTRIM],Cx)).split(/\s+/).join(" ");const o=n?xx[Mx.COMPARATORLOOSE]:xx[Mx.COMPARATOR],a=e.split(" ").map((e=>Dx(e,this.options))).join(" ").split(/\s+/).map((e=>jx(e,this.options))).filter(this.options.loose?e=>!!e.match(o):()=>!0).map((e=>new gx(e,this.options)));a.length;const s=new Map;for(const e of a){if(qx(e))return[e];s.set(e.value,e)}s.size>1&&s.has("")&&s.delete("");const l=[...s.values()];return hx.set(t,l),l}intersects(e,t){if(!(e instanceof fx))throw new TypeError("a Range is required");return this.set.some((r=>Ax(r,t)&&e.set.some((e=>Ax(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new bx(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(Vx(this.set[t],e,this.options))return!0;return!1}}var px=fx;const hx=new mx({max:1e3}),yx=Cv,gx=Hx,vx=Sv,bx=Pv,{re:xx,t:Mx,comparatorTrimReplace:Sx,tildeTrimReplace:Ex,caretTrimReplace:Cx}=xv.exports,qx=e=>"<0.0.0-0"===e.value,Ox=e=>""===e.value,Ax=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},Dx=(e,t)=>(vx("comp",e,t),e=wx(e,t),vx("caret",e),e=Ix(e,t),vx("tildes",e),e=Rx(e,t),vx("xrange",e),e=Px(e,t),vx("stars",e),e),Nx=e=>!e||"x"===e.toLowerCase()||"*"===e,Ix=(e,t)=>e.trim().split(/\s+/).map((e=>Tx(e,t))).join(" "),Tx=(e,t)=>{const r=t.loose?xx[Mx.TILDELOOSE]:xx[Mx.TILDE];return e.replace(r,((t,r,n,i,o)=>{let a;return vx("tilde",e,t,r,n,i,o),Nx(r)?a="":Nx(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Nx(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(vx("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,vx("tilde return",a),a}))},wx=(e,t)=>e.trim().split(/\s+/).map((e=>Lx(e,t))).join(" "),Lx=(e,t)=>{vx("caret",e,t);const r=t.loose?xx[Mx.CARETLOOSE]:xx[Mx.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,a)=>{let s;return vx("caret",e,t,r,i,o,a),Nx(r)?s="":Nx(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:Nx(o)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(vx("replaceCaret pr",a),s="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(vx("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),vx("caret return",s),s}))},Rx=(e,t)=>(vx("replaceXRanges",e,t),e.split(/\s+/).map((e=>kx(e,t))).join(" ")),kx=(e,t)=>{e=e.trim();const r=t.loose?xx[Mx.XRANGELOOSE]:xx[Mx.XRANGE];return e.replace(r,((r,n,i,o,a,s)=>{vx("xRange",e,r,n,i,o,a,s);const l=Nx(i),u=l||Nx(o),c=u||Nx(a),d=c;return"="===n&&d&&(n=""),s=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(s="-0"),r=`${n+i}.${o}.${a}${s}`):u?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:c&&(r=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`),vx("xRange return",r),r}))},Px=(e,t)=>(vx("replaceStars",e,t),e.trim().replace(xx[Mx.STAR],"")),jx=(e,t)=>(vx("replaceGTE0",e,t),e.trim().replace(xx[t.includePrerelease?Mx.GTE0PRE:Mx.GTE0],"")),Fx=e=>(t,r,n,i,o,a,s,l,u,c,d,m,f)=>`${r=Nx(n)?"":Nx(i)?`>=${n}.0.0${e?"-0":""}`:Nx(o)?`>=${n}.${i}.0${e?"-0":""}`:a?">="+r:`>=${r}${e?"-0":""}`} ${l=Nx(u)?"":Nx(c)?`<${+u+1}.0.0-0`:Nx(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:"<="+l}`.trim(),Vx=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(vx(e[r].semver),e[r].semver!==gx.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},_x=Symbol("SemVer ANY");class Bx{static get ANY(){return _x}constructor(e,t){if(t=$x(t),e instanceof Bx){if(e.loose===!!t.loose)return e;e=e.value}Wx("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===_x?this.value="":this.value=this.operator+this.semver.version,Wx("comp",this)}parse(e){const t=this.options.loose?zx[Ux.COMPARATORLOOSE]:zx[Ux.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new Gx(r[2],this.options.loose):this.semver=_x}toString(){return this.value}test(e){if(Wx("Comparator.test",e,this.options.loose),this.semver===_x||e===_x)return!0;if("string"==typeof e)try{e=new Gx(e,this.options)}catch(e){return!1}return Yx(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Bx))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new Kx(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new Kx(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=Yx(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=Yx(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||i&&o||a||s}}var Hx=Bx;const $x=Cv,{re:zx,t:Ux}=xv.exports,Yx=Pb,Wx=Sv,Gx=Pv,Kx=px,Xx=px;var Jx=(e,t,r)=>{try{t=new Xx(t,r)}catch(e){return!1}return t.test(e)};const Zx=px;var Qx=(e,t)=>new Zx(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const eM=Pv,tM=px;var rM=(e,t,r)=>{let n=null,i=null,o=null;try{o=new tM(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new eM(n,r)))})),n};const nM=Pv,iM=px;var oM=(e,t,r)=>{let n=null,i=null,o=null;try{o=new iM(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new nM(n,r)))})),n};const aM=Pv,sM=px,lM=Mb;var uM=(e,t)=>{e=new sM(e,t);let r=new aM("0.0.0");if(e.test(r))return r;if(r=new aM("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let i=null;n.forEach((e=>{const t=new aM(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!lM(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})),!i||r&&!lM(r,i)||(r=i)}return r&&e.test(r)?r:null};const cM=px;var dM=(e,t)=>{try{return new cM(e,t).range||"*"}catch(e){return null}};const mM=Pv,fM=Hx,{ANY:pM}=fM,hM=px,yM=Jx,gM=Mb,vM=Eb,bM=Nb,xM=Ab;var MM=(e,t,r,n)=>{let i,o,a,s,l;switch(e=new mM(e,n),t=new hM(t,n),r){case">":i=gM,o=bM,a=vM,s=">",l=">=";break;case"<":i=vM,o=xM,a=gM,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(yM(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const u=t.set[r];let c=null,d=null;if(u.forEach((e=>{e.semver===pM&&(e=new fM(">=0.0.0")),c=c||e,d=d||e,i(e.semver,c.semver,n)?c=e:a(e.semver,d.semver,n)&&(d=e)})),c.operator===s||c.operator===l)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===l&&a(e,d.semver))return!1}return!0};const SM=MM;var EM=(e,t,r)=>SM(e,t,">",r);const CM=MM;var qM=(e,t,r)=>CM(e,t,"<",r);const OM=px;var AM=(e,t,r)=>(e=new OM(e,r),t=new OM(t,r),e.intersects(t));const DM=Jx,NM=Xv;const IM=px,TM=Hx,{ANY:wM}=TM,LM=Jx,RM=Xv,kM=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===wM){if(1===t.length&&t[0].semver===wM)return!0;e=r.includePrerelease?[new TM(">=0.0.0-0")]:[new TM(">=0.0.0")]}if(1===t.length&&t[0].semver===wM){if(r.includePrerelease)return!0;t=[new TM(">=0.0.0")]}const n=new Set;let i,o,a,s,l,u,c;for(const t of e)">"===t.operator||">="===t.operator?i=PM(i,t,r):"<"===t.operator||"<="===t.operator?o=jM(o,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&o){if(a=RM(i.semver,o.semver,r),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of n){if(i&&!LM(e,String(i),r))return null;if(o&&!LM(e,String(o),r))return null;for(const n of t)if(!LM(e,String(n),r))return!1;return!0}let d=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver,m=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;d&&1===d.prerelease.length&&"<"===o.operator&&0===d.prerelease[0]&&(d=!1);for(const e of t){if(c=c||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),">"===e.operator||">="===e.operator){if(s=PM(i,e,r),s===e&&s!==i)return!1}else if(">="===i.operator&&!LM(i.semver,String(e),r))return!1;if(o)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),"<"===e.operator||"<="===e.operator){if(l=jM(o,e,r),l===e&&l!==o)return!1}else if("<="===o.operator&&!LM(o.semver,String(e),r))return!1;if(!e.operator&&(o||i)&&0!==a)return!1}return!(i&&u&&!o&&0!==a)&&(!(o&&c&&!i&&0!==a)&&(!m&&!d))},PM=(e,t,r)=>{if(!e)return t;const n=RM(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},jM=(e,t,r)=>{if(!e)return t;const n=RM(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var FM=(e,t,r={})=>{if(e===t)return!0;e=new IM(e,r),t=new IM(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=kM(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const VM=xv.exports;var _M={re:VM.re,src:VM.src,tokens:VM.t,SEMVER_SPEC_VERSION:Mv.SEMVER_SPEC_VERSION,SemVer:Pv,compareIdentifiers:Av.compareIdentifiers,rcompareIdentifiers:Av.rcompareIdentifiers,parse:Hv,valid:zv,clean:Yv,inc:Gv,diff:tb,major:nb,minor:ob,patch:sb,prerelease:ub,compare:Xv,rcompare:db,compareLoose:fb,compareBuild:hb,sort:gb,rsort:bb,gt:Mb,lt:Eb,eq:Zv,neq:qb,gte:Ab,lte:Nb,cmp:Pb,coerce:Bb,Comparator:Hx,Range:px,satisfies:Jx,toComparators:Qx,maxSatisfying:rM,minSatisfying:oM,minVersion:uM,validRange:dM,outside:MM,gtr:EM,ltr:qM,intersects:AM,simplifyRange:(e,t,r)=>{const n=[];let i=null,o=null;const a=e.sort(((e,t)=>NM(e,t,r)));for(const e of a){DM(e,t,r)?(o=e,i||(i=e)):(o&&n.push([i,o]),o=null,i=null)}i&&n.push([i,null]);const s=[];for(const[e,t]of n)e===t?s.push(e):t||e!==a[0]?t?e===a[0]?s.push("<="+t):s.push(`${e} - ${t}`):s.push(">="+e):s.push("*");const l=s.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return l.length<u.length?l:t},subset:FM},BM="0.23.1";const HM=e=>!e||_M.lt(_M.coerce(e),_M.coerce(BM)),$M=({layoutService:e,flags:t})=>{const r=t.isEnabled("BARS_IN_SECONDARY_AXIS")&&!HM(e.getLayoutValue("version")),n=e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>{const r={[ta.BAR]:0,[ta.LINE]:0,[ta.MARKER]:0};return({series:n=na},i)=>{const o=bv(n,t),a=Gf(n);return{id:i,type:a,typeIndex:r[a]++,ref:"qMeasureInfo/"+i,refIndex:i,isPrimary:o,scale:o?ea.SCALE.MINOR.PRIMARY:ea.SCALE.MINOR.SECONDARY,collection:o?ea.COLLECTION.PRIMARY:ea.COLLECTION.SECONDARY,options:vv({series:n,layoutService:e})}}})(e,r)),i=(e,t)=>e.filter((e=>Gf(e)===t)).length,o=n.filter((e=>e.isPrimary)),a=n.filter((e=>!e.isPrimary)),s=[!!o.length&&o[0],!!a.length&&a[0]].filter((e=>!!e)),l=i(n,ta.BAR),u=i(o,ta.BAR),c=i(a,ta.BAR),d=e=>n.filter((t=>Gf(t)===e)),m=d(ta.LINE).map((e=>gm(ea.COMPONENT.POINT,e))),f=d(ta.MARKER).map((e=>({key:gm(ea.COMPONENT.MARKER,e),type:e.options.marker}))),p=f.map((e=>e.key)),h=[];u>0&&h.push(`${ea.COMPONENT.BAR}-${ra.PRIMARY}`),c>0&&h.push(`${ea.COMPONENT.BAR}-${ra.SECONDARY}`);const y=[...h,...m,...p],{MINI_CHART:g}=ea.COMPONENT,v=d(ta.LINE).map((e=>gm(g.LINE,e))),b=d(ta.MARKER).map((e=>gm(g.MARKER,e))),x=e.meta.isContinuous?[`${g.BAR}-${ra.PRIMARY}`,`${g.BAR}-${ra.SECONDARY}`,...v,...b]:[];return{meta:{allSeries:n,primarySeries:o,secondarySeries:a,barSeriesCount:l,primaryBarSeriesCount:u,secondaryBarSeriesCount:c,measureAxes:s,pointComponentKeys:m,markerComponentKeys:p,barComponentKeys:h,seriesComponentKeys:y,miniComponentKeys:x,markers:f},query:{all:()=>n,seriesByAxis:e=>e?o:a,series:d,isPrimary:bv}}};function zM(e){return function({layout:t}){var r,n,i;const o=Ol(t,"qHyperCube.qMeasureInfo",[]),a=o.some((({series:e=na})=>Gf(e)===ta.LINE)),s=oe.continuous(t,(()=>a&&ee.isTime(!0,t))),l=e.isEnabled("BARS_IN_SECONDARY_AXIS")&&!HM(Ol(t,"version","")),u=o.filter((({series:e=na})=>Gf(e)===ta.BAR)),c=u.length,d=u.filter((({series:e=na})=>e.axis===ra.PRIMARY)).length,m=u.filter((({series:e=na})=>e.axis===ra.SECONDARY)).length,f=l?d>1||m>1:c>1,p=("grouped"!==Ol(t,"barGrouping.grouping")||s)&&f,h=!p&&c>1,y=l&&p&&(d>0&&m>1||d>1&&m>0),g=!(null==t||null===(r=t.qHyperCube)||void 0===r||null===(n=r.qDimensionInfo)||void 0===n||null===(i=n[0])||void 0===i||!i.qLocked);return{canBeContinuous:ee.canBeContinuous(t),isDiscrete:!s,isContinuous:s,isTime:ee.isTime(s,t),isSnapshot:oe.snapshot(t),isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:y,isGrouped:h||y,isGroupedByMeasure:h||y,isDimensionLocked:g,groupSize:y?2:c,hasLineSeries:a}}}function UM({layoutService:e}){const{dimensionCount:t,measureCount:r}=e.meta;return{qTop:0,qLeft:0,qWidth:t+r,qHeight:Math.min(2e3,1e4/(r+1))}}function YM({genericObjectModel:e,layoutService:t}){return function(){return function(e,t,r){return e.getHyperCubeReducedData(r.path,[r.rect],r.zoomLevel,r.filter).catch(se).then((e=>{var r;const n=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===n&&i.length>1&&(null===(r=e[0])||void 0===r?void 0:r.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,{path:"/qHyperCubeDef",rect:UM({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function WM({genericObjectModel:e,layoutService:t}){const{isSnapshot:r,isContinuous:n}=t.meta;return r?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||e.getHyperCube()})}}({layoutService:t}):n?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):YM({genericObjectModel:e,layoutService:t})}const GM=e=>"number"==typeof e&&!Number.isNaN(e);function KM({isPrimary:e,layoutService:t,seriesModel:r}){return function(){const n=t.getHyperCubeValue("qMeasureInfo"),i=r.query.seriesByAxis(e).map((e=>n[e.refIndex])),o=i.filter((e=>Gf(e.series)===ta.BAR)),a=i.filter((e=>Gf(e.series)===ta.LINE)),s=i.filter((e=>Gf(e.series)===ta.MARKER));return{min:Math.min(...i.filter((e=>GM(e.qMin))).map((e=>e.qMin))),max:Math.max(...i.filter((e=>GM(e.qMax))).map((e=>e.qMax))),bar:{min:Math.min(...o.filter((e=>GM(e.qMin))).map((e=>e.qMin))),max:Math.max(...o.filter((e=>GM(e.qMax))).map((e=>e.qMax)))},line:{min:Math.min(...a.filter((e=>GM(e.qMin))).map((e=>e.qMin))),max:Math.max(...a.filter((e=>GM(e.qMax))).map((e=>e.qMax)))},marker:{min:Math.min(...s.filter((e=>GM(e.qMin))).map((e=>e.qMin))),max:Math.max(...s.filter((e=>GM(e.qMax))).map((e=>e.qMax)))}}}}function XM({isPrimary:e,layoutService:t,seriesModel:r}){const n=KM({isPrimary:e,layoutService:t,seriesModel:r}),i=function({seriesModel:e,isPrimary:t}){return function({dataPage:r}){const n=e.query.series(ta.BAR).filter((e=>e.isPrimary===t)).map((e=>e.refIndex)),{qMatrix:i}=r,o={min:NaN,max:NaN};return i.forEach((e=>{let t=0,r=0;e.slice(1).filter(((e,t)=>n.some((e=>e===t))&&"NaN"!==e.qNum)).forEach((e=>{e.qNum>=0?r+=e.qNum:t+=e.qNum})),o.min=Number.isNaN(o.min)?t:Math.min(t,o.min),o.max=Number.isNaN(o.max)?r:Math.max(r,o.max)})),o}}({seriesModel:r,isPrimary:e});return function({dataPage:e}){const t=n({dataPage:e});return t.bar=i({dataPage:e}),t.min=Math.min(t.bar.min,t.line.min,t.marker.min),t.max=Math.max(t.bar.max,t.line.max,t.marker.max),t}}function JM({isPrimary:e,continuousModel:t,layoutService:r,reducedModel:n,seriesModel:i}){const o={min:NaN,max:NaN,implicit:{min:NaN,max:NaN,bar:{min:NaN,max:NaN},line:{min:NaN,max:NaN},marker:{min:NaN,max:NaN}},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},a=function({isPrimary:e,layoutService:t,seriesModel:r}){const{isBarSeriesStacked:n}=t.meta;return n?XM({isPrimary:e,layoutService:t,seriesModel:r}):KM({isPrimary:e,layoutService:t,seriesModel:r})}({isPrimary:e,layoutService:r,seriesModel:i});return{query:{getExtrema:()=>o},command:{initialize:()=>{const{min:s,max:l}=function({isPrimary:e,layoutService:t}){const r={min:NaN,max:NaN},{getLayoutValue:n}=t,i=n("measureAxes."+(e?0:1),{});if(i.autoMinMax)return r;const{minMax:o,min:a,max:s}=i;return"min"!==o&&"minMax"!==o||(r.min=a),"max"!==o&&"minMax"!==o||(r.max=s),Number.isNaN(r.min)||Number.isNaN(r.max)||(r.min=Math.min(a,s),r.max=Math.max(a,s)),r}({isPrimary:e,layoutService:r});return o.explicit.min=s,o.explicit.max=l,o.meta.hasExplicitMin=!Number.isNaN(s),o.meta.hasExplicitMax=!Number.isNaN(l),o.meta.hasExplicit=o.meta.hasExplicitMin||o.meta.hasExplicitMax,function({continuousModel:e,layoutService:t,reducedModel:r}){const{isDiscrete:n}=t.meta;if(n){const e=r.query.getCube();return Promise.resolve({dataPage:e.qDataPages[0]})}return e.fetchMinMaxData().then((e=>({dataPage:e[0]})))}({continuousModel:t,layoutService:r,reducedModel:n}).then((({dataPage:t})=>{const{min:r,max:n,bar:s,line:l,marker:u}=a({dataPage:t}),c=i.query.seriesByAxis(e).some((e=>Gf(e)===ta.BAR)),d=c?Math.min(r,0):r,m=c?Math.max(n,0):n,f=c?Math.min(s.min,0):s.min,p=c?Math.max(s.max,0):s.max,h=c?Math.min(l.min,0):l.min,y=c?Math.max(l.max,0):l.max,g=c?Math.min(u.min,0):u.min,v=c?Math.max(u.max,0):u.max;o.implicit.min=Number.isFinite(d)?d:0,o.implicit.max=Number.isFinite(m)?m:0,o.implicit.bar.min=Number.isFinite(f)?f:0,o.implicit.bar.max=Number.isFinite(p)?p:0,o.implicit.line.min=Number.isFinite(h)?h:0,o.implicit.line.max=Number.isFinite(y)?y:0,o.implicit.marker.min=Number.isFinite(g)?g:0,o.implicit.marker.max=Number.isFinite(v)?v:0,o.min=Number.isNaN(o.explicit.min)?o.implicit.min:o.explicit.min,o.max=Number.isNaN(o.explicit.max)?o.implicit.max:o.explicit.max,o.meta.hasExplicitMin&&!o.meta.hasExplicitMax&&(o.max=Math.max(o.min,o.max)),o.meta.hasExplicitMax&&!o.meta.hasExplicitMin&&(o.min=Math.min(o.min,o.max)),o.meta.includesZero=!!((0-o.min)*(0-o.max)<=0)}))}}}}function ZM({extrema:e,ticks:t}){const r=e.meta.hasExplicit?2:3;return t.filter((t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t))).length>=r}function QM({min:e,max:t,count:r,threshold:n,disable:i}){const o=function(e,t,r){const n=nn().domain([e,t]);return n.nice(r),n}(e,t,r),a=function({min:e,max:t,threshold:r,scale:n,disable:i}){const o={start:!0,stop:!0};if(i)return o;const[a,s]=n.domain();return 0!==e&&0!==a&&(o.start=n(e)>r),0!==t&&0!==s&&(o.stop=n(t)<1-r),o}({min:e,max:t,threshold:n,scale:o,disable:i});if(!a.start||!a.stop){const[e,t]=o.domain(),n=o.ticks(r),i=n.length>=4?n[1]-n[0]:.1*e,s=n.length>=4?n[n.length-1]-n[n.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(r)}return o}const eS=50,tS=100,rS=200,nS=125;function iS({config:{measureAxesRef:e},layoutService:t,size:r}){const n=(e=>{switch(e){case.5:return eS;case 1:return tS;case 2:return rS;default:return e*nS}})(t.getLayoutValue(e+".spacing",1));return Math.max(1,Math.round(r/n))}function oS({config:e,chart:t,layoutService:r,dockService:n,measureText:i,size:o,min:a,max:s}){const l=iS({config:e,layoutService:r,size:o}),u=QM({min:a,max:s,count:l,threshold:.05,disable:!0}),c=u.domain(),d={roundedMin:c[0],roundedMax:c[1],ticks:u.ticks(l)},m="horizontal"===n.meta.major.orientation?"height":"width",f=e=>i(e)[m],p=t.formatter(e.formatter),h=()=>{const e=d.ticks.map(p);return!e.some(((t,r)=>e.indexOf(t)!==r))&&(e=>{const t=o/d.ticks.length;return Math.max(...e.map(f))<=t})(e)};for(let e=l-1;e>0&&!h();e--)u.domain([a,s]),u.nice(e),[d.roundedMin,d.roundedMax]=u.domain(),d.ticks=u.ticks(e);return d}function aS({tick:e,index:t,ticks:r}){return 0===t||t===r.length-1||0===e}function sS({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}function lS({config:e,chart:t,extrema:r,min:n,max:i}){const o={roundedMin:0,roundedMax:0,ticks:[]},a=QM({min:n,max:i,count:10,threshold:.15,disable:!0});[o.roundedMin,o.roundedMax]=a.domain();const s=a.ticks(10),l=function({ticks:e}){const t=Math.round(.3*e.length),r=t,n=e.length-t;return e.slice(r,n).some((e=>0===e))}({ticks:s}),u=l?aS:sS;o.ticks=s.filter(((e,t,r)=>u({tick:e,index:t,ticks:r})));o.ticks.length%2==0&&!l&&!r.meta.hasExplicit&&s.length>1&&(o.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const c=t.formatter(e.formatter),d=o.ticks.map(c);return d.some(((e,t)=>d.indexOf(e)!==t))&&(o.ticks=[o.ticks[0],o.ticks[o.ticks.length-1]]),o}function uS({ticks:e,extrema:t}){let r=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some((e=>e===t.explicit.min))&&(r.unshift(t.explicit.min),r=r.filter((e=>e>=t.explicit.min))),t.meta.hasExplicitMax&&!e.some((e=>e===t.explicit.max))&&(r.push(t.explicit.max),r=r.filter((e=>e<=t.explicit.max))),r):r}function cS({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}){const{ticks:u,roundedMin:c,roundedMax:d}=function({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}){if("SPARK"===n.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:s,max:l});const u=oS({config:e,chart:t,layoutService:r,dockService:n,measureText:o,size:a,min:s,max:l});return ZM({extrema:i,ticks:u.ticks})?u:lS({config:e,chart:t,extrema:i,min:s,max:l})}({config:e,chart:t,layoutService:r,dockService:n,extrema:i,measureText:o,size:a,min:s,max:l}),m=function({ticks:e,count:t}){const r=[];for(let n=0;n<e.length-1;n++){const i=e[n],o=(e[n+1]-i)/(t+1);for(let e=1;e<=t;e++)r.push(i+o*e)}return r}({ticks:u,count:1});return{min:c,max:d,values:[...uS({ticks:u,extrema:i}).map((e=>({value:e,isMinor:!1}))),...m.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value))}}function dS({config:e,chart:t,layoutService:r,dockService:n,measureText:i,extrema:o,size:a}){const{min:s,max:l}=function({extrema:e}){const{min:t,max:r}=e;return t!==r?{min:t,max:r}:0===t||1===t?{min:t-1,max:r+1}:{min:t-.2*t*Math.sign(t),max:r+.2*r*Math.sign(r)}}({extrema:o});return cS({config:e,chart:t,layoutService:r,dockService:n,extrema:o,measureText:i,size:a,min:s,max:l})}function mS({config:e,chart:t,layoutService:r,extremumModel:n,dockService:i,seriesModel:o,themeService:a}){const s={locked:!1,resolved:void 0},{getExtrema:l}=n.query,u=function({chart:e,config:t,dockService:r,extremumModel:n,layoutService:i,seriesModel:o,themeService:a}){const{measureText:s}=S.renderer("svg")();return()=>{const l=a.getStyles(),u=function({dockService:e,seriesModel:t,chart:r}){var n;const i=r.component(t.meta.seriesComponentKeys[0]),o=null!==(n=null==i?void 0:i.rect)&&void 0!==n?n:e.meta.chart.size;return"horizontal"===e.meta.major.orientation?o.height:o.width}({chart:e,dockService:r,seriesModel:o}),c=n.query.getExtrema();return dS({config:t,chart:e,layoutService:i,dockService:r,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:c,size:u})}}({config:e,chart:t,layoutService:r,extremumModel:n,dockService:i,seriesModel:o,themeService:a}),c=()=>(s.locked&&s.resolved||(s.resolved=u()),s.resolved);return{query:{getValues:()=>c().values,getMin:()=>l().meta.hasExplicitMin?l().explicit.min:c().min,getMax:()=>l().meta.hasExplicitMax?l().explicit.max:c().max},command:{lock:()=>{s.locked=!0},unlock:()=>{s.locked=!1}}}}function fS({genericObjectModel:e,layoutService:t}){const r={properties:void 0};return{query:{getProperties:()=>r.properties},command:{initialize:()=>function({layout:e,model:t}){return oe.snapshot(e)?Promise.resolve(null):t.getEffectiveProperties().then((e=>({properties:e})))}({layout:t.getLayout(),model:e}).then((e=>{const{properties:t}=null!=e?e:{};r.properties=t}))}}}function pS({layoutService:e,seriesModel:t,colorService:r}){const{type:n,mode:i,fieldType:o}=r.getSettings();if("categorical"!==n)return;const a=e.getLayoutValue("dataPoint.show",!1)?"line-point":"line";let s;s="field"===i?"measure"===o?()=>({type:ta.BAR}):()=>t.query.all()[0]:e=>t.query.all()[e.value];return{item:{shape:{type:({datum:e})=>{const{type:t,options:r}=s(e);switch(t){case"line":return a;case"marker":return r.marker;default:return"square"}},stroke:{},strokeWidth:({datum:e})=>{const{type:t,options:r}=s(e);return t===ta.LINE?2:t!==ta.MARKER||r.fill?0:1},size:10,fill:{fn:({datum:e,scale:t})=>{const{type:r,options:n}=s(e);return r!==ta.MARKER||n.fill?t(e.value):"none"}}}}}}function hS({layout:e,defaultAuto:t}){const r=t(e),n=e.qHyperCube.qMeasureInfo.length>1;return{...r,useBaseColors:n?"measure":r.useBaseColors}}function yS({actions:e,appLayoutModel:t,appModel:r,chart:n,environment:i,flags:o,genericObjectModel:a,layoutService:s,picasso:l,seriesModel:u,viewState:c}){let d;const{theme:m,translator:f}=i,p={wrappedScales:void 0,legendComponents:void 0,legendInteractions:void 0};return d=function(e){var t,r,n,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,m=void 0===d?hl:d,f=e.config,p=void 0===f?{}:f,h=e.custom,y=void 0===h?{}:h,g=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,M=p.auto,S=void 0===M?void 0:M,E=p.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),q={theme:x,key:v,localeInfo:g,layout:C,hc:null==c||null===(r=c.getHyperCube)||void 0===r?void 0:r.call(c),legendProps:null==c||null===(n=c.getLayoutValue)||void 0===n?void 0:n.call(c,"legend"),colorProps:Oa(Oa({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?dl(C):void 0})},O=ul({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&O.auto((function(e){return S?S({layout:e,defaultAuto:pl}):pl(e)}));var A=!1;return{getColor:function(){return O.color()},getPaletteColor:function(e){var t=e.index,r=e.color;return O.resolveUIColor({index:t,color:r})},getData:function(){return O.data()},getDatumProps:function(e){return O.datumProps(e)},getSnapshotData:function(){return O.getSnapshotData(E)},getSettingsForMeasure:function(e){return O.settingsForMeasure(e)},getSettings:function(){return O.settings()},getLegend:function(e,t){return O.legend(e,t)},getScales:function(){return O.scales()},getPalettes:function(){return O.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return O.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:Oa({},y),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?m:e)({getUseBaseColors:dl}),r=ml(q,t);return O.config(r),O.getAuxiliarySettings(E).then((function(){A=!0}))}}}({picasso:l,model:a,app:r,translator:f,layoutService:s,createConfig:()=>{let e;o.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&(e=s.getHyperCubeValue("qMeasureInfo").map((e=>e.color)));return{theme:m,colorProps:{measureOverrides:e},legendProps:s.getLayoutValue("legend"),hc:s.getHyperCube(),key:ea.SCALE.COLOR}},config:{auto:hS,localeInfo:t.qLocaleInfo},custom:{wrappedScales:()=>p.wrappedScales,legendComponents:()=>p.legendComponents,legendInteractions:()=>p.legendInteractions,updateLegend:()=>{const{components:t,interactions:r,scales:o}=function({viewState:e,chart:t,layoutService:r,seriesModel:n,environment:i,colorService:o,actions:a}){const{options:s}=i,l={eventName:"legend-c",key:ea.COMPONENT.LEGEND,viewState:e,chart:t,styleReference:"object.comboChart",rtl:"rtl"===s.direction,settings:pS({layoutService:r,seriesModel:n,colorService:o})},{components:u,interactions:c}=o.getLegend(l,{actions:a,navigationDisabled:!a.interact.enabled()}),d=o.getScales();return{components:u.filter(Boolean).map((e=>{const{layout:t}=e,{dock:r}=t,n=d[ea.SCALE.COLOR+"Range"];return!n||"right"!==r&&"left"!==r||(n.invert=!0),"legend-cat"===e.type&&(e.settings.item.shape.fill.scale=e.scale,e.settings.item.shape.stroke.scale=e.scale),e})),interactions:c,scales:d}}({viewState:c,chart:n,environment:i,colorService:d,seriesModel:u,layoutService:s,actions:e});p.wrappedScales=o,p.legendComponents=t,p.legendInteractions=r}}}),d}const gS=()=>{},vS=2,bS=20,xS=200;var MS={contains:function(e,t){if(!e)return!1;const{qArea:r}=e;return!!r&&(r.qLeft<=t.qLeft&&r.qLeft+r.qWidth>=t.qLeft+t.qWidth&&r.qTop<=t.qTop&&r.qTop+r.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 r=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),n=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+r-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+n-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,r){const n=r.qTop-10<=t.qTop,i=r.qLeft+r.qWidth+10>=t.qLeft+t.qWidth,o=r.qTop+r.qHeight+10>=t.qTop+t.qHeight,a=r.qLeft-10<=t.qLeft;return n&&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 SS={contains:function(e,t){if(!e)return!1;const{qArea:r}=e;return!!r&&(r.qTop<=t.qTop&&r.qTop+r.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 r=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),n=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,n-e.qArea.qTop),a=Math.min(n+r-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-n-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:n,qLeft:i},qData:[{...e.qData[0],qUp:n,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,r){const n=r.qTop-10<=t.qTop,i=r.qTop+r.qHeight+10>=t.qTop+t.qHeight;return n&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const r=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const n={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===r&&n.args.push(600),n}}};var ES={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 CS="pages";const qS="discretePan";function OS({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:qS,pointers:1,threshold:10,enable(n,i){return this.started===qS||!i||!!t.scroll.enabled()&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===r))}},events:{discretePanstart(e){e.preventDefault(),this.started=qS;const t="horizontal"===n.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},discretePanmove(e){e.preventDefault();const t="horizontal"===n.meta.major.orientation,r=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(r-this.previousTotalDelta)*a;this.previousTotalDelta=r,o.scroll(s)},discretePanend(e){e.preventDefault(),this.started=!1},discretePancancel(e){e.preventDefault(),this.started=!1}}}}function AS({chart:e,componentKey:t,actions:r,scroller:n}){return function(i){if(!r.scroll.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);n.scroll(s)}}function DS({layoutService:e,areaBuffer:t}){const r=void 0===t?function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:r}){const n=Math.min(t,Math.max(xS,r));return{width:e,height:Math.max(bS,Math.min(r*vS,n))}}}({layoutService:e}):function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:r}){return{width:e,height:Math.min(t,r)}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:t,height:i}=r({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=t?Math.ceil((t-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:t?Math.min(t,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:t?Math.max(0,Math.min(e.qLeft-a,n.width-t)):e.qLeft}}}function NS(e){let t,r;const n=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||r)return t.reject("REJECTED"),t=null,void(r&&(n(r),r=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=>{r&&r.reject("REJECTED"),r=e})(a):n(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!r,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(r.reject("REJECTED"),r=null)},i}const IS={command:{update:()=>{}}};function TS({dataStore:e,composition:t,enigmaModel:r,layoutService:n,trendLineModel:i=IS,definitionPath:o,areaBuffer:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:r,expand:n,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const n=e.getCurrent();if(a)return Promise.resolve(t(n,l));const i=r.release(n.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(n,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=n(l);return o(i(c)).then((r=>(s(r),e.add(r),t(r,l))))}}({dataStore:e,slice:l,warden:u({bounds:{width:n.meta.size.x,height:n.meta.size.y}}),expand:DS({layoutService:n,areaBuffer:a}),request:c({layoutService:n,definitionPath:o}),process:NS(r),connectionless:n.meta.isSnapshot,processDataPage:s}),m=Il(((e,{onProcessing:t,onData:r})=>{d(e,{onProcessing:t}).then((e=>r(e))).catch((e=>{if("REJECTED"!==e)throw e}))}),50);return function(e,{onProcessing:t=gS,onDataPage:r=gS}={}){m(e,{onProcessing:t,onData:e=>{n.setDataPages(e?[e]:[]),i.command.update(),r(e)}})}}var wS={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:r,viewSize:n}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/n;return[a,r.inView>=r.inTotal?a+1:a+o.qArea.qWidth/r.inView]}};var LS={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:r,areaBuffer:n}){const i=void 0===n?4:n,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(r+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:r,viewSize:n}){const{pixel:i}=t,o=e.getDataPages()[0],a=n/r.inView,s=(i+o.qArea.qTop*a)/n;return[s,r.inView>=r.inTotal?s+1:s+o.qArea.qHeight/r.inView]}};function RS(e){const{groupSize:t,measureCount:r}=e.meta;return null!=t?t:r}function kS(e,t){const r=[];for(let n=0;n<e.length;n++){const i=t(e[n]);-1===r.indexOf(i)&&r.push(i)}return r.length}function PS(e){return kS(e.qMatrix,(e=>e[0].qElemNumber))-1}var jS={inTotal:function({layoutService:e}){const t=RS(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:r,areaBuffer:n}){const i=RS(e),o=void 0===n?i:n,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((r+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:r,viewSize:n}){const i=RS(e),o=e.getDataPages()[0],a=n/r.inView,{pixel:s}=t,l=PS(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/n;return[c,r.inView>=r.inTotal?c+1:c+u/r.inView]}};const FS=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function VS(e){return{itemOffset(t,r){if(0!==t.qArea.qTop)return FS(e,r);const n=((e,t)=>{const r={successful:!0,count:0};let n=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=n;t++){if(!e[t])return r.successful=!1,r;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),n--)}return r.count=i.length-1,r})(t.qMatrix,r);return n.successful?n.count:FS(e,r)},area(t,r,n){if(0!==t.qArea.qTop)return FS(e,r);return kS(t.qMatrix.slice(0,n.qTop+1),(e=>e[0].qElemNumber))-1}}}var _S={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:r,inView:n}){const i=VS(t).itemOffset(e(),r),o=Math.max(0,Math.floor(r-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(n+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:r,items:n,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/n.inView,{item:l,pixel:u}=r,c=VS(t).area(e(),l,a.qArea),d=PS(a),m=a.qArea.qHeight+d,f=u===o?(n.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[f,n.inView>=n.inTotal?f+1:f+m/n.inView]}};function BS({rect:e,dockService:t,itemWidths:r,dimensionAxis:n,inTotal:i,isMajorVisible:o,isMajorLabelless:a,maxDataRows:s}){const{DEFAULT:l,SQUEEZE:u,LABELLESS:c}=r[t.meta.chart.mode],{axisDisplayMode:d="auto",maxVisibleItems:m=10}=n,f="horizontal"===t.meta.major.orientation?e.width:e.height,p=f/i>=u;switch(d){case"max":return Math.min(i,s);case"custom":return Math.min(m,s);case"auto":default:return!o||a?f/c:p?i:f/l}}function HS({chart:e,getRect:t,getDataPages:r,layoutService:n,dockService:i,getItemWidths:o,axisKey:a,areaBuffer:s,rtl:l}){const{inTotal:u,area:c,scaleRange:d}=function({layoutService:e}){const{isDimensionless:t,isGrouped:r,isGroupedByMeasure:n}=e.meta;return t?wS:r?n?jS:_S:LS}({layoutService:n}),m=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,f=e=>e?m()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const r=n.getLayoutValue("dimensionAxis"),s=u({layoutService:n}),l=e.component(a),c=!a||!l||l.isVisible();return{inTotal:s,inView:BS({rect:t(),dockService:i,itemWidths:o(),dimensionAxis:r,inTotal:s,isMajorVisible:c,isMajorLabelless:"none"===r.show||"title"===r.show,maxDataRows:Math.floor(1e4/(n.meta.dimensionCount+n.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t,i=Math.min(0,Math.max(e,p(r,n)));return{pixel:i,item:n?Math.abs(n*i/m()):0}},getUpperBound({items:e}){const{inTotal:t,inView:r}=e;return p(t,r)},getViewRange({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t;return function({viewSize:e,inTotal:t,inView:r,pixelOffset:n}){const i=e/r*t,o=Math.abs(n)/i;return[o,o+e/i]}({viewSize:m(),inTotal:r,inView:n,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>c({getDataPages:r,layoutService:n,itemOffset:e,inView:t.inView,areaBuffer:s}),getScaleRange({offsets:e,items:t}){const o=d({getDataPages:r,layoutService:n,offsets:e,items:t,viewSize:m(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&l?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:r,inView:n}=t;return e<=0&&e>=p(r,n)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:r}=t,n=e*f(r);return Number.isFinite(n)?-n:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:r,inView:n}=t;return-e*(f(n)*r)}}}}function $S({chart:e,componentKey:t,state:r,dataStore:n,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,areaBuffer:c,viewState:d,rtl:m}){r.set("rect",{width:0,height:0}),r.set("itemWidths",{}),r.set("itemSize",0),r.set("items",{}),r.set("offsets",{}),r.set("finished",0),r.set("scaleRange",[0,1]);const f=HS({chart:e,getRect:()=>r.get("rect"),getDataPages:n.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>r.get("itemWidths"),axisKey:u,areaBuffer:c,rtl:m}),p=()=>{const e=f.getItems();return r.set("items",e),e},h=({pixelOffset:e,items:t})=>{const n=f.getOffsets({pixelOffset:e,items:t});return r.set("offsets",n),n},y=e=>{const t=Date.now(),n=p(),a=h({pixelOffset:e,items:n}),s=f.getArea({itemOffset:a.item,items:n});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((r=>e[r]===t[r]))})(s))return void((f.validate.offset({pixelOffset:e,items:n})||d.get("scrollOffset")!==a.item)&&(r.set("finished",t),r.set("scaleRange",f.getScaleRange({offsets:a,items:n})),d.preventSet("viewRange",f.getViewRange({pixelOffset:a.pixel,items:n})),d.set("scrollOffset",a.item)));d.preventSet("viewRange",f.getViewRange({pixelOffset:a.pixel,items:n}));const l=()=>{r.get("finished")>t||(r.set("finished",t),r.set("scaleRange",f.getScaleRange({offsets:a,items:n})),d.set("scrollOffset",a.item))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=r.get("items");return e>t},itemSize:()=>r.get("itemSize"),scaleRange:()=>r.get("scaleRange"),initialize(){const n=e.component(t);if(!n)return Promise.resolve();r.set("rect","function"==typeof l?l():n.rect),r.set("itemWidths","function"==typeof s?s():s);const a=p();r.set("itemSize",f.getItemSize({items:a}));const u=void 0===d.get("scrollOffset")?(({items:e})=>1===o.getLayoutValue("scrollStartPos")?f.getUpperBound({items:e}):0)({items:a}):f.convert.itemToPixelOffset({itemOffset:d.get("scrollOffset"),items:a}),c=h({pixelOffset:u,items:a});d.preventSet("viewRange",f.getViewRange({pixelOffset:c.pixel,items:a}));const m=f.getArea({itemOffset:c.item,items:a});return new Promise((e=>{i(m,{onDataPage:()=>{r.set("scaleRange",f.getScaleRange({offsets:c,items:a})),d.preventSet("scrollOffset",c.item),e()}})}))},scroll(e){const t=r.get("offsets").pixel+e;y(t)},scrollToRelative(e){const t=r.get("items"),n=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(n)}}}function zS({chart:e,actions:t,componentKey:r,enigmaModel:n,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:m,areaBuffer:f,processDataPage:p=(()=>{})}={}}){const h=Dl(),y=function({qMode:e}){switch(e){case"S":default:return MS;case"K":return SS;case"T":return ES}}({qMode:i.getHyperCubeValue("qMode")}),g=function({state:e,contains:t}){return e.set(CS,[]),{add:t=>{const r=e.get(CS);r.length=0,r.push(t)},getCurrent:()=>e.get(CS)[0],getAll:()=>e.get(CS),contains:r=>t(e.get(CS)[0],r)}}({state:h,contains:y.contains});!function({layoutService:e,dataStore:t,composition:r}){const n=e.getDataPages()[0];if(!n)return;const i=r.patcher({layoutService:e});i.should(n)&&i(n),t.add(n)}({layoutService:i,dataStore:g,composition:y});const v=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:f}),b=TS({dataStore:g,composition:y,enigmaModel:n,layoutService:i,trendLineModel:a,definitionPath:c,areaBuffer:v,processDataPage:p}),x=$S({chart:e,componentKey:r,state:h,dataStore:g,pageData:b,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:m,areaBuffer:v,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(r){const n=Ol(r,""+e.refs.dataPages);n.length=0,n.push(t.getCurrent())}}({layoutService:i,dataStore:g});return{interactions:function({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o}){return{gestures:[OS({chart:e,actions:t,componentKey:r,dockService:n,rtl:i,scroller:o})],native:{type:"native",events:{wheel:AS({chart:e,actions:t,componentKey:r,scroller:o})}}}}({chart:e,actions:t,componentKey:r,dockService:o,rtl:u,scroller:x}),query:{getCanScroll:()=>x.enabled(),getItemSize:()=>x.itemSize(),getScaleRange:()=>x.scaleRange(),getCurrentDataPage:()=>g.getCurrent()},command:{initialize:()=>x.initialize(),scrollTo:e=>x.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var US={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}};function YS({appLayoutModel:e,appModel:t,chart:r,environment:n,flags:i,genericObjectModel:o,layout:a,picasso:s}){const{translator:l,embed:u}=n,c=function({layout:e,app:t,picasso:r,model:n,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:r,model:n,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:ya,miniChartToken:{},embed:s}}({layout:a,app:t,model:o,picasso:s,chart:r,translator:l,localeInfo:e.qLocaleInfo,embed:u});return{query:{useCustomTooltip:()=>c.useCustomTooltip,useTooltipChart:()=>{var e,t,r,n;return i.isEnabled("CUSTOM_TOOLTIP_CHART")&&(null===(e=a.tooltip)||void 0===e||null===(t=e.chart)||void 0===t||null===(r=t.object)||void 0===r?void 0:r.refId)&&c.embed&&"function"==typeof(null===(n=c.model)||void 0===n?void 0:n.getEffectiveProperties)},hasChartLimitation:()=>{var e;return null==t||null===(e=t.isInModalSelection)||void 0===e?void 0:e.call(t)},getCustomTooltipModel:()=>c}}}function WS({layoutService:e,key:t}){const{style:r}=e.getLayoutValue("components",[]).filter((e=>e.key===t))[0]||{};return({property:n,defaultValue:i,index:o})=>{const a=r&&Object.hasOwnProperty.call(r,n)?r[n]:i;if(void 0===o)return a;const{style:s}=e.getHyperCubeValue((e=>`qMeasureInfo.${e}.styling`)(o),[]).filter((e=>e.key===t))[0]||{};return s&&Object.hasOwnProperty.call(s,n)?s[n]:a}}function GS({layoutService:e,dockService:t}){const{BAR:r,LINE:n,POINT:i}=Am,o=WS({layoutService:e,key:"bar"}),a=WS({layoutService:e,key:"line"}),s=()=>{const e=o({property:"strokeWidth",defaultValue:"none"});return e?r.STROKE.WIDTH[e.toUpperCase()]:0};return{query:{bar:{getHasStyling:()=>!!e.getLayoutValue("components",[]).filter((e=>"bar"===e.key)).length,getWidthFn:()=>()=>o({property:"width",defaultValue:.7}),getHasStrokeWidth:()=>!!s(),getStrokeWidth:()=>s(),getStrokeColor:()=>o({property:"strokeColor",defaultValue:{index:-1,color:r.STROKE.COLOR}}).color},line:{getCurveFn:()=>(e,t)=>a({property:"lineCurve",defaultValue:n.CURVE.LINEAR,index:t}),getStrokeWidthFn:()=>(e,r)=>a({property:"lineThickness",defaultValue:"FULL"===t.meta.chart.mode?n.WIDTH.FULL.DEFAULT:n.WIDTH.LESS.DEFAULT,index:r}),getStrokeDasharrayFn:()=>(e,t)=>{const r=a({property:"lineType",defaultValue:n.TYPE.SOLID,index:t});return r&&n.TYPE[r.toUpperCase()]}},point:{getSize:e=>a({property:"dataPointSize",defaultValue:i.SIZE.DEFAULT,index:e})}}}}const{model:KS}=uh,XS=({picasso:e,chart:c,environment:d,flags:m,viewState:f,viewCache:p,actions:h,selectionService:y})=>{const g=o(),{width:v,height:b}=n(),[x,M]=t(),[S,E]=t(),C=a(),q=s(),O=l(),A=u();r((()=>{if(!(g&&null!=c&&c.update&&d&&f))return;const t=function(e){var t=e.source,r=e.metaAdditionsFn,n=_a(!0,{},t),i=wl(n),o=function(){return function(e){var t=e.layout,r=e.additionsFn,n=void 0===r?function(){return{}}:r,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,m=Oa({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return Oa(Oa({},m),n({layout:t,meta:m}))}({layout:n,additionsFn:r,additionsProps:{size:i.size}})},a={refs:Oa({},i.refs),meta:o(),getLayout:function(){return n},getLayoutValue:function(e,t){return Ol(n,e,t)},setLayoutValue:function(e,t){Al(n,e,t),i=wl(n),a.meta=o()},getHyperCube:function(){return n.qHyperCube},getHyperCubeValue:function(e,t){return Ol(n.qHyperCube,e,t)},setHyperCubeValue:function(e,t){Al(n.qHyperCube,e,t),i=wl(n),a.meta=o()},getDataPages:function(){return Ol(n,i.refs.dataPages)},setDataPages:function(e){Al(n,i.refs.dataPages,e),a.meta=o()}};return a}({source:g,metaAdditionsFn:zM(m)}),{viewState:r={}}=d.options,{legendScrollOffset:n,scrollOffset:i}=t.meta.isSnapshot?t.getLayoutValue("snapshotData.content.chartData",{}):r;f.preventSet("scrollOffset",i),f.preventSet("legendScrollOffset",n),f.preventSet("title",t.getLayoutValue("title"));const o=function({genericObjectModel:e,layoutService:t}){const r={cube:void 0,on:!1},n=WM({genericObjectModel:e,layoutService:t});return{query:{getCube:()=>r.cube,getIsReduced:()=>r.on},command:{initialize:()=>n().then((({reducedCube:e})=>{r.cube=e,r.on=!!(r.cube&&r.cube.qDataPages[0]&&r.cube.qDataPages[0].qIsReduced)})),setSnapshotData:e=>{e.reducedHyperCube=r.cube}}}}({genericObjectModel:C,layoutService:t}),a=ql({chart:c,layoutService:t,config:{logicalSize:{width:v,height:b},rtl:"rtl"===d.options.direction},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0,measureAxes:[{ref:"measureAxes.0",name:"minor"},{ref:"measureAxes.1",name:"minorSecondary"}]}}),s=GS({layoutService:t,dockService:a}),l=$M({layoutService:t,flags:m}),u=t.meta.isDiscrete?function({chart:e,genericObjectModel:t,layoutService:r,dockService:n,seriesModel:i,viewState:o,rtl:a,actions:s}){return zS({chart:e,actions:s,componentKey:ch(i),enigmaModel:t,layoutService:r,dockService:n,viewState:o,rtl:a,itemWidths:US,options:{axisKey:ea.COMPONENT.AXIS.MAJOR}})}({chart:c,genericObjectModel:C,layoutService:t,dockService:a,seriesModel:l,viewState:f,rtl:"rtl"===d.options.direction,actions:h}):void 0,x=t.meta.isContinuous?KS({model:C,layoutService:t,viewState:f,viewCache:p}):void 0,S=yS({actions:h,appLayoutModel:O,appModel:q,chart:c,environment:d,flags:m,genericObjectModel:C,layoutService:t,picasso:e,seriesModel:l,viewState:f}),E=function(e){var t=e.theme,r=e.styleMatrix,n={theme:t,styleMatrix:td(void 0===r?[]:r),styles:void 0};return n.styles=rd(n.styleMatrix,t),{getStyles:function(){return n.styles},getTheme:function(){return n.theme},setTheme:function(e){n.theme=e,n.styles=rd(n.styleMatrix,e)}}}({theme:d.theme,styleMatrix:pv}),D=function({layoutService:e,seriesModel:t}){const{isContinuous:r}=e.meta,n="qDimensionInfo/0",i=n+":numeric";return{main:{major:n,majorNumeric:i,minorsPrimary:t.meta.primarySeries.map((e=>e.ref)),minorsSecondary:t.meta.secondarySeries.map((e=>e.ref))},virtuals:r?[{key:i,from:n,override:{value:e=>e.qNum}}]:void 0}}({layoutService:t,seriesModel:l}),N=JM({isPrimary:!0,layoutService:t,reducedModel:o,seriesModel:l,continuousModel:x,flags:m}),I=JM({isPrimary:!1,layoutService:t,reducedModel:o,seriesModel:l,continuousModel:x,flags:m}),T=mS({config:{measureAxesRef:"measureAxes.0",formatter:ea.FORMATTER.PRIMARY},chart:c,layoutService:t,extremumModel:N,dockService:a,seriesModel:l,themeService:E}),w=mS({config:{measureAxesRef:"measureAxes.1",formatter:ea.FORMATTER.SECONDARY},chart:c,layoutService:t,extremumModel:I,dockService:a,seriesModel:l,themeService:E}),L=fS({genericObjectModel:C,layoutService:t}),R=YS({appLayoutModel:O,appModel:q,chart:c,environment:d,flags:m,genericObjectModel:C,layout:g,picasso:e}),k=Zo({layoutService:t,discreteModel:u}),P=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAJOR:ea.SCALE.MAJOR,MAJOR_INNER:ea.SCALE.MAJOR_INNER,MINOR:{PRIMARY:ea.SCALE.MINOR.PRIMARY,SECONDARY:ea.SCALE.MINOR.SECONDARY}},COMPONENT:{BAR_PRIMARY:`${ea.COMPONENT.BAR}-${ra.PRIMARY}`,BAR_SECONDARY:`${ea.COMPONENT.BAR}-${ra.SECONDARY}`,AXIS:{MAJOR:ea.COMPONENT.AXIS.MAJOR,MAJOR_CONTINUOUS:ea.COMPONENT.AXIS.MAJOR_CONTINUOUS,TIME_INNER:ea.COMPONENT.AXIS.TIME_INNER,MINOR:{PRIMARY:ea.COMPONENT.AXIS.MINOR.PRIMARY,SECONDARY:ea.COMPONENT.AXIS.MINOR.SECONDARY}},AXIS_TITLE:{MAJOR:ea.COMPONENT.AXIS_TITLE.MAJOR,MINOR:{PRIMARY:ea.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,SECONDARY:ea.COMPONENT.AXIS_TITLE.MINOR.SECONDARY}}},COLLECTION:{MAIN:ea.COLLECTION.MAIN}}}}(t),j=function(e){var t=e.picassoInstance,r=e.plugins,n=e.pluginArgs,i=void 0===n?{}:n,o={initialized:!1,definitions:[]};return{initialize:function(){return Ea(regeneratorRuntime.mark((function e(){var n,a,s,l;return regeneratorRuntime.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(r.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=Ea(regeneratorRuntime.mark((function e(r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,r.fn(Oa({},i));case 4:if("object"===Ma(n=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(r.info.componentName,n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(r.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(Oa({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(n=o.definitions).push.apply(n,Na(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var r=Da(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(r){var n=_a(!0,{},r.brush);_a(!0,r,t),t.brush&&(r.brush=function(e,t){return"object"===Ma(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Ll({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Ll({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(n,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:A,pluginArgs:P});M({selectionService:y,genericObjectModel:C,appModel:q,dockService:a,styleModel:s,layoutService:t,fieldModel:D,seriesModel:l,reducedModel:o,primaryExtremumModel:N,secondaryExtremumModel:I,primaryTickModel:T,secondaryTickModel:w,propertiesModel:L,colorService:S,themeService:E,appLayoutModel:O,tooltipModel:R,flags:m,...u&&{discreteModel:u},...x&&{continuousModel:x},refLineModel:k,pluginService:j})}),[g,C,q,O,d,null==c?void 0:c.update,f]);const[,D]=i((()=>{if(!x)return Promise.resolve();const{layoutService:e,colorService:t,reducedModel:r,primaryExtremumModel:n,secondaryExtremumModel:i,propertiesModel:o,continuousModel:a,discreteModel:s,pluginService:l}=x,u=a?()=>{var t,r;a.update(e.getLayout());const n=a.initialFetch(),i=!e.meta.isSnapshot&&(null==d||null===(t=d.options)||void 0===t||null===(r=t.viewState)||void 0===r?void 0:r.zoom);return i&&f.preventSet("zoom",i),n}:()=>Promise.resolve(),c=t.initialize().then((()=>{const e=t.getSettings().field;y.setBrushAliases({colorField:e}),t.custom.updateLegend()}));return Promise.all([l.initialize(),r.command.initialize(),C?o.command.initialize():Promise.resolve(),c,u(),h.scroll.attachDiscreteModel(s)]).then((()=>Promise.all([n.command.initialize(),i.command.initialize()]).then((()=>E(x)))))}),[x]);if(D)throw D;return S};function JS(){const[e,n]=t();return r((()=>{n(function(e){var t=Oa({},e),r={},n={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&r[e]?t[e]=r[e](o,a):t[e]=o,!i&&n[e]&&n[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){r[e]=t},onChanged:function(e,t){n[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}))}),[]),e}const ZS={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const QS={query:{getCanScroll:()=>!0}};function eE(){const e=h(),[n,i]=t(!1),[o,a]=t(!1),[s,l]=t(!1),u=function(){const e=h(),[n,i]=t(!1),[o,a]=t({}),[s,l]=t();return r((()=>()=>{a({})}),[]),r((()=>{e&&i(!e.select&&!e.active)}),[e]),{enabled:()=>n,emit:(e,...t)=>o[e].forEach((e=>e(...t))),removeListener:(e,t)=>{var r;const n=null===(r=o[e])||void 0===r?void 0:r.indexOf(t);n>-1&&o[e].splice(n,1)},on:(e,t)=>{Array.isArray(o[e])?o[e].push(t):o[e]=[t]},get brushSelectionIncludeMax(){return s},set brushSelectionIncludeMax(e){l(e)},getBrushOptions:void 0}}(),c=function(){var e,n,i;const o=h(),[a,s]=t(!1),[l,u]=t(!1),c=y(),d=!!c.qSelectionInfo.qInSelections,m=!(null===(e=c.qHyperCube)||void 0===e||null===(n=e.qDimensionInfo)||void 0===n||null===(i=n[0])||void 0===i||!i.qIsOneAndOnlyOne);r((()=>{o&&s(!o.select&&!o.active)}),[o]);const f=e=>{u("boolean"==typeof e?e:!l)};return g((()=>({key:"lasso",label:"Lasso",icon:ZS,hidden:!a||!d||m,active:l,action:f})),[d,m,l,a]),{action:f,enabled:()=>a,active:()=>l}}();let d=QS;r((()=>{e&&(i(!e.active),a(!e.active),l(!e.passive))}),[e]);const[m]=t({});return m.scroll={enabled:()=>n&&d.query.getCanScroll(),attachDiscreteModel:e=>{d=e||QS}},m.interact={enabled:()=>o},m.tooltip={enabled:()=>s},m.lasso=c,m.select=u,m}function tE({clearMinor:e,clearDiscrete:t,clearLegend:r}){e(),e({componentName:"minor-secondary-range-brush",eventName:"minorRange-secondary"}),t({brushName:!1}),r()}function rE({setSelectionInfo:e,event:t,components:r,clear:n}){const i=null!=r&&r.length?r.map((e=>e.key)).filter(Boolean):[];e({event:t,components:i,minorRangePrimary:"minorRange"===t,minorRange:["minorRange","minorRange-secondary"].includes(t),legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===ea.COMPONENT.LEGEND_CATEGORICAL}),n()}var nE,iE={exports:{}};nE=iE,function(e,t){nE.exports=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/conversion/",r(r.s="./index.js")}({"../node_modules/extend/index.js":
10
10
  /*!***************************************!*\
11
11
  !*** ../node_modules/extend/index.js ***!
12
12
  \***************************************/
@@ -16,7 +16,7 @@ function(e,t,r){var n=Object.prototype.hasOwnProperty,i=Object.prototype.toStrin
16
16
  !*** ../node_modules/qlik-modifiers/dist/qlik-modifiers.js ***!
17
17
  \*************************************************************/
18
18
  /*! no static exports found */
19
- function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/qlik-modifiers/",r(r.s=1)}([function(e,t,r){var n=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,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(t in e);return void 0===t||n.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(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,r,n,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(r in t)n=c(d,r),d!==(i=c(t,r))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=n&&s(n)?n:[]):a=n&&l(n)?n:{},u(d,{name:r,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:r,newValue:i}));return d}},function(e,t,r){r.r(t);var n=r(0),i=r.n(n),o={setValue:function(e,t,r){if(!t)return!1;var n,i=t.split("."),o=i[i.length-1],a=e;for(n=0;n<i.length-1;++n)void 0===a[i[n]]&&(a[i[n]]=Number.isNaN(+i[n+1])?{}:[]),a=a[i[n]];if(void 0!==r){var s=a[o];return a[o]=r,{updated:r,previous:s}}return delete a[o],!1},getValue:function(e,t,r){var n,i=t.split("."),o=e;if(void 0===o)return r;for(n=0;n<i.length;++n){if(void 0===o[i[n]])return r;o=o[i[n]]}return o}},a="".concat(" ","(").concat(" "),s="".concat(" ",")").concat(" ");function l(e){return a+e+s}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var r=function(e,t){if(!t)return null;var r,n;for(r=0;r<t.length;r++)if((n=t[r]).qInfo.qId===e)return n;return null}(e.qLibraryId,t.dimensionList);return r&&r.qData.info[0].qTags.indexOf("$numeric")>-1}var n=function(e,t){if(!t)return null;var r,n,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var r=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(r)&&(t=(t=t.substring(1,r)).trim()),t}(e);for(r=0;r<t.length;r++){if((n=t[r]).qName===i)return n;if(n.qDerivedFieldData)for(var o=0;o<n.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=n.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 n&&n.qTags.indexOf("$numeric")>-1}function c(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var r=e.crossAllDimensions;return 2===t&&r?"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 f(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function p(e,t){var r=e.crossAllDimensions;return 2===t&&r?"Above(Total ":"Above("}function h(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 g(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!r.showExcludedValues)return"";if(n&&1===n.length){var c=y(u(n[0],i),f(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(n&&2===n.length){var d=u(n[0],i),m=u(n[1],i),p=f(0),h=f(1),g=y(d,p),v=y(m,h);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function v(e){return"".concat(e,"(")}function b(){return")"}function x(e){var t=e.properties,r=e.layout;return o.getValue(t,"qHyperCubeDef.qDimensions",o.getValue(r,"qHyperCube.qDimensionInfo",[])).length}var M={isFullRange:c,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=l(m(t));if(!r.showExcludedValues)return a;var s=g({modifier:r,dimensions:n,dimensionAndFieldList:i}),u=o?"":", 0";if(n&&1===n.length){var c=f(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(u,")")}if(n&&2===n.length){var d=f(0),p=f(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(u,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!c(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return d(e,t)},getAboveCompPrefix:p,getAboveCompSuffix:h,getAboveComp:function(e,t,r,n){return p(e,t)+r+h(n)},getFunctionPrefix:v,getFunctionSuffix:b,getRangeComp:function(e,t){return v(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:g,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:r,layout:n})},getDimComp:function(e,t){var r=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),n=f(t);if(!r.qSortByExpression&&!r.qSortByNumeric&&!r.qSortByAscii)return n;var i=["Descending","Ascending"],o=r.qSortByNumeric?"(Numeric, ".concat(i[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(i[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(o,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(o,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(a);if(-1!==r){var n=t.indexOf(s);if(-1!==n)return t.substring(r+a.length,n)}}},initModifier:function(e,t){Object.keys(t).forEach((function(r){void 0===e[r]&&(e[r]=t[r])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,r=e.layout,n=e.minDimensions,i=void 0===n?1:n,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!r)return!0;var s=x({properties:t,layout:r});return s>=i&&s<=a},getExpressionWithMarkers:l,canExtract:function(e){var t=e.indexOf(a),r=e.indexOf(s);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:f,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function S(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(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")}()}function E(e){return(E="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 C=i.a.bind(null,!0),q={},O=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function D(e){return void 0===e}function N(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function I(e,t){var r,n=t.substring(1).split("/").slice(0,-1);return n.forEach((function(t,i){if(i!==n.length){r=+t;var o=Number.isNaN(r)?{}:[];e[r||t]=D(e[r||t])?o:e[t],e=e[r||t]}})),e}function T(e,t){var r=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(n){T(e[n],t[n])||(r=!1)})),r);if(O(e)&&O(t)){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n+=1)if(!T(e[n],t[n]))return!1;return!0}return e===t}q.generate=function(e,t,r){r=r||"";var n=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(r,"/").concat(i);T(o,a)||N(t,i)||(D(a)?n.push({op:"add",path:s,value:o}):A(o)&&A(a)?n=n.concat(q.generate(a,o,s)):O(o)&&O(a)?n=n.concat(function(e,t,r){var n=[],i=e.slice(),o=-1;function a(e,t,r){if(e[r]&&D(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,i=e.length;n<i;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(T(t,i))return n;if(!D(t[0])&&D(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(n.push({op:"remove",path:"".concat(r,"/").concat(s)}),i.splice(s,1)):n=n.concat(q.generate(i[s],t[o],"".concat(r,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(n.push({op:"move",path:"".concat(r,"/").concat(l),from:"".concat(r,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return n}(a,o,s)):n.push({op:"replace",path:"".concat(r,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!N(e,i)&&n.push({op:"remove",path:"".concat(r,"/").concat(i)})})),n},q.apply=function(e,t){t.forEach((function(t){var r,n=I(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?n[i]:n[+i]||n,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,o=e),"add"===t.op||"replace"===t.op)if(O(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(O(o)&&O(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,S(l))}else if(A(o)&&A(t.value))r=o,Object.keys(r).forEach((function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!N(r,e)&&delete r[e]})),C(o,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[i]=t.value}else if("move"===t.op){var u=I(e,t.from);O(n)?n.splice(+i,0,u.splice(+a,1)[0]):(n[i]=u[a],delete u[a])}else"remove"===t.op&&(O(n)?n.splice(+i,1):delete n[i])}))},q.clone=function(e){return C({},e)},q.createPatch=function(e,t,r){var n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):C(e,t)};var w=q,L={saveSoftProperties:function(e,t,r){if(!e)return Promise.resolve();var n=w.generate(t,r);return i()(!0,t,r),n&&n.length?(n=n.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(n,!0)):Promise.resolve()}},R="accumulation";function k(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===R)return r[n]}function P(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===R)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=M.getNumStepComp(r,l),m=M.getAboveComp(r,l,c,d),f=M.getRangeComp("RangeSum",m);if(M.needDimension({modifier:r,properties:n,layout:i})){var p=M.getDimComp(u,1),h=M.getDimComp(u,0),y=M.getAggrComp(f,p,h);f=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,j)},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!M.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 r=k(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=k(t,e);return r&&!r.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 M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=k(t,e);return o&&!o.disabled}}}},V="movingAverage";function _(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===V)return r[n]}function z(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===V)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},$={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!n)return r;var u=s;void 0===u&&(u=M.getNumDimensions({properties:i,layout:a}));var c=o.getValue(i,"qHyperCubeDef.qDimensions",[]),d=n.showExcludedValues&&n.nullSuppression,m=M.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=M.getNumStepComp(n,u),p=M.getAboveComp(n,u,m,f);if(n.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var h=M.getRangeComp("RangeSum",p),y=function(e,t){var r=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var n=e.steps,i="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(i,", ").concat(r,")")}return r}(n,u);t="".concat(h," / ").concat(y)}var g=t;if(M.needDimension({modifier:n,properties:i,layout:a})){var v=M.getDimComp(c,1),b=M.getDimComp(c,0),x=M.getAggrComp(g,v,b);g=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.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 r=_(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=_(t,e);return r&&!r.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 M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=_(t,e);return o&&!o.disabled}}}},B="difference";function U(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===B)return r[n]}function Y(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===B)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var W={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},G={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=M.getAboveComp(r,l,c),m="".concat(c," - ").concat(d);if(M.needDimension({modifier:r,properties:n,layout:i})){var f=M.getDimComp(u,1),p=M.getDimComp(u,0),h=M.getAggrComp(m,f,p);m=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return m},initModifier:function(e){Object.keys(W).forEach((function(t){void 0===e[t]&&(e[t]=W[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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Y(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(Y(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(Y(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=U(t,e);return o&&!o.disabled}}}},K={SELECTION:{CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},DIMENSION:{ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2}},X="normalization";function J(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===X)return r[n]}function Z(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===X)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}function Q(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}function ee(e,t,r,n){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.DIMENSION.ONE_DIMENSION,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.DIMENSION.ALL_DIMENSIOANS,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,r){if(e<2){var n=Q(t,0);t.splice(n,1)}return t}(i,o),function(e,t,r){if(0===e){var n=Q(t,1);t.splice(n,1)}return t}(J(e,n).selectionScope,o)}function te(e,t,r){var n=[{value:K.SELECTION.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECTION.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.SELECTION.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,r){if(1===e){var n=Q(t,0);t.splice(n,1)}return t}(J(e,r).dimensionalScope,n)}var re={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,selectionScope:K.SELECTION.DISREGARD_SELECTION};function ne(e){return 2===e?"{1}":""}function ie(e,t,r){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,r){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(r),">"):""}function se(e,t,r,n,i,o,a){var s=ne(t),l=ie(t,r,n),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),m=function(e){for(var t=[],r=0;r<e;r++)t[r]=M.getDimDefWithWrapper(r);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(m,"))")}var le={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=r.selectionScope,m=r.dimensionalScope;return se(c,d,r.field,r.value,m,l,r.primaryDimension)},initModifier:function(e){Object.keys(re).forEach((function(t){void 0===e[t]&&(e[t]=re[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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.SELECTION.DISREGARD_SELECTION,options:function(r){return te(r,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,r){return r.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===K.SELECTION.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECTION.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(r,n){return ee(r,n,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,r){return(J(t,e).dimensionalScope||0)===K.DIMENSION.ONE_DIMENSION&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:ne,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae};function ue(e){var t=e.model,r=e.callback,n={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},r=o.getValue(e,"qInfo.qType");return r&&s[r]&&s[r].forEach((function(r){t[r]=o.getValue(e,r)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var i=l(e);n[t].properties!==i&&(n[t].properties=i,"function"==typeof r&&n[t].enabled&&r(e)),n[t].enabled=!0}}function c(e,r){return t.app[r](e).then((function(t){n[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var r=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.measureLibraryIds,r=e.dimensionLibraryIds;i={},t.forEach((function(e){i[e]=!0})),a={},r.forEach((function(e){a[e]=!0}))}({measureLibraryIds:r,dimensionLibraryIds:o}),Object.keys(n).forEach((function(e){i[e]||a[e]||(n[e].listener.dispose(),delete n[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!n[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!n[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(n).forEach((function(e){n[e].listener.dispose()})),n={}}}}var ce={getExpression:function(e){return o.getValue(e,"qDef.base.qDef")||o.getValue(e,"qDef.qDef")},getExpressionRef:function(e){return o.getValue(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return o.getValue(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return o.getValue(e,"qDef.base.qLibraryId")||o.getValue(e,"qLibraryId")},getLabelRef:function(e){return o.getValue(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o.getValue(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},de={initBase:function(e,t){(t||de.isValid(e))&&(o.setValue(e,"qDef.base.qDef",o.getValue(e,"qDef.qDef")),o.setValue(e,"qDef.base.qLibraryId",o.getValue(e,"qLibraryId")),o.setValue(e,"qDef.base.qLabel",o.getValue(e,"qDef.qLabel")),o.setValue(e,"qDef.base.qLabelExpression",o.getValue(e,"qDef.qLabelExpression")))},restoreBase:function(e){de.isValid(e)&&(o.setValue(e,"qDef.qDef",o.getValue(e,"qDef.base.qDef")),o.setValue(e,"qLibraryId",o.getValue(e,"qDef.base.qLibraryId")),o.setValue(e,"qDef.qLabel",o.getValue(e,"qDef.base.qLabel")),o.setValue(e,"qDef.qLabelExpression",o.getValue(e,"qDef.base.qLabelExpression")),o.getValue(e,"qDef.qAggrFunc")&&o.getValue(e,"qDef.base.qAggrFunc")&&o.setValue(e,"qDef.qAggrFunc",o.getValue(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=o.getValue(e,"qDef.base.qDef"),r=o.getValue(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==r}},me=de;function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var pe={accumulation:F,movingAverage:$,difference:G,normalization:le},he=(t.default={modifiers:pe,apply:ye,applyModifiers:ge,cleanUpMeasure:ve,destroy:function(e){e&&he[e.id]&&he[e.id].masterItemSubscriber&&(he[e.id].masterItemSubscriber&&he[e.id].masterItemSubscriber.unsubscribe(),delete he[e.id])},hasActiveModifiers:be,getActiveModifier:xe,initBase:me.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return pe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return pe[e]&&pe[e].isApplicable({properties:r,layout:n})}))},measureBase:ce,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Ee(e);Ie({modifiers:t,properties:r,layout:n})&&(i=!0,o=o||ke({modifiers:t,properties:r,layout:n}))})),i&&!o},ifEnableTotalsFunction:Me},{});function ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,r=e.properties,n=e.isSnapshot,a=void 0!==n&&n,s=e.masterItem;he[t.id]=he[t.id]||{isFirstTime:!0};var l=he[t.id].isFirstTime;if(he[t.id].isFirstTime=!1,r&&"object"===fe(r))return ge({model:t,properties:r});var u=t?t.layout:void 0,c=o.getValue(u,"qSelectionInfo.qInSelections");if(a||c)return Promise.resolve(!1);var d=o.getValue(u,"qHyperCube.qMeasureInfo"),m=he[t.id].lastReloadTime;if(he[t.id].lastReloadTime=o.getValue(t,"app.layout.qLastReloadTime"),be({measures:d,layout:u})){var f=function(e){var t=e.measures,r=e.layout,n=e.model,i=e.lastReloadTime;return o.getValue(n,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ne({measure:e,properties:r,layout:n})}))}({measures:t,layout:r})}({measures:d,layout:u,model:t,lastReloadTime:m});return f||function(e){var t=e.measures,r=e.layout,n=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||n||t.some((function(e){return function(e){var t=e.measure,r=e.layout;return Ie({modifiers:Ee(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var r=i()(!0,{},e);qe(r);var n=Pe(r);return Te({model:t}).then((function(i){return we({libraryIds:n,model:t}).then((function(n){return f&&function(e){var t=e.properties;Se(t).forEach((function(e){return function(e){var t=e.measure,r=e.properties;if(Ne({measure:t,properties:r})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(n++,"object"!==fe(pe[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=pe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ae(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),ge({model:t,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:n,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===fe(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,r=e.properties,n=Pe(r);return je({model:t,libraryIds:n}).then((function(){var e=i()(!0,{},r);return Se(r).forEach((function(e){return ve(e)})),Re({oldProperties:e,newProperties:r,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,r=e.oldProperties,n=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?i()(!0,{},n):n),qe(n);var m=Pe(n);return je({model:t,libraryIds:m,masterItem:u}).then((function(){return function(e){var t=e.measures,r=e.properties,n=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=Se(r)),!t.length)return Promise.resolve();if(!be({measures:t,properties:r}))return t.forEach((function(e){return ve(e)})),Promise.resolve();var l=a?void 0:Pe(r);return Te({model:n,dimensionAndFieldList:s}).then((function(e){return we({libraryIds:l,model:n,libraryItemsProps:a}).then((function(n){t.forEach((function(t){Ie({modifiers:t.qDef.modifiers,properties:r})?(function(e){var t=e.measure,r=e.properties,n=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;me.isValid(t)||me.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(s++,"object"!==fe(pe[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)");pe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,r=e.modifier,n=e.libraryId,o=e.properties,a=e.libraryItemsProps,s=e.dimensionAndFieldList,l=a[n],u=l.qMeasure.qDef,c=pe[r.type].generateExpression({expression:u,modifier:r,properties:o,dimensionAndFieldList:s});r.outputExpression=c,t.qDef.qDef=r.outputExpression,(t.qDef.qLabel||l.qMeasure.qLabel)&&(t.qDef.qLabel=l.qMeasure.qLabel),(t.qDef.qLabelExpression||l.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=l.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&l.qMeasure.qNumFormat&&(t.qDef.qNumFormat=l.qMeasure.qNumFormat,t.qDef.isCustomFormatted=l.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=l.qMeasure.coloring,r.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:r,libraryItemsProps:n,dimensionAndFieldList:a}):function(e){var t=e.measure,r=e.modifier,n=e.properties,o=e.dimensionAndFieldList;"function"==typeof pe[r.type].updateModifier&&pe[r.type].updateModifier(r,n.qHyperCubeDef);var a=ce.getExpression(t),s=pe[r.type].generateExpression({expression:a,modifier:r,properties:n,dimensionAndFieldList:o});r.outputExpression=s,t.qDef.qDef=r.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,r.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o.getValue(e,"qDef.qAggrFunc");"Expr"!==t||Me(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Me(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:r,libraryItemsProps:n,dimensionAndFieldList:e}),Oe(t)):ve(t)}))}))}))}({measures:a,properties:n,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Re({oldProperties:r,newProperties:n,model:t}):Promise.resolve(!1)}))}))}function ve(e){!function(e){var t=Ee(e);return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&!pe[e.type]}))}(e)?me.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Oe(e)}function be(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ie({modifiers:Ee(e),properties:r,layout:n})}))}function xe(e){var t=Ee(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(pe[n.type]&&!n.disabled)return n}}function Me(e){var t=xe(e);return!t||pe[t.type].enableTotalsFunction(e)}function Se(e){return o.getValue(e,"qHyperCubeDef.qMeasures",[]).concat(o.getValue(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Ee(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ce(e){return o.getValue(e,"outputExpression.qValueExpression.qExpr")||o.getValue(e,"outputExpression")}function qe(e){Se(e).forEach((function(e){return function(e){var t=xe(e);t&&(void 0!==t.outputExpression&&Ce(t)!==e.qDef.qDef?delete e.qDef.base:!me.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Oe(e){var t=Ee(e);Array.isArray(t)&&t.forEach((function(t){"object"===fe(t)&&(t.disabled||!pe[t.type]&&Ce(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ae(e){return e.base||e.qDef&&e.qDef.base}function De(e){var t=Ae(e);return e.qLibraryId||t&&t.qLibraryId}function Ne(e){var t=e.measure,r=e.properties,n=e.layout;return!De(t)&&Ie({modifiers:Ee(t),properties:r,layout:n})}function Ie(e){var t=e.modifiers,r=e.properties,n=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==fe(e)||e.disabled||!pe[e.type])&&(void 0===i[e.type]&&(i[e.type]=pe[e.type].isApplicable({properties:r,layout:n})),i[e.type])}))}function Te(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));n.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return n.push(a),Promise.all(n).then((function(){return i}))}function we(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=r.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=r.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 Le(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Re(e){var t=e.oldProperties,r=e.newProperties,n=e.model,i=JSON.stringify(o.getValue(t,"qHyperCubeDef.qMeasures"),Le)!==JSON.stringify(o.getValue(r,"qHyperCubeDef.qMeasures"),Le)||JSON.stringify(o.getValue(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Le)!==JSON.stringify(o.getValue(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Le);return i?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o.getValue(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):L.saveSoftProperties(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then((function(){return i})):Promise.resolve(i)}function ke(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&pe[e.type]&&pe[e.type].needDimension({modifier:e,properties:r,layout:n})}))}function Pe(e){var t=Se(e),r=[],n=[],i=!1;return t.forEach((function(t){var n=Ee(t);if(Ie({modifiers:n,properties:e})){var o=De(t);o&&r.push(o),i=i||ke({modifiers:n,properties:e})}})),o.getValue(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&n.push(t)})),{measureLibraryIds:r,dimensionLibraryIds:n}}function je(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(he[t.id].masterItemSubscriber=he[t.id].masterItemSubscriber||ue({model:t,callback:function(e){return ye({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),he[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}}])},"./axis-chart/export-properties/index.js":
19
+ function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/qlik-modifiers/",r(r.s=1)}([function(e,t,r){var n=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,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(t in e);return void 0===t||n.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(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,r,n,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(r in t)n=c(d,r),d!==(i=c(t,r))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=n&&s(n)?n:[]):a=n&&l(n)?n:{},u(d,{name:r,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:r,newValue:i}));return d}},function(e,t,r){r.r(t);var n=r(0),i=r.n(n),o={setValue:function(e,t,r){if(!t)return!1;var n,i=t.split("."),o=i[i.length-1],a=e;for(n=0;n<i.length-1;++n)void 0===a[i[n]]&&(a[i[n]]=Number.isNaN(+i[n+1])?{}:[]),a=a[i[n]];if(void 0!==r){var s=a[o];return a[o]=r,{updated:r,previous:s}}return delete a[o],!1},getValue:function(e,t,r){var n,i=t.split("."),o=e;if(void 0===o)return r;for(n=0;n<i.length;++n){if(void 0===o[i[n]])return r;o=o[i[n]]}return o}},a="".concat(" ","(").concat(" "),s="".concat(" ",")").concat(" ");function l(e){return a+e+s}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var r=function(e,t){if(!t)return null;var r,n;for(r=0;r<t.length;r++)if((n=t[r]).qInfo.qId===e)return n;return null}(e.qLibraryId,t.dimensionList);return r&&r.qData.info[0].qTags.indexOf("$numeric")>-1}var n=function(e,t){if(!t)return null;var r,n,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var r=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(r)&&(t=(t=t.substring(1,r)).trim()),t}(e);for(r=0;r<t.length;r++){if((n=t[r]).qName===i)return n;if(n.qDerivedFieldData)for(var o=0;o<n.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=n.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 n&&n.qTags.indexOf("$numeric")>-1}function c(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var r=e.crossAllDimensions;return 2===t&&r?"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 f(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function p(e,t){var r=e.crossAllDimensions;return 2===t&&r?"Above(Total ":"Above("}function h(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 g(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!r.showExcludedValues)return"";if(n&&1===n.length){var c=y(u(n[0],i),f(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(n&&2===n.length){var d=u(n[0],i),m=u(n[1],i),p=f(0),h=f(1),g=y(d,p),v=y(m,h);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function v(e){return"".concat(e,"(")}function b(){return")"}function x(e){var t=e.properties,r=e.layout;return o.getValue(t,"qHyperCubeDef.qDimensions",o.getValue(r,"qHyperCube.qDimensionInfo",[])).length}var M={isFullRange:c,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=l(m(t));if(!r.showExcludedValues)return a;var s=g({modifier:r,dimensions:n,dimensionAndFieldList:i}),u=o?"":", 0";if(n&&1===n.length){var c=f(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(u,")")}if(n&&2===n.length){var d=f(0),p=f(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(u,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!c(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return d(e,t)},getAboveCompPrefix:p,getAboveCompSuffix:h,getAboveComp:function(e,t,r,n){return p(e,t)+r+h(n)},getFunctionPrefix:v,getFunctionSuffix:b,getRangeComp:function(e,t){return v(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:g,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:r,layout:n})},getDimComp:function(e,t){var r=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),n=f(t);if(!r.qSortByExpression&&!r.qSortByNumeric&&!r.qSortByAscii)return n;var i=["Descending","Ascending"],o=r.qSortByNumeric?"(Numeric, ".concat(i[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(i[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(o,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(o,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(a);if(-1!==r){var n=t.indexOf(s);if(-1!==n)return t.substring(r+a.length,n)}}},initModifier:function(e,t){Object.keys(t).forEach((function(r){void 0===e[r]&&(e[r]=t[r])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,r=e.layout,n=e.minDimensions,i=void 0===n?1:n,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!r)return!0;var s=x({properties:t,layout:r});return s>=i&&s<=a},getExpressionWithMarkers:l,canExtract:function(e){var t=e.indexOf(a),r=e.indexOf(s);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:f,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function S(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(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")}()}function E(e){return(E="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 C=i.a.bind(null,!0),q={},O=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function D(e){return void 0===e}function N(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function I(e,t){var r,n=t.substring(1).split("/").slice(0,-1);return n.forEach((function(t,i){if(i!==n.length){r=+t;var o=Number.isNaN(r)?{}:[];e[r||t]=D(e[r||t])?o:e[t],e=e[r||t]}})),e}function T(e,t){var r=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(n){T(e[n],t[n])||(r=!1)})),r);if(O(e)&&O(t)){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n+=1)if(!T(e[n],t[n]))return!1;return!0}return e===t}q.generate=function(e,t,r){r=r||"";var n=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(r,"/").concat(i);T(o,a)||N(t,i)||(D(a)?n.push({op:"add",path:s,value:o}):A(o)&&A(a)?n=n.concat(q.generate(a,o,s)):O(o)&&O(a)?n=n.concat(function(e,t,r){var n=[],i=e.slice(),o=-1;function a(e,t,r){if(e[r]&&D(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,i=e.length;n<i;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(T(t,i))return n;if(!D(t[0])&&D(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(n.push({op:"remove",path:"".concat(r,"/").concat(s)}),i.splice(s,1)):n=n.concat(q.generate(i[s],t[o],"".concat(r,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(n.push({op:"move",path:"".concat(r,"/").concat(l),from:"".concat(r,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return n}(a,o,s)):n.push({op:"replace",path:"".concat(r,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!N(e,i)&&n.push({op:"remove",path:"".concat(r,"/").concat(i)})})),n},q.apply=function(e,t){t.forEach((function(t){var r,n=I(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?n[i]:n[+i]||n,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,o=e),"add"===t.op||"replace"===t.op)if(O(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(O(o)&&O(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,S(l))}else if(A(o)&&A(t.value))r=o,Object.keys(r).forEach((function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!N(r,e)&&delete r[e]})),C(o,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[i]=t.value}else if("move"===t.op){var u=I(e,t.from);O(n)?n.splice(+i,0,u.splice(+a,1)[0]):(n[i]=u[a],delete u[a])}else"remove"===t.op&&(O(n)?n.splice(+i,1):delete n[i])}))},q.clone=function(e){return C({},e)},q.createPatch=function(e,t,r){var n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):C(e,t)};var w=q,L={saveSoftProperties:function(e,t,r){if(!e)return Promise.resolve();var n=w.generate(t,r);return i()(!0,t,r),n&&n.length?(n=n.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(n,!0)):Promise.resolve()}},R="accumulation";function k(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===R)return r[n]}function P(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===R)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=M.getNumStepComp(r,l),m=M.getAboveComp(r,l,c,d),f=M.getRangeComp("RangeSum",m);if(M.needDimension({modifier:r,properties:n,layout:i})){var p=M.getDimComp(u,1),h=M.getDimComp(u,0),y=M.getAggrComp(f,p,h);f=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,j)},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!M.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 r=k(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=k(t,e);return r&&!r.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 M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=k(t,e);return o&&!o.disabled}}}},V="movingAverage";function _(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===V)return r[n]}function B(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===V)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},$={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!n)return r;var u=s;void 0===u&&(u=M.getNumDimensions({properties:i,layout:a}));var c=o.getValue(i,"qHyperCubeDef.qDimensions",[]),d=n.showExcludedValues&&n.nullSuppression,m=M.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=M.getNumStepComp(n,u),p=M.getAboveComp(n,u,m,f);if(n.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var h=M.getRangeComp("RangeSum",p),y=function(e,t){var r=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var n=e.steps,i="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(i,", ").concat(r,")")}return r}(n,u);t="".concat(h," / ").concat(y)}var g=t;if(M.needDimension({modifier:n,properties:i,layout:a})){var v=M.getDimComp(c,1),b=M.getDimComp(c,0),x=M.getAggrComp(g,v,b);g=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(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(B(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(B(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(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=_(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=_(t,e);return r&&!r.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=_(t,e);return o&&!o.disabled}}}},z="difference";function U(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===z)return r[n]}function Y(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===z)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var W={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},G={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=M.getAboveComp(r,l,c),m="".concat(c," - ").concat(d);if(M.needDimension({modifier:r,properties:n,layout:i})){var f=M.getDimComp(u,1),p=M.getDimComp(u,0),h=M.getAggrComp(m,f,p);m=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return m},initModifier:function(e){Object.keys(W).forEach((function(t){void 0===e[t]&&(e[t]=W[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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Y(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(Y(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(Y(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=U(t,e);return o&&!o.disabled}}}},K={SELECTION:{CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},DIMENSION:{ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2}},X="normalization";function J(e,t){var r=o.getValue(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===X)return r[n]}function Z(e,t){var r=function(e,t){var r=o.getValue(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===X)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}function Q(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}function ee(e,t,r,n){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.DIMENSION.ONE_DIMENSION,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.DIMENSION.ALL_DIMENSIOANS,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,r){if(e<2){var n=Q(t,0);t.splice(n,1)}return t}(i,o),function(e,t,r){if(0===e){var n=Q(t,1);t.splice(n,1)}return t}(J(e,n).selectionScope,o)}function te(e,t,r){var n=[{value:K.SELECTION.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECTION.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.SELECTION.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,r){if(1===e){var n=Q(t,0);t.splice(n,1)}return t}(J(e,r).dimensionalScope,n)}var re={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,selectionScope:K.SELECTION.DISREGARD_SELECTION};function ne(e){return 2===e?"{1}":""}function ie(e,t,r){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,r){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(r),">"):""}function se(e,t,r,n,i,o,a){var s=ne(t),l=ie(t,r,n),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),m=function(e){for(var t=[],r=0;r<e;r++)t[r]=M.getDimDefWithWrapper(r);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(m,"))")}var le={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return M.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:n,layout:i}));var u=o.getValue(n,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=r.selectionScope,m=r.dimensionalScope;return se(c,d,r.field,r.value,m,l,r.primaryDimension)},initModifier:function(e){Object.keys(re).forEach((function(t){void 0===e[t]&&(e[t]=re[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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.SELECTION.DISREGARD_SELECTION,options:function(r){return te(r,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,r){return r.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===K.SELECTION.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECTION.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DIMENSION.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(r,n){return ee(r,n,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,r){return(J(t,e).dimensionalScope||0)===K.DIMENSION.ONE_DIMENSION&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:ne,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae};function ue(e){var t=e.model,r=e.callback,n={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},r=o.getValue(e,"qInfo.qType");return r&&s[r]&&s[r].forEach((function(r){t[r]=o.getValue(e,r)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var i=l(e);n[t].properties!==i&&(n[t].properties=i,"function"==typeof r&&n[t].enabled&&r(e)),n[t].enabled=!0}}function c(e,r){return t.app[r](e).then((function(t){n[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var r=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.measureLibraryIds,r=e.dimensionLibraryIds;i={},t.forEach((function(e){i[e]=!0})),a={},r.forEach((function(e){a[e]=!0}))}({measureLibraryIds:r,dimensionLibraryIds:o}),Object.keys(n).forEach((function(e){i[e]||a[e]||(n[e].listener.dispose(),delete n[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!n[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!n[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(n).forEach((function(e){n[e].listener.dispose()})),n={}}}}var ce={getExpression:function(e){return o.getValue(e,"qDef.base.qDef")||o.getValue(e,"qDef.qDef")},getExpressionRef:function(e){return o.getValue(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return o.getValue(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return o.getValue(e,"qDef.base.qLibraryId")||o.getValue(e,"qLibraryId")},getLabelRef:function(e){return o.getValue(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o.getValue(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},de={initBase:function(e,t){(t||de.isValid(e))&&(o.setValue(e,"qDef.base.qDef",o.getValue(e,"qDef.qDef")),o.setValue(e,"qDef.base.qLibraryId",o.getValue(e,"qLibraryId")),o.setValue(e,"qDef.base.qLabel",o.getValue(e,"qDef.qLabel")),o.setValue(e,"qDef.base.qLabelExpression",o.getValue(e,"qDef.qLabelExpression")))},restoreBase:function(e){de.isValid(e)&&(o.setValue(e,"qDef.qDef",o.getValue(e,"qDef.base.qDef")),o.setValue(e,"qLibraryId",o.getValue(e,"qDef.base.qLibraryId")),o.setValue(e,"qDef.qLabel",o.getValue(e,"qDef.base.qLabel")),o.setValue(e,"qDef.qLabelExpression",o.getValue(e,"qDef.base.qLabelExpression")),o.getValue(e,"qDef.qAggrFunc")&&o.getValue(e,"qDef.base.qAggrFunc")&&o.setValue(e,"qDef.qAggrFunc",o.getValue(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=o.getValue(e,"qDef.base.qDef"),r=o.getValue(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==r}},me=de;function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var pe={accumulation:F,movingAverage:$,difference:G,normalization:le},he=(t.default={modifiers:pe,apply:ye,applyModifiers:ge,cleanUpMeasure:ve,destroy:function(e){e&&he[e.id]&&he[e.id].masterItemSubscriber&&(he[e.id].masterItemSubscriber&&he[e.id].masterItemSubscriber.unsubscribe(),delete he[e.id])},hasActiveModifiers:be,getActiveModifier:xe,initBase:me.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return pe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return pe[e]&&pe[e].isApplicable({properties:r,layout:n})}))},measureBase:ce,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Ee(e);Ie({modifiers:t,properties:r,layout:n})&&(i=!0,o=o||ke({modifiers:t,properties:r,layout:n}))})),i&&!o},ifEnableTotalsFunction:Me},{});function ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,r=e.properties,n=e.isSnapshot,a=void 0!==n&&n,s=e.masterItem;he[t.id]=he[t.id]||{isFirstTime:!0};var l=he[t.id].isFirstTime;if(he[t.id].isFirstTime=!1,r&&"object"===fe(r))return ge({model:t,properties:r});var u=t?t.layout:void 0,c=o.getValue(u,"qSelectionInfo.qInSelections");if(a||c)return Promise.resolve(!1);var d=o.getValue(u,"qHyperCube.qMeasureInfo"),m=he[t.id].lastReloadTime;if(he[t.id].lastReloadTime=o.getValue(t,"app.layout.qLastReloadTime"),be({measures:d,layout:u})){var f=function(e){var t=e.measures,r=e.layout,n=e.model,i=e.lastReloadTime;return o.getValue(n,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ne({measure:e,properties:r,layout:n})}))}({measures:t,layout:r})}({measures:d,layout:u,model:t,lastReloadTime:m});return f||function(e){var t=e.measures,r=e.layout,n=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||n||t.some((function(e){return function(e){var t=e.measure,r=e.layout;return Ie({modifiers:Ee(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var r=i()(!0,{},e);qe(r);var n=Pe(r);return Te({model:t}).then((function(i){return we({libraryIds:n,model:t}).then((function(n){return f&&function(e){var t=e.properties;Se(t).forEach((function(e){return function(e){var t=e.measure,r=e.properties;if(Ne({measure:t,properties:r})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(n++,"object"!==fe(pe[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=pe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ae(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),ge({model:t,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:n,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===fe(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,r=e.properties,n=Pe(r);return je({model:t,libraryIds:n}).then((function(){var e=i()(!0,{},r);return Se(r).forEach((function(e){return ve(e)})),Re({oldProperties:e,newProperties:r,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,r=e.oldProperties,n=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?i()(!0,{},n):n),qe(n);var m=Pe(n);return je({model:t,libraryIds:m,masterItem:u}).then((function(){return function(e){var t=e.measures,r=e.properties,n=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=Se(r)),!t.length)return Promise.resolve();if(!be({measures:t,properties:r}))return t.forEach((function(e){return ve(e)})),Promise.resolve();var l=a?void 0:Pe(r);return Te({model:n,dimensionAndFieldList:s}).then((function(e){return we({libraryIds:l,model:n,libraryItemsProps:a}).then((function(n){t.forEach((function(t){Ie({modifiers:t.qDef.modifiers,properties:r})?(function(e){var t=e.measure,r=e.properties,n=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;me.isValid(t)||me.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===fe(e)&&!e.disabled){if(s++,"object"!==fe(pe[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)");pe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,r=e.modifier,n=e.libraryId,o=e.properties,a=e.libraryItemsProps,s=e.dimensionAndFieldList,l=a[n],u=l.qMeasure.qDef,c=pe[r.type].generateExpression({expression:u,modifier:r,properties:o,dimensionAndFieldList:s});r.outputExpression=c,t.qDef.qDef=r.outputExpression,(t.qDef.qLabel||l.qMeasure.qLabel)&&(t.qDef.qLabel=l.qMeasure.qLabel),(t.qDef.qLabelExpression||l.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=l.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&l.qMeasure.qNumFormat&&(t.qDef.qNumFormat=l.qMeasure.qNumFormat,t.qDef.isCustomFormatted=l.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=l.qMeasure.coloring,r.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:r,libraryItemsProps:n,dimensionAndFieldList:a}):function(e){var t=e.measure,r=e.modifier,n=e.properties,o=e.dimensionAndFieldList;"function"==typeof pe[r.type].updateModifier&&pe[r.type].updateModifier(r,n.qHyperCubeDef);var a=ce.getExpression(t),s=pe[r.type].generateExpression({expression:a,modifier:r,properties:n,dimensionAndFieldList:o});r.outputExpression=s,t.qDef.qDef=r.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,r.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o.getValue(e,"qDef.qAggrFunc");"Expr"!==t||Me(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Me(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:r,libraryItemsProps:n,dimensionAndFieldList:e}),Oe(t)):ve(t)}))}))}))}({measures:a,properties:n,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Re({oldProperties:r,newProperties:n,model:t}):Promise.resolve(!1)}))}))}function ve(e){!function(e){var t=Ee(e);return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&!pe[e.type]}))}(e)?me.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Oe(e)}function be(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ie({modifiers:Ee(e),properties:r,layout:n})}))}function xe(e){var t=Ee(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(pe[n.type]&&!n.disabled)return n}}function Me(e){var t=xe(e);return!t||pe[t.type].enableTotalsFunction(e)}function Se(e){return o.getValue(e,"qHyperCubeDef.qMeasures",[]).concat(o.getValue(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Ee(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ce(e){return o.getValue(e,"outputExpression.qValueExpression.qExpr")||o.getValue(e,"outputExpression")}function qe(e){Se(e).forEach((function(e){return function(e){var t=xe(e);t&&(void 0!==t.outputExpression&&Ce(t)!==e.qDef.qDef?delete e.qDef.base:!me.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Oe(e){var t=Ee(e);Array.isArray(t)&&t.forEach((function(t){"object"===fe(t)&&(t.disabled||!pe[t.type]&&Ce(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ae(e){return e.base||e.qDef&&e.qDef.base}function De(e){var t=Ae(e);return e.qLibraryId||t&&t.qLibraryId}function Ne(e){var t=e.measure,r=e.properties,n=e.layout;return!De(t)&&Ie({modifiers:Ee(t),properties:r,layout:n})}function Ie(e){var t=e.modifiers,r=e.properties,n=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==fe(e)||e.disabled||!pe[e.type])&&(void 0===i[e.type]&&(i[e.type]=pe[e.type].isApplicable({properties:r,layout:n})),i[e.type])}))}function Te(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));n.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return n.push(a),Promise.all(n).then((function(){return i}))}function we(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=r.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=r.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 Le(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Re(e){var t=e.oldProperties,r=e.newProperties,n=e.model,i=JSON.stringify(o.getValue(t,"qHyperCubeDef.qMeasures"),Le)!==JSON.stringify(o.getValue(r,"qHyperCubeDef.qMeasures"),Le)||JSON.stringify(o.getValue(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Le)!==JSON.stringify(o.getValue(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Le);return i?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o.getValue(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):L.saveSoftProperties(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then((function(){return i})):Promise.resolve(i)}function ke(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===fe(e)&&!e.disabled&&pe[e.type]&&pe[e.type].needDimension({modifier:e,properties:r,layout:n})}))}function Pe(e){var t=Se(e),r=[],n=[],i=!1;return t.forEach((function(t){var n=Ee(t);if(Ie({modifiers:n,properties:e})){var o=De(t);o&&r.push(o),i=i||ke({modifiers:n,properties:e})}})),o.getValue(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&n.push(t)})),{measureLibraryIds:r,dimensionLibraryIds:n}}function je(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(he[t.id].masterItemSubscriber=he[t.id].masterItemSubscriber||ue({model:t,callback:function(e){return ye({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),he[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}}])},"./axis-chart/export-properties/index.js":
20
20
  /*!***********************************************!*\
21
21
  !*** ./axis-chart/export-properties/index.js ***!
22
22
  \***********************************************/
@@ -971,4 +971,4 @@ function(e,t,r){r.r(t),t.default={useMasterNumberFormat:function(e){e.quarantine
971
971
  !*** ./utils/wrap-file-name.js ***!
972
972
  \*********************************/
973
973
  /*! exports provided: default */
974
- function(e,t,r){function n(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e}r.r(t),r.d(t,"default",(function(){return n}))}})}));var BS=P($S.exports);const US={version:"1.8.9",qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},showTitles:!0,subtitle:"",title:"",footnote:"",barGrouping:{grouping:"grouped"},orientation:"vertical",scrollStartPos:0,nullMode:"gap",dataPoint:{show:!1,showLineLabels:!1,showBarLabels:!1},color:{auto:!0,mode:"primary",useBaseColors:"off",paletteColor:{index:6},useDimColVal:!0,useMeasureGradient:!0,persistent:!1,expressionIsColor:!0,expressionLabel:"",measureScheme:"sg",reverseScheme:!1,dimensionScheme:"12",autoMinMax:!0,measureMin:0,measureMax:10},legend:{dock:"auto",show:!0,showTitle:!0},components:[],dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},measureAxes:[{show:"all",dock:"near",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10},{show:"all",dock:"far",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10}],refLine:{refLines:[],refLines2:[],dimRefLines:[]},preferContinuousAxis:!0,showMiniChartForContinuousAxis:!0,tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}};var YS=e=>t=>{const r=t.qHyperCubeDef.qMeasures,n=[0,0,0];let i;if(!r.length)return e.get("Visualizations.Descriptions.Bars");for(let e=0;e<r.length;++e)i=Lf(r[e].qDef.series),i===ta.BAR?n[0]=1:i===ta.LINE?n[1]=1:n[2]=1;const o=["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Line","Visualizations.Descriptions.ComboChart.Dimension.LineMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarLine","Visualizations.Descriptions.ComboChart.Dimension.BarLineMarker"][parseInt(n.join(""),2)-1];return e.get(o)},WS=e=>(t,r)=>{let n;const i=t.qHyperCubeDef.qMeasures[r];if(i){const{type:e}=i.qDef.series;n=e===ta.LINE?"Visualizations.Descriptions.HeightLine":e===ta.BAR?"Visualizations.Descriptions.LengthBars":"Visualizations.Descriptions.ComboChart.Measure.HeightMarker"}else n=r?"Visualizations.Descriptions.HeightLine":"Visualizations.Descriptions.LengthBars";return e.get(n)};function GS(e){var t,r;const n=e.qHyperCubeDef.qMeasures,i=null===(t=e.color)||void 0===t?void 0:t.mode;"byDimension"===i&&1===n.length&&Lf(null===(r=n[0].qDef)||void 0===r?void 0:r.series)===ta.LINE?e.color.mode="primary":"byDimension"===i&&n.length>1&&(e.color.mode="byMultiple")}function KS(e){const{translator:t}=e;return{dimensions:{min:1,max:1,description:YS(t)},measures:{min:1,max:15,description:WS(t),added({qDef:e},t){var r;GS(t),null!==(r=e.series)&&void 0!==r&&r.type||(t.qHyperCubeDef.qMeasures.length>1?e.series={type:ta.LINE,axis:ra.SECONDARY}:e.series={type:ta.BAR,axis:ra.PRIMARY})},moved(e,t){GS(t)}}}}function XS(e){const t=KS(e);return{properties:US,data:{targets:[{path:"/qHyperCubeDef",...t}]},importProperties:({exportFormat:e,initialProperties:r,hypercubePath:n})=>{const i=BS.axisChart.importProperties({exportFormat:e,initialProperties:r,dataDefinition:t,hypercubePath:n}),o="linechart"===e.properties.visualization,a=[];i.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:o?"line":"bar",axis:0,marker:"circle",markerFill:!0}),a.indexOf(e.qDef.series.axis)<0&&a.push(e.qDef.series.axis)}));const s=a.sort().shift();return i.qProperty.measureAxes[s]&&e.properties.measureAxis&&void 0!==e.properties.measureAxis.autoMinMax&&U(!0,i.qProperty.measureAxes[s],e.properties.measureAxis,{logarithmic:!1}),i},exportProperties:({propertyTree:e,hyperCubePath:t,viewDataMode:r})=>BS.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:r})}}function JS(){const e={component:"dropdown",type:"string",expression:"optional",baseRef:"style.strokeWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:"none",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"}]},t={component:"color-picker",type:"object",baseRef:"style.strokeColor",translation:"LayerStyleEditor.style.strokeColor",dualOutput:!0,show:t=>"none"!==rc(t,`${((e,t)=>{let r=-1;for(let n=0;n<e.length;n++)if(e[n].key===t){r=n;break}return r})(t,"bar")}.${e.baseRef}`),defaultValue:()=>({index:-1,color:"#205891"})},r={component:"slider",type:"number",expression:"optional",baseRef:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:6,min:3,max:20,step:1},n={component:"slider",type:"number",expression:"optional",baseRef:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:1,min:1,max:5,step:1},i={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"solid",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}]},o={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",show:!0,defaultValue:"linear",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]};return{component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:["bar","line"],ref:"components",defaultValue:[],defaultValues(a){const s="grouped"===a.barGrouping.grouping,l=a.qHyperCubeDef.qMeasures.filter((e=>Lf(e.qDef.series)===ta.BAR)).length,u=s&&l>1;return[{key:"bar",style:{strokeWidth:e.defaultValue,strokeColor:t.defaultValue(),width:u?.9:.7}},{key:"line",style:{dataPointSize:r.defaultValue,lineThickness:n.defaultValue,lineType:i.defaultValue,lineCurve:o.defaultValue}}]},items:{list:{type:"items",component:"expandable-items",items:{bar:{type:"items",translation:"Visualizations.Descriptions.Bar",expanded:!0,styleKey:"bar",items:{barStrokeWidth:e,barStrokeColor:t,barWidth:{component:"slider",type:"number",expression:"optional",baseRef:"style.width",translation:"LayerStyleEditor.style.barWidth",show:(e,t,r)=>{const n=t.getMeasures().some((e=>Lf(e.qDef.series)===ta.LINE));return!oe.continuous(r.layout,n&&ee.isTime(!0,r.layout))},defaultValue:.7,min:.01,max:1,step:.01}}},line:{type:"items",translation:"Visualizations.Descriptions.Line",expanded:!0,styleKey:"line",items:{dataPointSize:r,lineThickness:n,lineType:i,lineCurve:o}}}}}}}function ZS(e){const t=rc(e,"qHyperCube.qMeasureInfo",[]).some((({series:e=na})=>Lf(e)===ta.LINE));return oe.continuous(e,(()=>t&&ee.isTime(!0,e)))}function QS(e){var t,r;return!(null===(t=e.qDef)||void 0===t||null===(r=t.color)||void 0===r||!r.on)}function eE(e){var t,r,n;return QS(e)&&"primary"===(null!==(t=null===(r=e.qDef)||void 0===r||null===(n=r.color)||void 0===n?void 0:n.mode)&&void 0!==t?t:"primary")}function tE(e){var t,r;return QS(e)&&"byExpression"===(null===(t=e.qDef)||void 0===t||null===(r=t.color)||void 0===r?void 0:r.mode)}function rE(e){var t,r,n,i,o;if(null!=e&&null!==(t=e.color)&&void 0!==t&&t.auto||"byExpression"!==(null==e||null===(r=e.color)||void 0===r?void 0:r.mode))return[];const a=null==e||null===(n=e.color)||void 0===n?void 0:n.colorExpression,s=null!==(i=null==e||null===(o=e.color)||void 0===o?void 0:o.expressionLabel)&&void 0!==i?i:"";return a?[{qExpression:a,label:s,id:"colorByExpression"}]:[]}function nE(e){return tE(e)?[{qExpression:e.qDef.color.colorExpression,id:"colorByMeasureExpression"}]:[]}function iE(e){var t,r;(null!==(t=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)&&void 0!==t?t:[]).forEach(((t,r)=>function(e,t,r){e.qAttributeExpressions=0===t?[...rE(r),...nE(e)]:nE(e)}(t,r,e)))}function oE(e){const{flags:t}=e,r={ref:"qDef.series.type",type:"string",component:"item-selection-list",defaultValue:"bar",schemaIgnore:!0,horizontal:!0,items:[{icon:e=>"stacked"===e.barGrouping.grouping||ZS(e)?"stacked":"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.bar",value:"bar"},{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"shapes",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.marker",value:"marker"}],change:e=>(e.qDef.series.type!==ta.BAR||t.isEnabled("BARS_IN_SECONDARY_AXIS")||(e.qDef.series.axis=0),e)},n={ref:"qDef.series.axis",type:"integer",component:"dropdown",defaultValue:0,options:[{translation:"properties.axis.primary",value:0},{translation:"properties.axis.secondary",value:1}],show(e){var r;return!!t.isEnabled("BARS_IN_SECONDARY_AXIS")||Lf(null===(r=e.qDef)||void 0===r?void 0:r.series)!==ta.BAR}},i={ref:"qDef.series.marker",type:"string",component:"dropdown",defaultValue:"circle",options:[{translation:"properties.marker.circle",value:"circle"},{translation:"properties.marker.rect",value:"rect"},{translation:"properties.marker.diamond",value:"diamond"},{translation:"properties.marker.triangle",value:"triangle"},{translation:"properties.marker.line",value:"line"}],show(e){var t;return Lf(null===(t=e.qDef)||void 0===t?void 0:t.series)===ta.MARKER}},o={ref:"qDef.series.markerFill",translation:"properties.series.fill",type:"boolean",defaultValue:!0,show(e){var t;return Lf(null===(t=e.qDef)||void 0===t?void 0:t.series)===ta.MARKER&&!["line"].includes(e.qDef.series.marker)}};let a;if(t.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")){var s,l;const t={ref:"qDef.color.on",translation:"properties.colors",type:"boolean",component:"switch",defaultValue:!1,trueOption:{value:!1,translation:"Common.Auto"},falseOption:{value:!0,translation:"Common.Custom"}},u={ref:"qDef.color.mode",type:"string",component:"dropdown",options:[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:(...e)=>QS(...e)},c=null===(s=e.anything)||void 0===s||null===(l=s.sense)||void 0===l?void 0:l.theme;a={supPanel:{translation:"properties.measure.moreProperties",title:"properties.measure.moreProperties",subTitle:(e,t,r)=>{var n;return null===(n=r.measureTitle)||void 0===n?void 0:n.call(r)},component:"sub-panel",type:"items",items:{groups:{type:"items",component:"expandable-items",items:{presentation:{type:"items",translation:"properties.presentation",items:{seriesType:r,seriesAxis:n,seriesMarker:i,seriesMarkerFill:o}},color:{type:"items",translation:"properties.color",items:{customColor:t,colorMode:u,paletteColor:{ref:"qDef.color.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{var e;const{primary:t}=c.getDataColorSpecials(),r=null===(e=c.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,n=r.indexOf(t);return{index:-1===n?Math.min(6,r.length-1):n}},show:eE},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"qDef.color.colorExpression",translation:"Common.Expression",show:tE}}}}}}}}}else a={seriesType:r,seriesAxis:n,seriesMarker:i,seriesMarkerFill:o};return{items:{series:{type:"items",items:a}}}}function aE(e,t,r,n){let i;const o=r||0;var a,s;t?i=t.getMeasureLayouts():i=null!==(a=null==e||null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qMeasures)&&void 0!==a?a:[];return i.filter((e=>{const{series:t}=e||{};return 0===o?iv(t,n):!iv(t,n)}))}function sE(e,t){return t.getMeasures().filter((e=>Lf(e.qDef.series)===ta.LINE)).length>0}function lE(e,t,r,n){const i=t.getMeasures().filter((e=>Lf(e.qDef.series)===ta.BAR));return n?i.filter((e=>e.qDef.series.axis===ra.PRIMARY)).length>r||i.filter((e=>e.qDef.series.axis===ra.SECONDARY)).length>r:i.length>r}function uE(e){const{translator:t,flags:r}=e,n=r.isEnabled("BARS_IN_SECONDARY_AXIS"),i={items:{attributeExpression:{ref:"color.colorExpression",change:null,globalChange:e=>iE(e)},expressionLabel:{change:null},disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>r.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&e.qHyperCubeDef.qMeasures.some((e=>QS(e)))}}},o={uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{comboStyling:JS(),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,r)=>lE(0,t,1,n)&&!ZS(r.layout)},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,r)=>ZS(r.layout),convertFunctions:(a="vertical",{get:(e,t,r)=>ZS(r.layout)?a:e(t.type),set(e,t,r,n){t(r.type,ZS(n.layout)?a:e,a)}})},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,r)=>!ZS(r.layout)},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap",show:(e,t)=>sE(0,t)},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint"},show:(e,t)=>sE(0,t),items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showLineDataPointLabels:{ref:"dataPoint.showLineLabels",translation:"properties.dataPoints.linelabelmode",type:"boolean",component:"switch",defaultValue:!1,show:e=>e.dataPoint&&e.dataPoint.show,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},showBarLabels:{ref:"dataPoint.showBarLabels",type:"boolean",translation:"properties.dataPoints.barlabelmode",component:"switch",show:(e,t)=>lE(0,t,0,n),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:i,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label(e,r){const n="vertical"===r.layout.orientation||ZS(r.layout)?"x":"y",i=function(e,t){return t?t.getDimensionLayouts():e.qHyperCubeDef.qDimensions.map((e=>e.qDef))}(e,r).map((e=>e.qFallbackTitle||"")).join(", ");let o;return o=i?t.get(`properties.${n}AxisWithInfo`,[i]):t.get(`properties.${n}Axis`),o},items:{othersGroup:{items:{dock:{options(e,t,r){let n="Common.Bottom",i="Common.Top";return"vertical"===r.layout.orientation||ZS(r.layout)||(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,r)=>!ZS(r.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",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:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e){const{qDimensions:t,qMeasures:r}=e.qHyperCubeDef,{maxVisibleItems:n}=e.dimensionAxis;return n<0||n>1e4/(t.length+r.length)},globalChange(e){if("custom"===e.dimensionAxis.axisDisplayMode){const{qDimensions:t,qMeasures:r}=e.qHyperCubeDef,{maxVisibleItems:n}=e.dimensionAxis;n<1?e.dimensionAxis.maxVisibleItems=10:n>1e4/(t.length+r.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(n,Math.floor(1e4/(t.length+r.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint.combochart",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}}}},measureAxis:{uses:"axis.measureAxis",label(e,r){const i="vertical"===r.layout.orientation||ZS(r.layout)?"y":"x",o=aE(e,r,0,n).map((e=>e.qFallbackTitle));let a;return a=o.length?t.get(`properties.${i}AxisWithInfo`,[o.join(",")]):t.get(`properties.${i}Axis`),a},show:(e,t)=>aE(e,t,0,n).length>0,items:{axis:{items:{show:{ref:"measureAxes.0.show",snapshot:{title:"properties.axis.primary",tid:"property-primary-axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&iv(null==e?void 0:e.series,n)))}}},dock:{ref:"measureAxes.0.dock",show:e=>"none"!==e.measureAxes[0].show,options(e,t,r){let n="Common.Bottom",i="Common.Top";return("vertical"===r.layout.orientation||ZS(r.layout))&&(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}},spacing:{ref:"measureAxes.0.spacing",show:e=>e.measureAxes[0]&&"none"!==e.measureAxes[0].show}}},minMax:{items:{autoMinMax:{ref:"measureAxes.0.autoMinMax"},minMax:{ref:"measureAxes.0.minMax",defaultValue:"min",show:e=>!e.measureAxes[0].autoMinMax},min:{ref:"measureAxes.0.min",show:e=>["min","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max},max:{ref:"measureAxes.0.max",show:e=>["max","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max}}}}},secondaryMeasureAxis:{uses:"axis.measureAxis",label(e,r){const i="vertical"===r.layout.orientation||ZS(r.layout)?"y":"x",o=aE(e,r,1,n).map((e=>e.qFallbackTitle));let a;return a=o.length?t.get(`properties.${i}AxisWithInfo`,[o.join(",")]):t.get(`properties.${i}Axis`),a},show:(e,t)=>aE(e,t,1,n).length>0,items:{axis:{items:{show:{ref:"measureAxes.1.show",snapshot:{title:"properties.axis.secondary",tid:"property-secondary-Axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&!iv(null==e?void 0:e.series,n)))}}},dock:{ref:"measureAxes.1.dock",defaultValue:"far",show:e=>"none"!==e.measureAxes[1].show,options(e,t,r){let n="Common.Bottom",i="Common.Top";return("vertical"===r.layout.orientation||ZS(r.layout))&&(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}},spacing:{ref:"measureAxes.1.spacing",show:e=>e.measureAxes[1]&&"none"!==e.measureAxes[1].show}}},minMax:{type:"items",items:{autoMinMax:{ref:"measureAxes.1.autoMinMax"},minMax:{ref:"measureAxes.1.minMax",defaultValue:"min",show:e=>!e.measureAxes[1].autoMinMax},min:{ref:"measureAxes.1.min",show:e=>["min","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max},max:{ref:"measureAxes.1.max",show:e=>["max","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max}}}}},tooltips:{uses:"tooltip"}}};var a;r.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(o.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"}]});return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{items:{nullSuppression:{show:(e,t,r)=>!ZS(r.layout)}}},measures:oE(e)}},sorting:{uses:"sortingWithDisclaimer"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},primaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines",translation:"properties.primaryMeasureAxisReferenceLines",title:{translation:"properties.primaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>iv(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,n)},secondaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines2",translation:"properties.secondaryMeasureAxisReferenceLines",title:{translation:"properties.secondaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>!iv(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,n)},dimRefLines:{uses:"dimReflines"}}},settings:o}}}function cE(e){return e.qHyperCubeDef.qMeasures.filter((e=>Lf(e.qDef.series)===ta.LINE)).length>0}function dE(e){const{flags:t}=e,r=e.flags.isEnabled("BARS_IN_SECONDARY_AXIS");return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer"},presentation:{uses:"presentation",type:"items",translation:"properties.presentation",grouped:!0,show:(e,t)=>cE(e)||!ZS(t),items:{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)=>function(e,t){const r=e.qHyperCubeDef.qMeasures.filter((e=>Lf(e.qDef.series)===ta.BAR));return t?r.filter((e=>e.qDef.series.axis===ra.PRIMARY)).length>1||r.filter((e=>e.qDef.series.axis===ra.SECONDARY)).length>1:r.length>1}(e,r)&&!ZS(t)},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)=>!ZS(t)},nullMode:{type:"string",component:"radio-list",ref:"nullMode",translation:"properties.nullMode",options:()=>[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],show:e=>cE(e)&&e.qHyperCubeDef.qMeasures.length>1},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",show:e=>cE(e)}}},color:{uses:"color",items:{disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>t.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&e.qHyperCubeDef.qMeasures.some((e=>QS(e)))}}}}}}const mE={bar:{axis:0,icon:"bar-chart",tid:"as-bar",translation:"contextMenu.asBar"},line:{axis:1,icon:"line-chart",tid:"as-line",translation:"contextMenu.asLine"},marker:{axis:1,icon:"shapes",tid:"as-marker",translation:"contextMenu.asMarker"}};function fE(e,t,r,n,i){const{axis:o,icon:a,tid:s,translation:l}=mE[i];t.addItem({icon:a,tid:s,translation:l,async select(){let t;t="measure"===e.type?await n.addLibraryMeasure(e.id):await n.addExpressionMeasure(e.name,""),t.qDef.series.type=i,t.qDef.series.axis=o,n.updateGlobalChangeListeners(),r.setProperties(n.properties),window.qvangularGlobal.$rootScope.$broadcast("pp-open-path","data."+t.qDef.cId)}})}function pE(e,t,r,n,i){!function(e,t,r){const{item:n}=e,i=["contextMenu.add",n.name];if(r.canAddMeasure()){const o=e.menu.addItem({translation:i,tid:"add-as"});fE(n,o,t,r,"bar"),fE(n,o,t,r,"line"),fE(n,o,t,r,"marker")}}(e,r,t),t.getMeasures().length>=t.minMeasures()&&e.ReplaceMeasures(r,t,i),e.ColorBy(r,t,i),n()}function hE(e){const t={},{tooltip:r}=e;if(r){var n,i;t.chart_tooltip_custom=!r.auto;const e=null===(n=r.chart)||void 0===n||null===(i=n.object)||void 0===i?void 0:i.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const yE=e=>!!(e&&e.qHyperCube.qSize.qcy>0);function gE(e){return{definition:uE(e),softDefinition:dE(e),support:{snapshot:yE,export:!0,exportData:!0,sharing:!1,viewData:!0,modifiers:["accumulation","movingAverage","difference","normalization"]},getDropMeasureOptions:pE,extendMetrics:hE,importProperties:(t,r,n,i)=>{const o={layout:{templateId:r.templateId}};n.mapProperties(o);const a={defaultDimension:n.getDefaultDimensionProperties(),defaultMeasure:n.getDefaultMeasureProperties()},s=BS.axisChart.importProperties({exportFormat:t,initialProperties:r,dataDefinition:KS(e),defaultPropertyValues:a,hypercubePath:i});return function(e,t,r){const n="linechart"===r.properties.visualization,i=[];e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:n?"line":"bar",axis:0,marker:"circle",markerFill:!0}),i.indexOf(e.qDef.series.axis)<0&&i.push(e.qDef.series.axis)}));const o=i.sort().shift();e.qProperty.measureAxes[o]&&r.properties.measureAxis&&void 0!==r.properties.measureAxis.autoMinMax&&U(!0,e.qProperty.measureAxes[o],r.properties.measureAxis,{logarithmic:!1}),t.flags.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&iE(e.qProperty)}(s,e,t),s},exportProperties:(e,t,r)=>{!function(e){e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qAttributeExpressions=[]}))}(e);return BS.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:r})},migrate:{properties:e=>e.qExtendsId?e:function(e){return AM(e.version)&&(e.qHyperCubeDef.qMeasures.forEach((e=>{Lf(e.qDef.series)===ta.BAR&&1===e.qDef.series.axis&&(e.qDef.series.axis=0)})),e.version=OM),e}(e)}}}function vE(a){const{flags:s}=a,l=(()=>{const e=S();return e.use(E),e.use(C(M)),e.use(Ay),e.use(qy()),e.component("scrollbar",os),e.component("point-label",Fg),e.component("label-space",Vg),e.component("time-axis",Gp.picassoComponents.timeAxis),e.component("axis-overlay",Gp.picassoComponents.axisOverlay),e.component("reference-line-labels",Bo),e.component("box-sliced-hat",jy),e.component("box-out-of-bounds",wy),e.component("data-out-of-bounds-marker",_g),e.component("scroll-hint",Yi),e.component("brush-highlighter",Jg),e.scale("time",Gp.picassoScales.time),e.symbol("line-point",zg),e})();return{qae:XS(a),ext:gE(a),component(){const a=function(){const[e,n]=t();return r((()=>n(ic())),[]),e}(),u=PS(),h=function(){const e=c(),n=d(),i=m(),o=f(),[a,s]=t(),l=p();return r((()=>{s({options:{direction:"ltr",...e},translator:n,theme:o,embed:i,deviceType:l})}),[e.direction,e.freeResize,n.language(),o.name(),l]),a}(),y=VS(),g=function({picasso:n,environment:i}){const o=e(),[a,s]=t();return r((()=>{if(!i)return;o.style.overflow="hidden";const e=n({renderer:{prio:[i.options.renderer||"canvas"]}}).chart({element:o,data:[],settings:{}});s(e);const{destroy:t}=e;return()=>{t()}}),[i]),a}({picasso:l,environment:h}),M=function({chart:e,actions:n}){const i=v(),a=o(),[s,l]=t();return r((()=>{if(null==e||!e.update||!e.scale||!i)return null;const t=e.scale(ea.SCALE.MAJOR),r=Om({chart:e,actions:n,selections:i,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:t,selectionActions:{clear:_S},selectionEvents:{start:zS}}});r.setLayout(a);const{destroy:o}=r;return l(r),()=>{o()}}),[i,null==e?void 0:e.update,null==e?void 0:e.scale]),r((()=>{null!=s&&s.setLayout&&a&&s.setLayout(a)}),[a]),s}({chart:g,actions:y}),S=kS({picasso:l,chart:g,environment:h,flags:s,viewState:u,viewCache:a,actions:y,selectionService:M});vh({picasso:l,chart:g,models:S,environment:h,viewState:u,viewCache:a,actions:y}),(({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})=>{const{width:u,height:c}=n(),[,d]=i((async()=>{if(!(null!=t&&t.update&&r&&o&&a))return;const{colorService:n,discreteModel:i,dockService:d,layoutService:m,refLineModel:f}=r;function p(){t.update({settings:mh({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})})}d.update({width:u,height:c}),n.custom.updateLegend(),f.update({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l});const h=m.getDataPages();m.setDataPages([]),p(),m.setDataPages(h),m.meta.isContinuous||await i.command.initialize(),p()}),[u,c]);if(d)throw d})({picasso:l,chart:g,models:S,environment:h,viewState:u,viewCache:a,actions:y}),(({models:e,chart:t,viewState:r})=>{b((n=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discreteModel:s,continuousModel:l,reducedModel:u}=e,{width:c,height:d}=o.meta.chart.size;return n.snapshotData=n.snapshotData||{},n.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(n.snapshotData.content.chartData={scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:ae(t,ea.COMPONENT.LEGEND_CATEGORICAL)},i.meta.isDiscrete?(s.command.setSnapshotData(n),u.command.setSnapshotData(n)):l.setSnapshotData(n),a.getSnapshotData().then((e=>{n.snapshotData.content.chartData={...n.snapshotData.content.chartData,...e}})).catch((()=>{})))})),x((()=>({getViewState(){if(r&&t)return{scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:ae(t,ea.COMPONENT.LEGEND_CATEGORICAL)}}})),[r,t])})({models:S,chart:g,viewState:u})}}}export{vE as default};
974
+ function(e,t,r){function n(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e}r.r(t),r.d(t,"default",(function(){return n}))}})}));var oE=P(iE.exports);const aE={version:"1.8.13",qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},showTitles:!0,subtitle:"",title:"",footnote:"",barGrouping:{grouping:"grouped"},orientation:"vertical",scrollStartPos:0,nullMode:"gap",dataPoint:{show:!1,showLineLabels:!1,showBarLabels:!1},color:{auto:!0,mode:"primary",useBaseColors:"off",paletteColor:{index:6},useDimColVal:!0,useMeasureGradient:!0,persistent:!1,expressionIsColor:!0,expressionLabel:"",measureScheme:"sg",reverseScheme:!1,dimensionScheme:"12",autoMinMax:!0,measureMin:0,measureMax:10},legend:{dock:"auto",show:!0,showTitle:!0},components:[],dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},measureAxes:[{show:"all",dock:"near",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10},{show:"all",dock:"far",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10}],refLine:{refLines:[],refLines2:[],dimRefLines:[]},preferContinuousAxis:!0,showMiniChartForContinuousAxis:!0,tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}};var sE=e=>t=>{const r=t.qHyperCubeDef.qMeasures,n=[0,0,0];let i;if(!r.length)return e.get("Visualizations.Descriptions.Bars");for(let e=0;e<r.length;++e)i=Gf(r[e].qDef.series),i===ta.BAR?n[0]=1:i===ta.LINE?n[1]=1:n[2]=1;const o=["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Line","Visualizations.Descriptions.ComboChart.Dimension.LineMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarLine","Visualizations.Descriptions.ComboChart.Dimension.BarLineMarker"][parseInt(n.join(""),2)-1];return e.get(o)},lE=e=>(t,r)=>{let n;const i=t.qHyperCubeDef.qMeasures[r];if(i){const{type:e}=i.qDef.series;n=e===ta.LINE?"Visualizations.Descriptions.HeightLine":e===ta.BAR?"Visualizations.Descriptions.LengthBars":"Visualizations.Descriptions.ComboChart.Measure.HeightMarker"}else n=r?"Visualizations.Descriptions.HeightLine":"Visualizations.Descriptions.LengthBars";return e.get(n)};function uE(e){var t,r;const n=e.qHyperCubeDef.qMeasures,i=null===(t=e.color)||void 0===t?void 0:t.mode;"byDimension"===i&&1===n.length&&Gf(null===(r=n[0].qDef)||void 0===r?void 0:r.series)===ta.LINE?e.color.mode="primary":"byDimension"===i&&n.length>1&&(e.color.mode="byMultiple")}function cE(e){const{translator:t}=e;return{dimensions:{min:1,max:1,description:sE(t)},measures:{min:1,max:15,description:lE(t),added({qDef:e},t){var r;uE(t),null!==(r=e.series)&&void 0!==r&&r.type||(t.qHyperCubeDef.qMeasures.length>1?e.series={type:ta.LINE,axis:ra.SECONDARY}:e.series={type:ta.BAR,axis:ra.PRIMARY})},moved(e,t){uE(t)}}}}function dE(e){const t=cE(e);return{properties:aE,data:{targets:[{path:"/qHyperCubeDef",...t}]},importProperties:({exportFormat:e,initialProperties:r,hypercubePath:n})=>{const i=oE.axisChart.importProperties({exportFormat:e,initialProperties:r,dataDefinition:t,hypercubePath:n}),o="linechart"===e.properties.visualization,a=[];i.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:o?"line":"bar",axis:0,marker:"circle",markerFill:!0}),a.indexOf(e.qDef.series.axis)<0&&a.push(e.qDef.series.axis)}));const s=a.sort().shift();return i.qProperty.measureAxes[s]&&e.properties.measureAxis&&void 0!==e.properties.measureAxis.autoMinMax&&U(!0,i.qProperty.measureAxes[s],e.properties.measureAxis,{logarithmic:!1}),i},exportProperties:({propertyTree:e,hyperCubePath:t,viewDataMode:r})=>oE.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:r})}}function mE(){const e={component:"dropdown",type:"string",expression:"optional",baseRef:"style.strokeWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:"none",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"}]},t={component:"color-picker",type:"object",baseRef:"style.strokeColor",translation:"LayerStyleEditor.style.strokeColor",dualOutput:!0,show:t=>"none"!==Ol(t,`${((e,t)=>{let r=-1;for(let n=0;n<e.length;n++)if(e[n].key===t){r=n;break}return r})(t,"bar")}.${e.baseRef}`),defaultValue:()=>({index:-1,color:"#205891"})},r={component:"slider",type:"number",expression:"optional",baseRef:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:6,min:3,max:20,step:1},n={component:"slider",type:"number",expression:"optional",baseRef:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:1,min:1,max:5,step:1},i={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"solid",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}]},o={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",show:!0,defaultValue:"linear",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]};return{component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:["bar","line"],ref:"components",defaultValue:[],defaultValues(a){const s="grouped"===a.barGrouping.grouping,l=a.qHyperCubeDef.qMeasures.filter((e=>Gf(e.qDef.series)===ta.BAR)).length,u=s&&l>1;return[{key:"bar",style:{strokeWidth:e.defaultValue,strokeColor:t.defaultValue(),width:u?.9:.7}},{key:"line",style:{dataPointSize:r.defaultValue,lineThickness:n.defaultValue,lineType:i.defaultValue,lineCurve:o.defaultValue}}]},items:{list:{type:"items",component:"expandable-items",items:{bar:{type:"items",translation:"Visualizations.Descriptions.Bar",expanded:!0,styleKey:"bar",items:{barStrokeWidth:e,barStrokeColor:t,barWidth:{component:"slider",type:"number",expression:"optional",baseRef:"style.width",translation:"LayerStyleEditor.style.barWidth",show:(e,t,r)=>{const n=t.getMeasures().some((e=>Gf(e.qDef.series)===ta.LINE));return!oe.continuous(r.layout,n&&ee.isTime(!0,r.layout))},defaultValue:.7,min:.01,max:1,step:.01}}},line:{type:"items",translation:"Visualizations.Descriptions.Line",expanded:!0,styleKey:"line",items:{dataPointSize:r,lineThickness:n,lineType:i,lineCurve:o}}}}}}}function fE(e){const t=Ol(e,"qHyperCube.qMeasureInfo",[]).some((({series:e=na})=>Gf(e)===ta.LINE));return oe.continuous(e,(()=>t&&ee.isTime(!0,e)))}function pE(e){var t,r;return!(null===(t=e.qDef)||void 0===t||null===(r=t.color)||void 0===r||!r.on)}function hE(e){var t,r,n;return pE(e)&&"primary"===(null!==(t=null===(r=e.qDef)||void 0===r||null===(n=r.color)||void 0===n?void 0:n.mode)&&void 0!==t?t:"primary")}function yE(e){var t,r;return pE(e)&&"byExpression"===(null===(t=e.qDef)||void 0===t||null===(r=t.color)||void 0===r?void 0:r.mode)}function gE(e){var t,r,n,i,o;if(null!=e&&null!==(t=e.color)&&void 0!==t&&t.auto||"byExpression"!==(null==e||null===(r=e.color)||void 0===r?void 0:r.mode))return[];const a=null==e||null===(n=e.color)||void 0===n?void 0:n.colorExpression,s=null!==(i=null==e||null===(o=e.color)||void 0===o?void 0:o.expressionLabel)&&void 0!==i?i:"";return a?[{qExpression:a,label:s,id:"colorByExpression"}]:[]}function vE(e){return yE(e)?[{qExpression:e.qDef.color.colorExpression,id:"colorByMeasureExpression"}]:[]}function bE(e){var t,r;(null!==(t=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)&&void 0!==t?t:[]).forEach(((t,r)=>function(e,t,r){e.qAttributeExpressions=0===t?[...gE(r),...vE(e)]:vE(e)}(t,r,e)))}function xE(e){const{flags:t}=e,r={ref:"qDef.series.type",type:"string",component:"item-selection-list",defaultValue:"bar",schemaIgnore:!0,horizontal:!0,items:[{icon:e=>"stacked"===e.barGrouping.grouping||fE(e)?"stacked":"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.bar",value:"bar"},{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"shapes",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.marker",value:"marker"}],change:e=>(e.qDef.series.type!==ta.BAR||t.isEnabled("BARS_IN_SECONDARY_AXIS")||(e.qDef.series.axis=0),e)},n={ref:"qDef.series.axis",type:"integer",component:"dropdown",defaultValue:0,options:[{translation:"properties.axis.primary",value:0},{translation:"properties.axis.secondary",value:1}],show(e){var r;return!!t.isEnabled("BARS_IN_SECONDARY_AXIS")||Gf(null===(r=e.qDef)||void 0===r?void 0:r.series)!==ta.BAR}},i={ref:"qDef.series.marker",type:"string",component:"dropdown",defaultValue:"circle",options:[{translation:"properties.marker.circle",value:"circle"},{translation:"properties.marker.rect",value:"rect"},{translation:"properties.marker.diamond",value:"diamond"},{translation:"properties.marker.triangle",value:"triangle"},{translation:"properties.marker.line",value:"line"}],show(e){var t;return Gf(null===(t=e.qDef)||void 0===t?void 0:t.series)===ta.MARKER}},o={ref:"qDef.series.markerFill",translation:"properties.series.fill",type:"boolean",defaultValue:!0,show(e){var t;return Gf(null===(t=e.qDef)||void 0===t?void 0:t.series)===ta.MARKER&&!["line"].includes(e.qDef.series.marker)}};let a;if(t.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")){var s,l;const t={ref:"qDef.color.on",translation:"properties.colors",type:"boolean",component:"switch",defaultValue:!1,trueOption:{value:!1,translation:"Common.Auto"},falseOption:{value:!0,translation:"Common.Custom"}},u={ref:"qDef.color.mode",type:"string",component:"dropdown",options:[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:(...e)=>pE(...e)},c=null===(s=e.anything)||void 0===s||null===(l=s.sense)||void 0===l?void 0:l.theme;a={supPanel:{translation:"properties.measure.moreProperties",title:"properties.measure.moreProperties",subTitle:(e,t,r)=>{var n;return null===(n=r.measureTitle)||void 0===n?void 0:n.call(r)},component:"sub-panel",type:"items",items:{groups:{type:"items",component:"expandable-items",items:{presentation:{type:"items",translation:"properties.presentation",items:{seriesType:r,seriesAxis:n,seriesMarker:i,seriesMarkerFill:o}},color:{type:"items",translation:"properties.color",items:{customColor:t,colorMode:u,paletteColor:{ref:"qDef.color.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{var e;const{primary:t}=c.getDataColorSpecials(),r=null===(e=c.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,n=r.indexOf(t);return{index:-1===n?Math.min(6,r.length-1):n}},show:hE},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"qDef.color.colorExpression",translation:"Common.Expression",show:yE}}}}}}}}}else a={seriesType:r,seriesAxis:n,seriesMarker:i,seriesMarkerFill:o};return{items:{series:{type:"items",items:a}}}}function ME(e,t,r,n){let i;const o=r||0;var a,s;t?i=t.getMeasureLayouts():i=null!==(a=null==e||null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qMeasures)&&void 0!==a?a:[];return i.filter((e=>{const{series:t}=e||{};return 0===o?bv(t,n):!bv(t,n)}))}function SE(e,t){return t.getMeasures().filter((e=>Gf(e.qDef.series)===ta.LINE)).length>0}function EE(e,t,r,n){const i=t.getMeasures().filter((e=>Gf(e.qDef.series)===ta.BAR));return n?i.filter((e=>e.qDef.series.axis===ra.PRIMARY)).length>r||i.filter((e=>e.qDef.series.axis===ra.SECONDARY)).length>r:i.length>r}function CE(e){const{translator:t,flags:r}=e,n=r.isEnabled("BARS_IN_SECONDARY_AXIS"),i={items:{attributeExpression:{ref:"color.colorExpression",change:null,globalChange:e=>bE(e)},expressionLabel:{change:null},disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>r.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&e.qHyperCubeDef.qMeasures.some((e=>pE(e)))}}},o={uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{comboStyling:mE(),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,r)=>EE(0,t,1,n)&&!fE(r.layout)},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,r)=>fE(r.layout),convertFunctions:(a="vertical",{get:(e,t,r)=>fE(r.layout)?a:e(t.type),set(e,t,r,n){t(r.type,fE(n.layout)?a:e,a)}})},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,r)=>!fE(r.layout)},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap",show:(e,t)=>SE(0,t)},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint"},show:(e,t)=>SE(0,t),items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showLineDataPointLabels:{ref:"dataPoint.showLineLabels",translation:"properties.dataPoints.linelabelmode",type:"boolean",component:"switch",defaultValue:!1,show:e=>e.dataPoint&&e.dataPoint.show,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},showBarLabels:{ref:"dataPoint.showBarLabels",type:"boolean",translation:"properties.dataPoints.barlabelmode",component:"switch",show:(e,t)=>EE(0,t,0,n),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:i,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label(e,r){const n="vertical"===r.layout.orientation||fE(r.layout)?"x":"y",i=function(e,t){return t?t.getDimensionLayouts():e.qHyperCubeDef.qDimensions.map((e=>e.qDef))}(e,r).map((e=>e.qFallbackTitle||"")).join(", ");let o;return o=i?t.get(`properties.${n}AxisWithInfo`,[i]):t.get(`properties.${n}Axis`),o},items:{othersGroup:{items:{dock:{options(e,t,r){let n="Common.Bottom",i="Common.Top";return"vertical"===r.layout.orientation||fE(r.layout)||(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,r)=>!fE(r.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",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:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e){const{qDimensions:t,qMeasures:r}=e.qHyperCubeDef,{maxVisibleItems:n}=e.dimensionAxis;return n<0||n>1e4/(t.length+r.length)},globalChange(e){if("custom"===e.dimensionAxis.axisDisplayMode){const{qDimensions:t,qMeasures:r}=e.qHyperCubeDef,{maxVisibleItems:n}=e.dimensionAxis;n<1?e.dimensionAxis.maxVisibleItems=10:n>1e4/(t.length+r.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(n,Math.floor(1e4/(t.length+r.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint.combochart",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}}}},measureAxis:{uses:"axis.measureAxis",label(e,r){const i="vertical"===r.layout.orientation||fE(r.layout)?"y":"x",o=ME(e,r,0,n).map((e=>e.qFallbackTitle));let a;return a=o.length?t.get(`properties.${i}AxisWithInfo`,[o.join(",")]):t.get(`properties.${i}Axis`),a},show:(e,t)=>ME(e,t,0,n).length>0,items:{axis:{items:{show:{ref:"measureAxes.0.show",snapshot:{title:"properties.axis.primary",tid:"property-primary-axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&bv(null==e?void 0:e.series,n)))}}},dock:{ref:"measureAxes.0.dock",show:e=>"none"!==e.measureAxes[0].show,options(e,t,r){let n="Common.Bottom",i="Common.Top";return("vertical"===r.layout.orientation||fE(r.layout))&&(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}},spacing:{ref:"measureAxes.0.spacing",show:e=>e.measureAxes[0]&&"none"!==e.measureAxes[0].show}}},minMax:{items:{autoMinMax:{ref:"measureAxes.0.autoMinMax"},minMax:{ref:"measureAxes.0.minMax",defaultValue:"min",show:e=>!e.measureAxes[0].autoMinMax},min:{ref:"measureAxes.0.min",show:e=>["min","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max},max:{ref:"measureAxes.0.max",show:e=>["max","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max}}}}},secondaryMeasureAxis:{uses:"axis.measureAxis",label(e,r){const i="vertical"===r.layout.orientation||fE(r.layout)?"y":"x",o=ME(e,r,1,n).map((e=>e.qFallbackTitle));let a;return a=o.length?t.get(`properties.${i}AxisWithInfo`,[o.join(",")]):t.get(`properties.${i}Axis`),a},show:(e,t)=>ME(e,t,1,n).length>0,items:{axis:{items:{show:{ref:"measureAxes.1.show",snapshot:{title:"properties.axis.secondary",tid:"property-secondary-Axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&!bv(null==e?void 0:e.series,n)))}}},dock:{ref:"measureAxes.1.dock",defaultValue:"far",show:e=>"none"!==e.measureAxes[1].show,options(e,t,r){let n="Common.Bottom",i="Common.Top";return("vertical"===r.layout.orientation||fE(r.layout))&&(n=r.yMirrorMode?"properties.dock.right":"properties.dock.left",i=r.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:i}]}},spacing:{ref:"measureAxes.1.spacing",show:e=>e.measureAxes[1]&&"none"!==e.measureAxes[1].show}}},minMax:{type:"items",items:{autoMinMax:{ref:"measureAxes.1.autoMinMax"},minMax:{ref:"measureAxes.1.minMax",defaultValue:"min",show:e=>!e.measureAxes[1].autoMinMax},min:{ref:"measureAxes.1.min",show:e=>["min","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max},max:{ref:"measureAxes.1.max",show:e=>["max","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max}}}}},tooltips:{uses:"tooltip"}}};var a;r.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(o.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"}]});return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{items:{nullSuppression:{show:(e,t,r)=>!fE(r.layout)}}},measures:xE(e)}},sorting:{uses:"sortingWithDisclaimer"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},primaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines",translation:"properties.primaryMeasureAxisReferenceLines",title:{translation:"properties.primaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>bv(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,n)},secondaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines2",translation:"properties.secondaryMeasureAxisReferenceLines",title:{translation:"properties.secondaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>!bv(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,n)},dimRefLines:{uses:"dimReflines"}}},settings:o}}}function qE(e){return e.qHyperCubeDef.qMeasures.filter((e=>Gf(e.qDef.series)===ta.LINE)).length>0}function OE(e){const{flags:t}=e,r=e.flags.isEnabled("BARS_IN_SECONDARY_AXIS");return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer"},presentation:{uses:"presentation",type:"items",translation:"properties.presentation",grouped:!0,show:(e,t)=>qE(e)||!fE(t),items:{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)=>function(e,t){const r=e.qHyperCubeDef.qMeasures.filter((e=>Gf(e.qDef.series)===ta.BAR));return t?r.filter((e=>e.qDef.series.axis===ra.PRIMARY)).length>1||r.filter((e=>e.qDef.series.axis===ra.SECONDARY)).length>1:r.length>1}(e,r)&&!fE(t)},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)=>!fE(t)},nullMode:{type:"string",component:"radio-list",ref:"nullMode",translation:"properties.nullMode",options:()=>[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],show:e=>qE(e)&&e.qHyperCubeDef.qMeasures.length>1},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",show:e=>qE(e)}}},color:{uses:"color",items:{disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>t.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&e.qHyperCubeDef.qMeasures.some((e=>pE(e)))}}}}}}const AE={bar:{axis:0,icon:"bar-chart",tid:"as-bar",translation:"contextMenu.asBar"},line:{axis:1,icon:"line-chart",tid:"as-line",translation:"contextMenu.asLine"},marker:{axis:1,icon:"shapes",tid:"as-marker",translation:"contextMenu.asMarker"}};function DE(e,t,r,n,i){const{axis:o,icon:a,tid:s,translation:l}=AE[i];t.addItem({icon:a,tid:s,translation:l,async select(){let t;t="measure"===e.type?await n.addLibraryMeasure(e.id):await n.addExpressionMeasure(e.name,""),t.qDef.series.type=i,t.qDef.series.axis=o,n.updateGlobalChangeListeners(),r.setProperties(n.properties),window.qvangularGlobal.$rootScope.$broadcast("pp-open-path","data."+t.qDef.cId)}})}function NE(e,t,r,n,i){!function(e,t,r){const{item:n}=e,i=["contextMenu.add",n.name];if(r.canAddMeasure()){const o=e.menu.addItem({translation:i,tid:"add-as"});DE(n,o,t,r,"bar"),DE(n,o,t,r,"line"),DE(n,o,t,r,"marker")}}(e,r,t),t.getMeasures().length>=t.minMeasures()&&e.ReplaceMeasures(r,t,i),e.ColorBy(r,t,i),n()}function IE(e){const t={},{tooltip:r}=e;if(r){var n,i;t.chart_tooltip_custom=!r.auto;const e=null===(n=r.chart)||void 0===n||null===(i=n.object)||void 0===i?void 0:i.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const TE=e=>!!(e&&e.qHyperCube.qSize.qcy>0);function wE(e){return{definition:CE(e),softDefinition:OE(e),support:{snapshot:TE,export:!0,exportData:!0,sharing:!1,viewData:!0,modifiers:["accumulation","movingAverage","difference","normalization"]},getDropMeasureOptions:NE,extendMetrics:IE,importProperties:(t,r,n,i)=>{const o={layout:{templateId:r.templateId}};n.mapProperties(o);const a={defaultDimension:n.getDefaultDimensionProperties(),defaultMeasure:n.getDefaultMeasureProperties()},s=oE.axisChart.importProperties({exportFormat:t,initialProperties:r,dataDefinition:cE(e),defaultPropertyValues:a,hypercubePath:i});return function(e,t,r){const n="linechart"===r.properties.visualization,i=[];e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:n?"line":"bar",axis:0,marker:"circle",markerFill:!0}),i.indexOf(e.qDef.series.axis)<0&&i.push(e.qDef.series.axis)}));const o=i.sort().shift();e.qProperty.measureAxes[o]&&r.properties.measureAxis&&void 0!==r.properties.measureAxis.autoMinMax&&U(!0,e.qProperty.measureAxes[o],r.properties.measureAxis,{logarithmic:!1}),t.flags.isEnabled("BASIC_COLOR_OPTIONS_PER_MEASURE")&&bE(e.qProperty)}(s,e,t),s},exportProperties:(e,t,r)=>{!function(e){e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qAttributeExpressions=[]}))}(e);return oE.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:r})},migrate:{properties:e=>e.qExtendsId?e:function(e){return HM(e.version)&&(e.qHyperCubeDef.qMeasures.forEach((e=>{const{qDef:t}=e;void 0===t.series&&(t.series=na),void 0===t.series.type&&(t.series.type=na.type),void 0===t.series.axis&&(t.series.axis=t.series.type===ta.BAR?ra.PRIMARY:ra.SECONDARY),t.series.type===ta.BAR&&t.series.axis===ra.SECONDARY&&(t.series.axis=ra.PRIMARY)})),e.version=BM),e}(e)}}}function LE(a){const{flags:s}=a,l=(()=>{const e=S();return e.use(E),e.use(C(M)),e.use(Hy),e.use(_y()),e.component("scrollbar",Bd),e.component("point-label",Qg),e.component("label-space",ev),e.component("time-axis",uh.picassoComponents.timeAxis),e.component("axis-overlay",uh.picassoComponents.axisOverlay),e.component("reference-line-labels",zo),e.component("box-sliced-hat",Zy),e.component("box-out-of-bounds",Wy),e.component("data-out-of-bounds-marker",tv),e.component("scroll-hint",Yi),e.component("brush-highlighter",mv),e.scale("time",uh.picassoScales.time),e.symbol("line-point",rv),e})();return{qae:dE(a),ext:wE(a),component(){const a=function(){const[e,n]=t();return r((()=>n(Dl())),[]),e}(),u=JS(),h=function(){const e=c(),n=d(),i=m(),o=f(),[a,s]=t(),l=p();return r((()=>{s({options:{direction:"ltr",...e},translator:n,theme:o,embed:i,deviceType:l})}),[e.direction,e.freeResize,n.language(),o.name(),l]),a}(),y=eE(),g=function({picasso:n,environment:i}){const o=e(),[a,s]=t();return r((()=>{if(!i)return;o.style.overflow="hidden";const e=n({renderer:{prio:[i.options.renderer||"canvas"]}}).chart({element:o,data:[],settings:{}});s(e);const{destroy:t}=e;return()=>{t()}}),[i]),a}({picasso:l,environment:h}),M=function({chart:e,actions:n}){const i=v(),a=o(),[s,l]=t();return r((()=>{if(null==e||!e.update||!e.scale||!i)return null;const t=e.scale(ea.SCALE.MAJOR),r=Xc({chart:e,actions:n,selections:i,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:t,selectionActions:{clear:tE},selectionEvents:{start:rE}}});r.setLayout(a);const{destroy:o}=r;return l(r),()=>{o()}}),[i,null==e?void 0:e.update,null==e?void 0:e.scale]),r((()=>{null!=s&&s.setLayout&&a&&s.setLayout(a)}),[a]),s}({chart:g,actions:y}),S=XS({picasso:l,chart:g,environment:h,flags:s,viewState:u,viewCache:a,actions:y,selectionService:M});Lh({picasso:l,chart:g,models:S,environment:h,viewState:u,viewCache:a,actions:y}),(({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})=>{const{width:u,height:c}=n(),[,d]=i((async()=>{if(!(null!=t&&t.update&&r&&o&&a))return;const{colorService:n,discreteModel:i,dockService:d,layoutService:m,refLineModel:f}=r;function p(){t.update({settings:Ah({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})})}d.update({width:u,height:c}),n.custom.updateLegend(),f.update({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l});const h=m.getDataPages();m.setDataPages([]),p(),m.setDataPages(h),m.meta.isContinuous||await i.command.initialize(),p()}),[u,c]);if(d)throw d})({picasso:l,chart:g,models:S,environment:h,viewState:u,viewCache:a,actions:y}),(({models:e,chart:t,viewState:r})=>{b((n=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discreteModel:s,continuousModel:l,reducedModel:u}=e,{width:c,height:d}=o.meta.chart.size;return n.snapshotData=n.snapshotData||{},n.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(n.snapshotData.content.chartData={scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:ae(t,ea.COMPONENT.LEGEND_CATEGORICAL)},i.meta.isDiscrete?(s.command.setSnapshotData(n),u.command.setSnapshotData(n)):l.setSnapshotData(n),a.getSnapshotData().then((e=>{n.snapshotData.content.chartData={...n.snapshotData.content.chartData,...e}})).catch((()=>{})))})),x((()=>({getViewState(){if(r&&t)return{scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:ae(t,ea.COMPONENT.LEGEND_CATEGORICAL)}}})),[r,t])})({models:S,chart:g,viewState:u})}}}export{LE as default};