@nebula.js/sn-bar-chart 1.39.12 → 1.39.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.
@@ -1,7 +1,7 @@
1
1
  /*
2
- * @nebula.js/sn-bar-chart v1.39.12
2
+ * @nebula.js/sn-bar-chart v1.39.13
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- System.register(["picasso.js","picasso-plugin-q","hammerjs","qlik-chart-modules","qlik-chart-modules/react","@nebula.js/stardust","qlik-object-conversion"],function(e){"use strict";var t,n,o,i,r,a,s,l,u,c,d,m,h,f,p,g,y,v,b,M,S,x,C,q,T,w,k,N,L,D,O,E,A,I,P,R,z,B,F,H,j,_,V,U,$,W,K,G;return{setters:[function(e){t=e.default},function(e){n=e.default},function(e){o=e.default},function(e){i=e.debouncer,r=e.throttler,a=e.getValue,s=e.setValue,l=e.createColor,u=e.pointLabelComponent,c=e.cache,d=e.storage,m=e.memoize,h=e.selectionService,f=e.colorService,p=e.tooltipService,g=e.disclaimerService,y=e.layoutService,v=e.dockService,b=e.themeService,M=e.alternativeService,S=e.pluginService,x=e.fontResolver},function(e){C=e.reactRenderer,q=e.disclaimerComponent,T=e.axisTitleComponent},function(e){w=e.useTranslator,k=e.useEmbed,N=e.useTheme,L=e.useState,D=e.useDeviceType,O=e.useAppLayout,E=e.useEffect,A=e.useElement,I=e.useOptions,P=e.useLayout,R=e.useAction,z=e.useStaleLayout,B=e.useModel,F=e.useApp,H=e.usePlugins,j=e.useSelections,_=e.useConstraints,V=e.useRect,U=e.usePromise,$=e.onTakeSnapshot,W=e.useImperativeHandle,K=e.useRenderState},function(e){G=e.default}],execute:function(){e("default",function(e){const s=function(){const e=t();return e.use(n),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",J(e))};return void e.interaction("hammer",J(Hammer))}(o)),e.use(Zu),e.renderer("react-qcm",C),e.component("box-sliced-hat",Yu),e.component("box-out-of-bounds",Uu),e.component("disclaimer",q),e.component("scrollbar",Fu),e.component("scroll-hint",vs),e.component("reference-line-labels",Sl),e.component("axis-overlay",jr.picassoComponents.axisOverlay),e.component("time-axis",jr.picassoComponents.timeAxis),e.component("space",Xu),e.component("axis-title",T),e.component("point-label",u),e.scale("q-time-axis",jr.picassoScales.time),e}();return{qae:Pc(e),ext:tp(e),component(){const t=function({env:e}){const{flags:t}=e,n=e.anything?.sense?.isUnsupportedFeature,o=w();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Rc).forEach(t=>{e.add(Rc[t])})}}(e.translator);const i=k(),r=N(),[a,s]=L(),l=D(),u=O(),{qLocaleInfo:c}=u;return E(()=>{s({translator:o,theme:r,embed:i,deviceType:l,localeInfo:c,isUnsupportedFeature:n,flags:t})},[c,n,o.language(),r.name(),l]),a}({env:e}),{viewState:n,viewCache:o}=function(){const[e]=L(()=>c()),[t]=L(()=>d({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:e,viewState:t}}(),l=function({picasso:e}){const t=A(),n=I(),[o,i]=L();return E(()=>{if(!e)return()=>{};t.style.overflow="hidden";const o=e({renderer:{prio:[n?.renderer||"canvas"]}}).chart({element:t,data:[],settings:{}});i(o);const{destroy:r}=o;return()=>{r()}},[n.renderer]),o}({picasso:s}),u=function({picasso:e,chart:t,environment:n,viewState:o,viewCache:i}){const s=z(),l=B(),u=F(),d=H(),m=j(),h=I(),[f,p]=L(),[g,x]=L(),[C,q]=L(),T=_(),k=function(){const[e]=L({}),[t]=L({}),n=function(){const e=P(),t=w(),n=!!e?.qSelectionInfo?.qInSelections,o=!!e?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[i,r]=L(!1),[a,s]=L(!1),[l,u]=L({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),c=e=>{s("boolean"==typeof e?e:!a)};return R(()=>(u({key:"lasso",action:c,enabled:()=>i,active:()=>a}),{key:"lasso",label:t.get(a?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:$d,hidden:!i||!n||o,active:a,action:c}),[n,o,a,i,t.language()]),{get:()=>l,setAllows:e=>{r(!!e)}}}(),[o,i]=L();return E(()=>{const o={};o.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:o}=e;return t.allowScroll&&(n?.meta.isContinuous||o?.query.getCanScroll())}},o.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},o.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},o.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},o.lasso=n.get(),Object.keys(o).forEach(e=>Wd(o[e])),i(o)},[]),E(()=>{o&&n&&(o.lasso={...o.lasso,...n.get()})},[n]),{get:()=>o,setAllows:e=>{Object.assign(t,e),n.setAllows(e?.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(o).forEach(e=>o[e].removeAllListeners())}}}();return E(()=>{if(!t)return()=>{};const e=k.get(),n=Zd({chart:t,actions:e,selections:m});return x(e),q(n),()=>{n.destroy(),k.destroy()}},[t]),E(()=>{if(!T)return;const e={allowScroll:!T.active,allowInteract:!T.active,allowTooltip:!T.passive,allowSelect:!T.select&&!T.active};k.setAllows(e)},[T]),E(()=>{if(!C||!n)return;const{theme:m,translator:f,localeInfo:x,flags:q,embed:T}=n,{direction:w="ltr"}=h,N="rtl"===w,L=y({source:s,metaAdditionsFn:Xd(),experimental:{filter:!0}});C.setFilteredFields(L.meta.filteredFields);const D=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(L.getLayout())?y({source:L.getLayout()}):void 0,O=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:s,options:h}),E=function({layoutService:e,viewCache:t,options:n}){const o={};return o.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),o.selectionDimensionIdx=Qd(e.getHyperCube()),o.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,o.selectionDimensionProp=e=>void 0===o.selectionDimensionIdx||void 0!==e&&o.selectionDimensionIdx!==e?{}:{selectionDimension:{field:o.selectionDimensionIdx}},o.animations={enabled:()=>!1!==n.chartAnimations&&(!(o.animations.isPartialUpdating||o.animations.isSizeChanging||o.animations.hasSlicedHats)&&!ql.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},o}({layoutService:L,viewCache:i,options:h}),A=v({chart:t,layoutService:L,config:{logicalSize:O,rtl:N},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),I=rm({layoutService:L}),P=b({theme:m,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),R=jr.model({model:l,layoutService:L,viewCache:i,viewState:o}),z=function({enigma:e,layoutService:t,viewModel:n,definitionPath:o,reducedHyperCubePath:i},r={}){const a=function(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(oa).then(e=>{const n=t.getHyperCubeValue("qMode"),o=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&o.length>1&&e[0]?.qIsReduced,r=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:r,qDimensionInfo:o.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),o=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:o,qWidth:e.length+i.length+o,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}(e,t,o),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,o=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return o.should=e=>t&&n&&1===e.qDimensionInfo.length,o}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var o;u.should(e)&&u(e),c.mode=le(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(o=e).qDimensionInfo.length&&2===o.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},c.scales={major:Gd.SCALE.REDUCED.MAJOR,minor:Gd.SCALE.REDUCED.MINOR},c.cube=e,r.qDataPages=e.qDataPages},fetchMinMaxData(){if(r.qDataPages)return Promise.resolve(r.qDataPages);let n=a.settings();const o="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=le(!0,{},n,{rect:{qHeight:o}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=c.cube}}}({enigma:l,layoutService:L,viewModel:E});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const o=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",o.scrollOffset),t.preventSet("legendScrollOffset",o.legendScrollOffset||0),o.zoom&&t.preventSet("zoom",o.zoom)}({layoutService:L,viewState:o,viewStateOptions:h?.viewState});const B=tm({picasso:e,model:l,app:u,translator:f,localeInfo:x,theme:m,continuousDataModel:R,layoutService:L,legendLayoutService:D,reducedDataModel:z}),F=M({app:u,translator:f}),H=function({layoutService:e,themeService:t,colorService:n}){const o=t.getStyles(),i=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),r=(e,t)=>{const o=n.getMain().getPaletteColor;if(e?.color&&o){const n=o(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=i("axis")?.axis?.title;return{fontFamily:e?.fontFamily??o.axis.title.fontFamily,fontSize:e?.fontSize??o.axis.title.fontSize,color:r(e?.color,o.axis.title.color)}}},label:{getStyle:()=>{const e=i("axis")?.axis?.label?.name;return{fill:r(e?.color,o.axis.label.name.color),fontSize:e?.fontSize??o.axis.label.name.fontSize,fontFamily:e?.fontFamily??o.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{const e=i("legend")?.legend?.title;return{fontFamily:e?.fontFamily??o.legend.title.fontFamily,fontSize:e?.fontSize??o.legend.title.fontSize,color:r(e?.color,o.legend.title.color)}}},label:{getStyle:()=>{const e=i("legend")?.legend?.label;return{fontFamily:e?.fontFamily??o.legend.label.fontFamily,fontSize:e?.fontSize??o.legend.label.fontSize,color:r(e?.color,o.legend.label.color)}}}},label:{getStyle:()=>{const e=i("label")?.label?.value;return{fill:r(e?.color,o.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??o.label.value.fontSize,fontFamily:e?.fontFamily??o.label.value.fontFamily}}}}}({layoutService:L,themeService:P,colorService:B}),j=Nd({layoutService:L,viewState:o,colorModel:{settings:()=>B.getMain().getSettings(),resolveUIColor:e=>B.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:Gd.SCALE.MAIN.COLOR},isEnabled:()=>!L.meta.isGroupedByDimension&&(!L.meta.isStackedByDimension||q.isEnabled("TRENDLINES_STACKED_DIM"))&&!L.meta.isDimensionless});xc.attrExpr.updateProperties(l,s);const _=fc({layout:s,app:u,model:l,picasso:e,chart:t,translator:f,localeInfo:x,embed:T}),V=qc({app:u,chart:t,embed:T,flags:q,layout:L.getLayout(),localeInfo:x,model:l,options:{direction:h.direction},picasso:e,translator:f}),U=om({chart:t,actions:g,translator:f,rtl:N,viewState:o,viewModel:E,layoutService:L,dockService:A,colorService:B,themeService:P,trendLineModel:j,custom:V});let $;L.meta.isDiscrete&&($=function({chart:e,actions:t,componentKey:n,enigmaModel:o,layoutService:i,dockService:s,trendLineModel:l,itemWidths:u,viewState:d,rtl:m,options:{definitionPath:h="/qHyperCubeDef",getRect:f,axisKey:p,renderer:g,areaBuffer:y,processDataPage:v=()=>{}}={}}){const b=c(),M=function({qMode:e}){switch(e){case"K":return $c;case"T":return Wc;default:return Uc}}({qMode:i.getHyperCubeValue("qMode")}),S=function({state:e,contains:t}){return e.set(Kc,[]),{add:t=>{const n=e.get(Kc);n.length=0,n.push(t)},getCurrent:()=>e.get(Kc)[0],getAll:()=>e.get(Kc),contains:n=>t(e.get(Kc)[0],n)}}({state:b,contains:M.contains});!function({layoutService:e,dataStore:t,composition:n}){const o=e.getDataPages()[0];if(!o)return;const i=n.patcher({layoutService:e});i.should(o)&&i(o);t.add(o)}({layoutService:i,dataStore:S,composition:M});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:y}),C=function({dataStore:e,composition:t,enigmaModel:n,layoutService:o,trendLineModel:i=ed,definitionPath:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:n,expand:o,request:i,process:r,connectionless:a,processDataPage:s}){const l=(l,{onProcessing:u}={})=>{if(e.contains(l)){const o=e.getCurrent();if(a)return Promise.resolve(t(o,l));const i=n.release(o.qArea,l),s=r.isProcessing();if(!i&&s&&r.cancel(),!i||s)return Promise.resolve(t(o,l))}if(a)return Promise.resolve(e.getCurrent());r.isProcessing()&&u&&u();const c=o(l);return r(i(c)).then(n=>(s(n),e.add(n),t(n,l)))};return l}({dataStore:e,slice:l,warden:u({bounds:{width:o.meta.size.x,height:o.meta.size.y}}),expand:Zc({layoutService:o}),request:c({definitionPath:a}),process:Qc(n),connectionless:o.meta.isSnapshot,processDataPage:s}),m=r((e,{onProcessing:t,onData:n})=>{d(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==zc)throw e})},jc);return function(e,{onProcessing:t=Bc,onDataPage:n=Bc}={}){m(e,{onProcessing:t,onData:e=>{o.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}({dataStore:S,composition:M,enigmaModel:o,layoutService:i,trendLineModel:l,definitionPath:h,processDataPage:v}),q=function({chart:e,componentKey:t,state:n,dataStore:o,pageData:i,layoutService:r,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:h}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const f=function({chart:e,getRect:t,getDataPages:n,layoutService:o,dockService:i,getItemWidths:r,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:o}=e.meta;if(t)return td;if(!n)return nd;return o?ad:ud}({layoutService:o}),h=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,f=e=>e?h()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const n=o.getLayoutValue("dimensionAxis"),l=c({layoutService:o});return{inTotal:l,inView:cd({chart:e,rect:t(),dockService:i,itemWidths:r(),axisKey:a,renderer:s,isGrouped:o.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Fc/(o.meta.dimensionCount+o.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t,i=Math.min(0,Math.max(e,p(n,o))),r=o?Math.abs(o*i/h()):0;return{start:{pixel:i,item:r},end:{item:Math.min(r+(o||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return p(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:o}){const i=e/n*t,r=Math.abs(o)/i,a=Math.min(1,r+e/i);return[r,a]}({viewSize:h(),inTotal:n,inView:o,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:o,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const r=m({getDataPages:n,layoutService:o,offsets:e,items:t,viewSize:h(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(r):r},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t;return e<=0&&e>=p(n,o)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,o=e*f(n);return Number.isFinite(o)?-o:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:o}=t;return-e*(f(o)*n)}}}}({chart:e,getRect:()=>n.get("rect"),getDataPages:o.getCurrent,layoutService:r,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:h}),p=()=>{const e=f.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const o=f.getOffsets({pixelOffset:e,items:t});return n.set("offsets",o),o},y=({items:e})=>{const t=r.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?f.getUpperBound({items:e}):0;if("number"==typeof n)return f.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:o,end:i}=n,a=1===t&&i?i-e.inView:o;return f.convert.itemToPixelOffset({itemOffset:a,items:e})},v=e=>{const[{qArea:t}]=r.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])},b=e=>{const t=Date.now(),o=p(),r=g({pixelOffset:e,items:o}),a=f.getArea({itemOffset:r.start.item,items:o});if(v(a))return void((f.validate.offset({pixelOffset:e,items:o})||m.get("scrollOffset").start!==r.start.item)&&(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:o})),m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:o})),m.set("scrollOffset",{start:r.start.item,end:r.end.item})));m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:o}));const s=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:o})),m.set("scrollOffset",{start:r.start.item,end:r.end.item}))};i(a,{onProcessing:s,onDataPage:s})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const o=e.component(t);if(!o)return Promise.resolve();n.set("rect","function"==typeof l?l():o.rect),n.set("itemWidths","function"==typeof s?s():s);const r=p();n.set("itemSize",f.getItemSize({items:r}));const a=y({items:r}),u=g({pixelOffset:a,items:r});m.preventSet("viewRange",f.getViewRange({pixelOffset:u.start.pixel,items:r}));const c=f.getArea({itemOffset:u.start.item,items:r});return new Promise(e=>{i(c,{onDataPage:()=>{n.set("scaleRange",f.getScaleRange({offsets:u.start,items:r})),m.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;b(t)},scrollToRelative(e){const t=n.get("items"),o=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});b(o)}}}({chart:e,componentKey:n,state:b,dataStore:S,pageData:C,layoutService:i,dockService:s,itemWidths:u,getRect:f,axisKey:p,renderer:g,areaBuffer:x,viewState:d,rtl:m}),T=function({layoutService:e,dataStore:t}){return function(n){const o=a(n,`${e.refs.dataPages}`);o.length=0,o.push(t.getCurrent())}}({layoutService:i,dataStore:S}),w=function({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r}){return{gestures:[Xc({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r})],native:{type:"native",events:{wheel:Jc({chart:e,actions:t,componentKey:n,scroller:r})}}}}({chart:e,actions:t,componentKey:n,dockService:s,rtl:m,scroller:q});return{interactions:w,query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>S.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>T(e)}}}({chart:t,actions:g,componentKey:Gd.COMPONENT.BAR,enigmaModel:l,layoutService:L,dockService:A,trendLineModel:j,itemWidths:Kd,viewState:o,rtl:N,options:{axisKey:Gd.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const W=function({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:o,isGroupedByDimension:i}=e.meta,r=e.getLayout(),a="K"===r.qHyperCube.qMode,s=ta.dimensionless(r),l=el.getMeasureRefLines(r),u=el.getDimensionRefLines(r,s),c=el.getMeasureRefLineLabels(r),d=el.getDimensionRefLineLabels(r,s);let m={},h={};const f=t=>{if(o){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:o,qMax:i}=n;return el.isOutOfRange({value:t,qMin:o,qMax:i})}return!1},p=t=>{if(!h[t])return!1;if(!n&&i){const n={valueInfo:h[t]},o="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(o);return el.isOutOfDataPages({label:n,dataPages:i})}return!0},g=()=>!(!u||!u.length)&&!u.every(t=>{const n=el.getInputValue({refLineLayout:t,layoutService:e});return f(n)||p(n)}),y={isKMode:a,canBeContinuous:o,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:m,query:{getRefLines:e=>el.getRefLines(r,e),getRefLineLabels:e=>el.getRefLineLabels(r,e)},update:()=>{h=y.dimensionRefLineInfo,g()&&(m=el.getDimensionValuesInfo({layout:r,canBeContinuous:o,discreteModel:t,layoutService:e}),y.dimensionValuesInfo=m,u.forEach(t=>{const n=el.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(h[n]?(h[n].innerValues=m[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,m[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,m[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||m[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||m[n].isMaxOrderOk):h[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return y.update(),y}({layoutService:L,discreteModel:$}),K=function(e){const t={layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:Gd.SCALE.MAIN.MINOR,MAJOR:Gd.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:Gd.COMPONENT.BAR,BAR_AXIS:Gd.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:Gd.COLLECTION.MAIN}}};return t}(L),G=S({picassoInstance:e,plugins:d||[],pluginArgs:K});k.setContext({discrete:$,layoutService:L}),p({alternativeService:F,discrete:$,continuous:jr,legendLayoutService:D,layoutService:L,viewModel:E,dockService:A,themeService:P,styleService:H,continuousDataModel:R,reducedDataModel:z,colorService:B,trendLineModel:j,refLineModel:W,pluginService:G,customTooltipModel:_,tooltipService:U,selectionService:C,logicalSize:O,disclaimerService:I,customTooltipService:V})},[C,h,n,s]),f}({picasso:s,chart:l,environment:t,viewState:n,viewCache:o}),m=function({env:e,services:t}){const n=F(),o=B(),i=K(),r=function({enable:e=!0}={}){const t=B(),n=()=>Date.now().toString()+Math.random(),[o,i]=L(n()),r={properties:void 0};return E(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const o=()=>{t.getEffectiveProperties().then(e=>{const t=le(!0,{},e);if(!r.properties)return void(r.properties=t);const o=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const o=le(!0,{},e),i=le(!0,{},t);return n.exclude=!If(o.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete o.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!If(o,i),n}(r.properties,t);r.properties=t,o.exclude&&!o.properties&&i(n())})};return t.on("changed",o),o(),()=>{t.removeListener("changed",o)}},[e]),o}({enable:!1===t?.layoutService?.meta?.isSnapshot}),[a,s]=U(async()=>{if(!e||!t)return Promise.resolve();const{layoutService:r}=t,{isSnapshot:a,isStacked:s,isContinuous:l}=r.meta,u=[];return a||u.push(o.getEffectiveProperties()),Promise.all(u).then(async e=>{const t=e[0]||void 0;if(t?.qHyperCubeDef){const e=r.getLayout(),a=le(!0,{},t);if(Pf({properties:t,layout:e,isStacked:s,isContinuous:l,model:o,layoutService:r}))return i.pending(),Al(e)?o.setProperties(t).then(()=>{n.clearUndoBuffer()}):void await El(o,a,t);i.restore()}return{properties:t}})},[e,t,r]);if(s&&!s.isHandled)throw s;return a}({env:e,services:u});!function({picasso:e,chart:t,services:n,environment:o,viewState:r,viewCache:a,bootstrapped:s}){const{width:l,height:u}=V(),c=B(),d=j(),m=I(),[h,f]=L(),[p,g]=L(),[y,v]=L(),[b,M]=L(),S=F();function x(s={}){const{alternativeService:l,selectionService:u,refLineModel:f,discrete:p,reducedDataModel:g,continuousDataModel:y,trendLineModel:v,pluginService:b,colorService:M,viewModel:x,dockService:C,themeService:q,customTooltipModel:T,layoutService:w,logicalSize:k,styleService:N,disclaimerService:L,tooltipService:D}=n,O=u.custom.getActions(),E=e.data("q")(h.prepPicassoDataSet()),A={picasso:e,ds:E,rtl:"rtl"===m?.direction,model:c,app:S,chart:t,actions:O,localeInfo:o.localeInfo,logicalSize:k,flags:o.flags,translator:o.translator,selections:d,isLocked:u.getIsSelectionLocked,viewCache:a,viewState:r,alternativeService:l,layoutService:w,dockService:C,viewModel:x,colorService:M,selectionService:u,themeService:q,trendLineModel:v,discrete:p,continuousDataModel:y,reducedDataModel:g.model(),customTooltipModel:T,debouncer:i,refLineModel:f,pluginService:b,styleService:N,disclaimerService:L,tooltipService:D,...s};return Df(w.getLayout(),A,o)}function C(){if(!t.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:o,viewModel:i}=n;a.set("isPreRender",!0);const r=x(p);h.extractDataPages(),t.layoutComponents({settings:r,data:y}),a.set("isPreRender",!1),h.insertDataPages(),i.animations.hasSlicedHats=r.components.filter(e=>"box-sliced-hat"===e.type).length>0;const s=[];return 1!==r.components.length&&o.meta.isDiscrete&&s.push(e.command.initialize()),Promise.all(s)}const[[q,T]=[]]=U(()=>{if(!(e&&t&&n&&o&&r&&a&&s))return Promise.resolve();const{alternativeService:i,layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:m,reducedDataModel:h,continuousDataModel:f,trendLineModel:p,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:S,disclaimerService:x,customTooltipService:C,tooltipService:q}=n;if(!u?.custom?.getActions())return Promise.resolve();const{properties:T}=s,w=T?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);w&&(S.useCustomTooltip=!1);const k=()=>{M(Date.now()),b.animations.isPartialUpdating=!0},N=()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),k()};r.onChanged("scrollOffset",N),r.onChanged("legendScrollOffset",k),r.intercept("zoom",m.event.onZoomIntercept({viewCache:a})),r.onChanged("zoom",m.event.onZoomChange({layoutService:l,continuousDataModel:f},k)),u.setLayout(l.getLayout());const L=[];l.meta.isContinuous&&(f.update(l.getLayout()),L.push(f.initialFetch())),p.command.update(),L.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),C.setProperties(T),q.expando.set("properties",T),x.initialize(),L.push(Promise.resolve({properties:s.properties}));const D=()=>[v.initialize(),y.initialize(),i.initialize({properties:T}),km({reducedDataModel:h,layoutService:l,continuousDataModel:f,trendLineModel:p})];return Promise.all(L).then(e=>Promise.all(D()).then(t=>[e,t.pop()]))},[s]);E(()=>{if(!n?.colorService?.getMain()||!T)return;const{layoutService:e,selectionService:t,reducedDataModel:i,continuousDataModel:r,trendLineModel:s,legendLayoutService:l,colorService:u,viewModel:c}=n;a.set("minorMinMax",T);const d=()=>!e.meta.isContinuous&&(i.model().mode.isReduced||e.meta.isStacked)&&l,m=e.getHyperCube(),h=e.meta.isContinuous?r.getInitialCube():i.model().cube,{field:p}=u.getMain().getSettings(),y=d(),v=y?l.getHyperCube():void 0;t.setBrushAliases({colorField:p,useLegendCube:y,legendAlias:`legendCube/${p}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:o,layoutService:i,viewModel:r,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:r.fields.majorNumeric,from:i.meta.isStackedByDimension?r.fields.majorStack:r.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:o,virtualFields:c}}),prepPicassoData(i){const r=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:o,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:o,virtualFields:c}},...i];return n&&r.push({type:"q",key:"legendCube",data:n,config:{localeInfo:o,virtualFields:c}}),a.query.hasTrendLines()&&r.push({key:"trend",data:a.query.getData()}),r},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:m,miniCube:h,legendCube:v,localeInfo:o.localeInfo,layoutService:e,viewModel:c,trendLineModel:s}),M=q[q.length-1];g({localeInfo:o.localeInfo,...M}),f(b)},[T]),E(()=>{if(!n||!p||!h)return;const e=n.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[p]),E(()=>{n?.colorService?.getMain()&&t.update&&h&&y&&C().then(()=>{const{layoutService:e,discrete:o,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([o.query.getCurrentDataPage()])}t.update(),ql.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),E(()=>{if(!(l&&u&&h&&t?.update&&n?.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:r}=n;i.update({width:l,height:u}),r.setTheme(o.theme),C().then(()=>{t.update&&t.update()})},[l,u]),E(()=>{if(!t?.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}({picasso:s,chart:l,services:u,environment:t,viewState:n,viewCache:o,bootstrapped:m}),Of({environment:t,services:u,chart:l,viewState:n,bootstrapped:m})}}});const Y={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function X(e){return Y[e]||e}function J(e){return function(t,n,o){let i,r,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(r)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(r));const n=X(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(o),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(r),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=X(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,r={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),u&&c()},off(){u=!1,d()},on(){u=!0,0===l.length&&c()},destroy(){d(),a&&a.destroy(),a=null,r=null,i=null}}}}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q=Object.prototype.hasOwnProperty,ee=Object.prototype.toString,te=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,oe=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ee.call(e)},ie=function(e){if(!e||"[object Object]"!==ee.call(e))return!1;var t,n=Q.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&Q.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||Q.call(e,t)},re=function(e,t){te&&"__proto__"===t.name?te(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ae=function(e,t){if("__proto__"===t){if(!Q.call(e,t))return;if(ne)return ne(e,t).value}return e[t]},se=function e(){var t,n,o,i,r,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(n in t)o=ae(s,n),s!==(i=ae(t,n))&&(c&&i&&(ie(i)||(r=oe(i)))?(r?(r=!1,a=o&&oe(o)?o:[]):a=o&&ie(o)?o:{},re(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&re(s,{name:n,newValue:i}));return s},le=Z(se),ue={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:ce}=ue;function de({layoutService:e,largeDataService:t}){const{maxNumPoints:n=ce}=t?.meta||{},{qHyperCube:o}=e.getLayout();return o.qSize.qcy*o.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:me}=ue,he=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=me}=t?.meta||{},{qHyperCube:o}=e.getLayout();return o.qDimensionInfo.length>1&&!de({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:fe}=ue,{MAX_NUM_POINTS:pe,DEFAULT_NUM_POINTS:ge,DEFAULT_NUM_LINES:ye}=ue,{DEFAULT_NUM_POINTS:ve}=ue,be=({layoutService:e,largeDataService:t})=>{if(!de({layoutService:e,largeDataService:t})){const{maxNumPoints:e=ve}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:o=ye,maxNumPoints:i=ge,hasInjectedData:r=!1}=t?.meta||{};if(he({layoutService:e,largeDataService:t})*n[0]<=i)return n[0];const a=Math.max(1,Math.min(o,n[1])),s=i/a,l=Math.floor(n[0]<=s?s:s/4),u=2*a*(a+1);return r&&(a>ye||i>ge)?Math.min(l,Math.ceil(pe/u)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=fe}=t?.meta||{},{measureCount:o=1}=e?.meta||{},i=4+2*(o-1);return Math.floor(n/(o*i))})({layoutService:e,largeDataService:t})};function Me({model:e,layoutService:t,largeDataService:n,definitionPath:o="/qHyperCubeDef"}){return{shouldFetchReduced:()=>de({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>be({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>he({layoutService:t,largeDataService:n}),fetch:(i,r)=>(({start:e,end:t,model:n,layoutService:o,largeDataService:i,definitionPath:r})=>{const a={qStart:e,qEnd:t,qNbrPoints:be({layoutService:o,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:he({layoutService:o,largeDataService:i})};return n.getHyperCubeContinuousData(r,a,!1)})({start:i,end:r,model:e,layoutService:t,largeDataService:n,definitionPath:o})}}function Se(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function xe({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let o=n+e,i=o+t;return 1===t&&0===e&&(o=n-.5,i=n+.5),{zoom:{min:o,max:i}}}(n,t.get("continuousMin"))}}}function Ce(){const e=()=>{},t=[],n={};return e.set=(e,o)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=o},e.forEach=e=>{t.forEach((t,o)=>e(n[t],o))},e.has=e=>e in n,e}function qe(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const o=[],i=Ce(),r=Ce();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(r.has(l)||r.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&o.push(s)}return i.forEach((e,t)=>o.splice(t,0,e)),r.forEach(e=>o.push(e)),o}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const o=[];let i,r;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(r||(r=s)),s[0].qNum>=e&&s[0].qNum<=t&&o.push(s)}return i&&o.unshift(i),r&&o.push(r),o}({start:e,end:t,matrix:n})}function Te(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function we(e,t,n){const o={qDataPages:(n.qDataPages||[]).map(n=>{const o=qe(e,t,n.qMatrix),i=Te(n.qArea,o);return{...n,qArea:i,qMatrix:o}})};return n.qAxisData&&n.qAxisData.qAxis&&(o.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,o)=>((o.qStart>=e&&o.qStart<=t||o.qEnd>=e&&o.qEnd<=t||o.qStart<e&&o.qEnd>t)&&n.push(o),n),[])}))}}(e,t,n.qAxisData)),o}const ke=2**.5,Ne=1/ke,Le=Ne**44;function De(e){return e.qIsOtherCell}function Oe({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(De)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(De)||t++}),t}(n)}const Ee={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var Ae={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const o=t[e],i=t[e+1];o.data={},i||1===o.end?i?(o.data.start=o.value,o.data.end=i.value,o.end=i.position):(o.data.start=o.value,o.data.end=o.value):(o.data.start=o.value,o.data.end=n,o.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const o=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],o.data.start]},x:0,y:0,width:o.start*this.rect.width,height:this.rect.height})}return n}};function Ie(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Pe(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function Re(e,t){const{localProps:{size:n},props:{anchor:o}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:o}){const i=e.label.padding,r=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>o.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,o)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=o;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},h=s(`${l[0]}…`).width,f=Math.max(0,m.width-u.width),p=Math.max(0,m.height-u.height),g=r*f,y=a*p;return{show:m.width>=Math.min(h,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),r=function({localProps:{size:e},style:t,scale:n,props:o}){const[i,r]=n.domain(),a=Math.max(0,Math.min(1,o.guideLine.major.justify));return{resolve:(n,o)=>{const s=a*o.width,l=Ie(o.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=r,x1:l,y1:0,x2:l,y2:Ie(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const o=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:o,height:t.height}}(e,n,o);return{rect:t,label:i.resolve(e,t),guideLine:r.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const o=e[n-1],i=t[n-1].label;if(o&&o.start===o.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!Pe(n.segment,i.segment)}}(e,a),a}function ze(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:o=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),r=Ie(o.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:r,y1:Ie(i,n.minorGuideLine.strokeWidth),x2:r,y2:Ie(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Be(e){return e.filter(e=>e.show).map(e=>le({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Fe={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),o=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const o=Ie(1,t.line.strokeWidth);return{show:n.line.show,x1:Ie(0,t.line.strokeWidth),y1:o,x2:Ie(e.width,t.line.strokeWidth),y2:o,style:t.line}}(this),this.state.major=Re(n,this),this.state.minor=ze(o,this)},render(){return[...Be([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>le({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...Be(this.state.major.map(e=>e.guideLine)),...Be(this.state.minor.map(e=>e.guideLine))];var e}};function He(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function je(e){var t;return 1===e.length&&(t=e,e=function(e,n){return He(t(e),n)}),{left:function(t,n,o,i){for(null==o&&(o=0),null==i&&(i=t.length);o<i;){var r=o+i>>>1;e(t[r],n)<0?o=r+1:i=r}return o},right:function(t,n,o,i){for(null==o&&(o=0),null==i&&(i=t.length);o<i;){var r=o+i>>>1;e(t[r],n)>0?i=r:o=r+1}return o}}}var _e=je(He).right,Ve=Math.sqrt(50),Ue=Math.sqrt(10),$e=Math.sqrt(2);function We(e,t,n){var o=(t-e)/Math.max(0,n),i=Math.floor(Math.log(o)/Math.LN10),r=o/Math.pow(10,i);return i>=0?(r>=Ve?10:r>=Ue?5:r>=$e?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(r>=Ve?10:r>=Ue?5:r>=$e?2:1)}function Ke(e,t,n){var o=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(o)/Math.LN10)),r=o/i;return r>=Ve?i*=10:r>=Ue?i*=5:r>=$e&&(i*=2),t<e?-i:i}function Ge(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Ye="$";function Xe(){}function Je(e,t){var n=new Xe;if(e instanceof Xe)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var o,i=-1,r=e.length;if(null==t)for(;++i<r;)n.set(i,e[i]);else for(;++i<r;)n.set(t(o=e[i],i,e),o)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Ze(){}Xe.prototype=Je.prototype={constructor:Xe,has:function(e){return Ye+e in this},get:function(e){return this[Ye+e]},set:function(e,t){return this[Ye+e]=t,this},remove:function(e){var t=Ye+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ye&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ye&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ye&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ye&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ye&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ye)return!1;return!0},each:function(e){for(var t in this)t[0]===Ye&&e(this[t],t.slice(1),this)}};var Qe=Je.prototype;Ze.prototype={constructor:Ze,has:Qe.has,add:function(e){return this[Ye+(e+="")]=e,this},remove:Qe.remove,clear:Qe.clear,values:Qe.keys,size:Qe.size,empty:Qe.empty,each:Qe.each};var et=Array.prototype,tt=et.map,nt=et.slice;function ot(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function it(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function rt(){}var at=.7,st=1/at,lt="\\s*([+-]?\\d+)\\s*",ut="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ct="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dt=/^#([0-9a-f]{3,8})$/,mt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),ht=new RegExp("^rgb\\("+[ct,ct,ct]+"\\)$"),ft=new RegExp("^rgba\\("+[lt,lt,lt,ut]+"\\)$"),pt=new RegExp("^rgba\\("+[ct,ct,ct,ut]+"\\)$"),gt=new RegExp("^hsl\\("+[ut,ct,ct]+"\\)$"),yt=new RegExp("^hsla\\("+[ut,ct,ct,ut]+"\\)$"),vt={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(){return this.rgb().formatHex()}function Mt(){return this.rgb().formatRgb()}function St(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?xt(t):3===n?new Tt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ct(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ct(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=mt.exec(e))?new Tt(t[1],t[2],t[3],1):(t=ht.exec(e))?new Tt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ft.exec(e))?Ct(t[1],t[2],t[3],t[4]):(t=pt.exec(e))?Ct(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=gt.exec(e))?Lt(t[1],t[2]/100,t[3]/100,1):(t=yt.exec(e))?Lt(t[1],t[2]/100,t[3]/100,t[4]):vt.hasOwnProperty(e)?xt(vt[e]):"transparent"===e?new Tt(NaN,NaN,NaN,0):null}function xt(e){return new Tt(e>>16&255,e>>8&255,255&e,1)}function Ct(e,t,n,o){return o<=0&&(e=t=n=NaN),new Tt(e,t,n,o)}function qt(e,t,n,o){return 1===arguments.length?((i=e)instanceof rt||(i=St(i)),i?new Tt((i=i.rgb()).r,i.g,i.b,i.opacity):new Tt):new Tt(e,t,n,null==o?1:o);var i}function Tt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function wt(){return"#"+Nt(this.r)+Nt(this.g)+Nt(this.b)}function kt(){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 Nt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Lt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ot(e,t,n,o)}function Dt(e){if(e instanceof Ot)return new Ot(e.h,e.s,e.l,e.opacity);if(e instanceof rt||(e=St(e)),!e)return new Ot;if(e instanceof Ot)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(a=t===r?(n-o)/s+6*(n<o):n===r?(o-t)/s+2:(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Ot(a,s,l,e.opacity)}function Ot(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function Et(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function At(e){return function(){return e}}function It(e){return 1===(e=+e)?Pt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):At(isNaN(t)?n:t)}}function Pt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):At(isNaN(e)?t:e)}ot(rt,St,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:bt,formatHex:bt,formatHsl:function(){return Dt(this).formatHsl()},formatRgb:Mt,toString:Mt}),ot(Tt,qt,it(rt,{brighter:function(e){return e=null==e?st:Math.pow(st,e),new Tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?at:Math.pow(at,e),new Tt(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:wt,formatHex:wt,formatRgb:kt,toString:kt})),ot(Ot,function(e,t,n,o){return 1===arguments.length?Dt(e):new Ot(e,t,n,null==o?1:o)},it(rt,{brighter:function(e){return e=null==e?st:Math.pow(st,e),new Ot(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?at:Math.pow(at,e),new Ot(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Tt(Et(e>=240?e-240:e+120,i,o),Et(e,i,o),Et(e<120?e+240:e-120,i,o),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 Rt=function e(t){var n=It(t);function o(e,t){var o=n((e=qt(e)).r,(t=qt(t)).r),i=n(e.g,t.g),r=n(e.b,t.b),a=Pt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=i(t),e.b=r(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function zt(e,t){t||(t=[]);var n,o=e?Math.min(t.length,e.length):0,i=t.slice();return function(r){for(n=0;n<o;++n)i[n]=e[n]*(1-r)+t[n]*r;return i}}function Bt(e,t){var n,o=t?t.length:0,i=e?Math.min(o,e.length):0,r=new Array(i),a=new Array(o);for(n=0;n<i;++n)r[n]=$t(e[n],t[n]);for(;n<o;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=r[n](e);return a}}function Ft(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Ht(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jt(e,t){var n,o={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?o[n]=$t(e[n],t[n]):i[n]=t[n];return function(e){for(n in o)i[n]=o[n](e);return i}}var _t=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vt=new RegExp(_t.source,"g");function Ut(e,t){var n,o,i,r=_t.lastIndex=Vt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=_t.exec(e))&&(o=Vt.exec(t));)(i=o.index)>r&&(i=t.slice(r,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Ht(n,o)})),r=Vt.lastIndex;return r<t.length&&(i=t.slice(r),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 n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}function $t(e,t){var n,o,i=typeof t;return null==t||"boolean"===i?At(t):("number"===i?Ht:"string"===i?(n=St(t))?(t=n,Rt):Ut:t instanceof St?Rt:t instanceof Date?Ft:(o=t,!ArrayBuffer.isView(o)||o instanceof DataView?Array.isArray(t)?Bt:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?jt:Ht:zt))(e,t)}function Wt(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Kt(e){return+e}var Gt=[0,1];function Yt(e){return e}function Xt(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Jt(e){var t,n=e[0],o=e[e.length-1];return n>o&&(t=n,n=o,o=t),function(e){return Math.max(n,Math.min(o,e))}}function Zt(e,t,n){var o=e[0],i=e[1],r=t[0],a=t[1];return i<o?(o=Xt(i,o),r=n(a,r)):(o=Xt(o,i),r=n(r,a)),function(e){return r(o(e))}}function Qt(e,t,n){var o=Math.min(e.length,t.length)-1,i=new Array(o),r=new Array(o),a=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<o;)i[a]=Xt(e[a],e[a+1]),r[a]=n(t[a],t[a+1]);return function(t){var n=_e(e,t,1,o)-1;return r[n](i[n](t))}}function en(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function tn(e,t){return function(){var e,t,n,o,i,r,a=Gt,s=Gt,l=$t,u=Yt;function c(){return o=Math.min(a.length,s.length)>2?Qt:Zt,i=r=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=o(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((r||(r=o(s,a.map(e),Ht)))(n)))},d.domain=function(e){return arguments.length?(a=tt.call(e,Kt),u===Yt||(u=Jt(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=nt.call(e),c()):s.slice()},d.rangeRound=function(e){return s=nt.call(e),l=Wt,c()},d.clamp=function(e){return arguments.length?(u=e?Jt(a):Yt,d):u!==Yt},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,o){return e=n,t=o,c()}}()(e,t)}function nn(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,o=e.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+e.slice(n+1)]}function on(e){return(e=nn(Math.abs(e)))?e[1]:NaN}var rn,an=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sn(e){if(!(t=an.exec(e)))throw new Error("invalid format: "+e);var t;return new ln({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ln(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function un(e,t){var n=nn(e,t);if(!n)return e+"";var o=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+o:o.length>i+1?o.slice(0,i+1)+"."+o.slice(i+1):o+new Array(i-o.length+2).join("0")}sn.prototype=ln.prototype,ln.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var cn={"%":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.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):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 un(100*e,t)},r:un,s:function(e,t){var n=nn(e,t);if(!n)return e+"";var o=n[0],i=n[1],r=i-(rn=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=o.length;return r===a?o:r>a?o+new Array(r-a+1).join("0"):r>0?o.slice(0,r)+"."+o.slice(r):"0."+new Array(1-r).join("0")+nn(e,Math.max(0,t+r-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function dn(e){return e}var mn,hn,fn,pn=Array.prototype.map,gn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yn(e){var t=void 0===e.grouping||void 0===e.thousands?dn:function(e,t){return function(n,o){for(var i=n.length,r=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>o&&(s=Math.max(1,o-l)),r.push(n.substring(i-=s,i+s)),!((l+=s+1)>o));)s=e[a=(a+1)%e.length];return r.reverse().join(t)}}(pn.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",r=void 0===e.numerals?dn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(pn.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function u(e){var u=(e=sn(e)).fill,c=e.align,d=e.sign,m=e.symbol,h=e.zero,f=e.width,p=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(p=!0,v="g"):cn[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===u&&"="===c)&&(h=!0,u="0",c="=");var b="$"===m?n:"#"===m&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M="$"===m?o:/[%p]/.test(v)?a:"",S=cn[v],x=/[defgprs%]/.test(v);function C(e){var n,o,a,m=b,C=M;if("c"===v)C=S(e)+C,e="";else{var q=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:S(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,o=1,i=-1;o<n;++o)switch(e[o]){case".":i=t=o;break;case"0":0===i&&(i=o),t=o;break;default:if(!+e[o])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),q&&0===+e&&"+"!==d&&(q=!1),m=(q?"("===d?d:s:"-"===d||"("===d?"":d)+m,C=("s"===v?gn[8+rn/3]:"")+C+(q&&"("===d?")":""),x)for(n=-1,o=e.length;++n<o;)if(48>(a=e.charCodeAt(n))||a>57){C=(46===a?i+e.slice(n+1):e.slice(n))+C,e=e.slice(0,n);break}}p&&!h&&(e=t(e,1/0));var T=m.length+e.length+C.length,w=T<f?new Array(f-T+1).join(u):"";switch(p&&h&&(e=t(w+e,w.length?f-C.length:1/0),w=""),c){case"<":e=m+e+C+w;break;case"=":e=m+w+e+C;break;case"^":e=w.slice(0,T=w.length>>1)+m+e+C+w.slice(T);break;default:e=w+m+e+C}return r(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:u,formatPrefix:function(e,t){var n=u(((e=sn(e)).type="f",e)),o=3*Math.max(-8,Math.min(8,Math.floor(on(t)/3))),i=Math.pow(10,-o),r=gn[8+o/3];return function(e){return n(i*e)+r}}}}function vn(e,t,n,o){var i,r=Ke(e,t,n);switch((o=sn(null==o?",f":o)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=o.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(on(t)/3)))-on(Math.abs(e)))}(r,a))||(o.precision=i),fn(o,a);case"":case"e":case"g":case"p":case"r":null!=o.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,on(t)-on(e))+1}(r,Math.max(Math.abs(e),Math.abs(t))))||(o.precision=i-("e"===o.type));break;case"f":case"%":null!=o.precision||isNaN(i=function(e){return Math.max(0,-on(Math.abs(e)))}(r))||(o.precision=i-2*("%"===o.type))}return hn(o)}function bn(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var o,i,r,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((o=t<e)&&(i=e,e=t,t=i),0===(a=We(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),r=new Array(i=Math.ceil(t-e+1));++s<i;)r[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),r=new Array(i=Math.ceil(e-t+1));++s<i;)r[s]=(e-s)/a;return o&&r.reverse(),r}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var o=t();return vn(o[0],o[o.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var o,i=t(),r=0,a=i.length-1,s=i[r],l=i[a];return l<s&&(o=s,s=l,l=o,o=r,r=a,a=o),(o=We(s,l,n))>0?o=We(s=Math.floor(s/o)*o,l=Math.ceil(l/o)*o,n):o<0&&(o=We(s=Math.ceil(s*o)/o,l=Math.floor(l*o)/o,n)),o>0?(i[r]=Math.floor(s/o)*o,i[a]=Math.ceil(l/o)*o,t(i)):o<0&&(i[r]=Math.ceil(s*o)/o,i[a]=Math.floor(l*o)/o,t(i)),e},e}function Mn(){var e=tn(Yt,Yt);return e.copy=function(){return en(e,Mn())},Ge.apply(e,arguments),bn(e)}mn=yn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),hn=mn.format,fn=mn.formatPrefix;var Sn=new Date,xn=new Date;function Cn(e,t,n,o){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,o,r){var a,s=[];if(n=i.ceil(n),r=null==r?1:Math.floor(r),!(n<o&&r>0))return s;do{s.push(a=new Date(+n)),t(n,r),e(n)}while(a<n&&n<o);return s},i.filter=function(n){return Cn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,o){if(e>=e)if(o<0)for(;++o<=0;)for(;t(e,-1),!n(e););else for(;--o>=0;)for(;t(e,1),!n(e););})},n&&(i.count=function(t,o){return Sn.setTime(+t),xn.setTime(+o),e(Sn),e(xn),Math.floor(n(Sn,xn))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(o?function(t){return o(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var qn=Cn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});qn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Cn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):qn:null},qn.range;var Tn=6e4,wn=36e5,kn=864e5,Nn=6048e5,Ln=Cn(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()});Ln.range;var Dn=Cn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Tn)/kn},function(e){return e.getDate()-1});function On(e){return Cn(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-(t.getTimezoneOffset()-e.getTimezoneOffset())*Tn)/Nn})}Dn.range;var En=On(0),An=On(1),In=On(2),Pn=On(3),Rn=On(4),zn=On(5),Bn=On(6);En.range,An.range,In.range,Pn.range,Rn.range,zn.range,Bn.range;var Fn=Cn(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()});Fn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Cn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},Fn.range;var Hn=Cn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*Tn)},function(e,t){return(t-e)/Tn},function(e){return e.getUTCMinutes()});Hn.range;var jn=Cn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*wn)},function(e,t){return(t-e)/wn},function(e){return e.getUTCHours()});jn.range;var _n=Cn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/kn},function(e){return e.getUTCDate()-1});function Vn(e){return Cn(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)/Nn})}_n.range;var Un=Vn(0),$n=Vn(1),Wn=Vn(2),Kn=Vn(3),Gn=Vn(4),Yn=Vn(5),Xn=Vn(6);Un.range,$n.range,Wn.range,Kn.range,Gn.range,Yn.range,Xn.range;var Jn=Cn(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()});Jn.range;var Zn=Cn(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 eo(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 to(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Zn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Cn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Zn.range;var no,oo,io={"-":"",_:" ",0:"0"},ro=/^\s*\d+/,ao=/^%/,so=/[\\^$*+?|[\]().{}]/g;function lo(e,t,n){var o=e<0?"-":"",i=(o?-e:e)+"",r=i.length;return o+(r<n?new Array(n-r+1).join(t)+i:i)}function uo(e){return e.replace(so,"\\$&")}function co(e){return new RegExp("^(?:"+e.map(uo).join("|")+")","i")}function mo(e){for(var t={},n=-1,o=e.length;++n<o;)t[e[n].toLowerCase()]=n;return t}function ho(e,t,n){var o=ro.exec(t.slice(n,n+1));return o?(e.w=+o[0],n+o[0].length):-1}function fo(e,t,n){var o=ro.exec(t.slice(n,n+1));return o?(e.u=+o[0],n+o[0].length):-1}function po(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.U=+o[0],n+o[0].length):-1}function go(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.V=+o[0],n+o[0].length):-1}function yo(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.W=+o[0],n+o[0].length):-1}function vo(e,t,n){var o=ro.exec(t.slice(n,n+4));return o?(e.y=+o[0],n+o[0].length):-1}function bo(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function Mo(e,t,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function So(e,t,n){var o=ro.exec(t.slice(n,n+1));return o?(e.q=3*o[0]-3,n+o[0].length):-1}function xo(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.m=o[0]-1,n+o[0].length):-1}function Co(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.d=+o[0],n+o[0].length):-1}function qo(e,t,n){var o=ro.exec(t.slice(n,n+3));return o?(e.m=0,e.d=+o[0],n+o[0].length):-1}function To(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.H=+o[0],n+o[0].length):-1}function wo(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.M=+o[0],n+o[0].length):-1}function ko(e,t,n){var o=ro.exec(t.slice(n,n+2));return o?(e.S=+o[0],n+o[0].length):-1}function No(e,t,n){var o=ro.exec(t.slice(n,n+3));return o?(e.L=+o[0],n+o[0].length):-1}function Lo(e,t,n){var o=ro.exec(t.slice(n,n+6));return o?(e.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function Do(e,t,n){var o=ao.exec(t.slice(n,n+1));return o?n+o[0].length:-1}function Oo(e,t,n){var o=ro.exec(t.slice(n));return o?(e.Q=+o[0],n+o[0].length):-1}function Eo(e,t,n){var o=ro.exec(t.slice(n));return o?(e.s=+o[0],n+o[0].length):-1}function Ao(e,t){return lo(e.getDate(),t,2)}function Io(e,t){return lo(e.getHours(),t,2)}function Po(e,t){return lo(e.getHours()%12||12,t,2)}function Ro(e,t){return lo(1+Dn.count(Fn(e),e),t,3)}function zo(e,t){return lo(e.getMilliseconds(),t,3)}function Bo(e,t){return zo(e,t)+"000"}function Fo(e,t){return lo(e.getMonth()+1,t,2)}function Ho(e,t){return lo(e.getMinutes(),t,2)}function jo(e,t){return lo(e.getSeconds(),t,2)}function _o(e){var t=e.getDay();return 0===t?7:t}function Vo(e,t){return lo(En.count(Fn(e)-1,e),t,2)}function Uo(e){var t=e.getDay();return t>=4||0===t?Rn(e):Rn.ceil(e)}function $o(e,t){return e=Uo(e),lo(Rn.count(Fn(e),e)+(4===Fn(e).getDay()),t,2)}function Wo(e){return e.getDay()}function Ko(e,t){return lo(An.count(Fn(e)-1,e),t,2)}function Go(e,t){return lo(e.getFullYear()%100,t,2)}function Yo(e,t){return lo((e=Uo(e)).getFullYear()%100,t,2)}function Xo(e,t){return lo(e.getFullYear()%1e4,t,4)}function Jo(e,t){var n=e.getDay();return lo((e=n>=4||0===n?Rn(e):Rn.ceil(e)).getFullYear()%1e4,t,4)}function Zo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lo(t/60|0,"0",2)+lo(t%60,"0",2)}function Qo(e,t){return lo(e.getUTCDate(),t,2)}function ei(e,t){return lo(e.getUTCHours(),t,2)}function ti(e,t){return lo(e.getUTCHours()%12||12,t,2)}function ni(e,t){return lo(1+_n.count(Zn(e),e),t,3)}function oi(e,t){return lo(e.getUTCMilliseconds(),t,3)}function ii(e,t){return oi(e,t)+"000"}function ri(e,t){return lo(e.getUTCMonth()+1,t,2)}function ai(e,t){return lo(e.getUTCMinutes(),t,2)}function si(e,t){return lo(e.getUTCSeconds(),t,2)}function li(e){var t=e.getUTCDay();return 0===t?7:t}function ui(e,t){return lo(Un.count(Zn(e)-1,e),t,2)}function ci(e){var t=e.getUTCDay();return t>=4||0===t?Gn(e):Gn.ceil(e)}function di(e,t){return e=ci(e),lo(Gn.count(Zn(e),e)+(4===Zn(e).getUTCDay()),t,2)}function mi(e){return e.getUTCDay()}function hi(e,t){return lo($n.count(Zn(e)-1,e),t,2)}function fi(e,t){return lo(e.getUTCFullYear()%100,t,2)}function pi(e,t){return lo((e=ci(e)).getUTCFullYear()%100,t,2)}function gi(e,t){return lo(e.getUTCFullYear()%1e4,t,4)}function yi(e,t){var n=e.getUTCDay();return lo((e=n>=4||0===n?Gn(e):Gn.ceil(e)).getUTCFullYear()%1e4,t,4)}function vi(){return"+0000"}function bi(){return"%"}function Mi(e){return+e}function Si(e){return Math.floor(+e/1e3)}!function(e){no=function(e){var t=e.dateTime,n=e.date,o=e.time,i=e.periods,r=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=co(i),c=mo(i),d=co(r),m=mo(r),h=co(a),f=mo(a),p=co(s),g=mo(s),y=co(l),v=mo(l),b={a:function(e){return a[e.getDay()]},A:function(e){return r[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ao,e:Ao,f:Bo,g:Yo,G:Jo,H:Io,I:Po,j:Ro,L:zo,m:Fo,M:Ho,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Mi,s:Si,S:jo,u:_o,U:Vo,V:$o,w:Wo,W:Ko,x:null,X:null,y:Go,Y:Xo,Z:Zo,"%":bi},M={a:function(e){return a[e.getUTCDay()]},A:function(e){return r[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Qo,e:Qo,f:ii,g:pi,G:yi,H:ei,I:ti,j:ni,L:oi,m:ri,M:ai,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Mi,s:Si,S:si,u:li,U:ui,V:di,w:mi,W:hi,x:null,X:null,y:fi,Y:gi,Z:vi,"%":bi},S={a:function(e,t,n){var o=h.exec(t.slice(n));return o?(e.w=f[o[0].toLowerCase()],n+o[0].length):-1},A:function(e,t,n){var o=d.exec(t.slice(n));return o?(e.w=m[o[0].toLowerCase()],n+o[0].length):-1},b:function(e,t,n){var o=y.exec(t.slice(n));return o?(e.m=v[o[0].toLowerCase()],n+o[0].length):-1},B:function(e,t,n){var o=p.exec(t.slice(n));return o?(e.m=g[o[0].toLowerCase()],n+o[0].length):-1},c:function(e,n,o){return q(e,t,n,o)},d:Co,e:Co,f:Lo,g:bo,G:vo,H:To,I:To,j:qo,L:No,m:xo,M:wo,p:function(e,t,n){var o=u.exec(t.slice(n));return o?(e.p=c[o[0].toLowerCase()],n+o[0].length):-1},q:So,Q:Oo,s:Eo,S:ko,u:fo,U:po,V:go,w:ho,W:yo,x:function(e,t,o){return q(e,n,t,o)},X:function(e,t,n){return q(e,o,t,n)},y:bo,Y:vo,Z:Mo,"%":Do};function x(e,t){return function(n){var o,i,r,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=io[o=e.charAt(++s)])?o=e.charAt(++s):i="e"===o?" ":"0",(r=t[o])&&(o=r(n,i)),a.push(o),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var o,i,r=to(1900,void 0,1);if(q(r,e,n+="",0)!=n.length)return null;if("Q"in r)return new Date(r.Q);if("s"in r)return new Date(1e3*r.s+("L"in r?r.L:0));if(t&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"V"in r){if(r.V<1||r.V>53)return null;"w"in r||(r.w=1),"Z"in r?(i=(o=eo(to(r.y,0,1))).getUTCDay(),o=i>4||0===i?$n.ceil(o):$n(o),o=_n.offset(o,7*(r.V-1)),r.y=o.getUTCFullYear(),r.m=o.getUTCMonth(),r.d=o.getUTCDate()+(r.w+6)%7):(i=(o=Qn(to(r.y,0,1))).getDay(),o=i>4||0===i?An.ceil(o):An(o),o=Dn.offset(o,7*(r.V-1)),r.y=o.getFullYear(),r.m=o.getMonth(),r.d=o.getDate()+(r.w+6)%7)}else("W"in r||"U"in r)&&("w"in r||(r.w="u"in r?r.u%7:"W"in r?1:0),i="Z"in r?eo(to(r.y,0,1)).getUTCDay():Qn(to(r.y,0,1)).getDay(),r.m=0,r.d="W"in r?(r.w+6)%7+7*r.W-(i+5)%7:r.w+7*r.U-(i+6)%7);return"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,eo(r)):Qn(r)}}function q(e,t,n,o){for(var i,r,a=0,s=t.length,l=n.length;a<s;){if(o>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(r=S[i in io?t.charAt(a++):i])||(o=r(e,n,o))<0)return-1}else if(i!=n.charCodeAt(o++))return-1}return o}return b.x=x(n,b),b.X=x(o,b),b.c=x(t,b),M.x=x(n,M),M.X=x(o,M),M.c=x(t,M),{format:function(e){var t=x(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+="",M);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}(e),no.format,no.parse,oo=no.utcFormat,no.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"]});var xi=1e3,Ci=6e4,qi=36e5,Ti=864e5,wi=2592e6,ki=31536e6;function Ni(e){return new Date(e)}function Li(e){return e instanceof Date?+e:+new Date(+e)}function Di(e,t,n,o,i,r,a,s,l){var u=tn(Yt,Yt),c=u.invert,d=u.domain,m=l(".%L"),h=l(":%S"),f=l("%I:%M"),p=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),M=[[a,1,xi],[a,5,5e3],[a,15,15e3],[a,30,3e4],[r,1,Ci],[r,5,3e5],[r,15,9e5],[r,30,18e5],[i,1,qi],[i,3,108e5],[i,6,216e5],[i,12,432e5],[o,1,Ti],[o,2,1728e5],[n,1,6048e5],[t,1,wi],[t,3,7776e6],[e,1,ki]];function S(s){return(a(s)<s?m:r(s)<s?h:i(s)<s?f:o(s)<s?p:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function x(t,n,o,i){if(null==t&&(t=10),"number"==typeof t){var r=Math.abs(o-n)/t,a=je(function(e){return e[2]}).right(M,r);a===M.length?(i=Ke(n/ki,o/ki,t),t=e):a?(i=(a=M[r/M[a-1][2]<M[a][2]/r?a-1:a])[1],t=a[0]):(i=Math.max(Ke(n,o,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(tt.call(e,Li)):d().map(Ni)},u.ticks=function(e,t){var n,o=d(),i=o[0],r=o[o.length-1],a=r<i;return a&&(n=i,i=r,r=n),n=(n=x(e,i,r,t))?n.range(i,r+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?S:l(t)},u.nice=function(e,t){var n=d();return(e=x(e,n[0],n[n.length-1],t))?d(function(e,t){var n,o=0,i=(e=e.slice()).length-1,r=e[o],a=e[i];return a<r&&(n=o,o=i,i=n,n=r,r=a,a=n),e[o]=t.floor(r),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return en(u,Di(e,t,n,o,i,r,a,s,l))},u}function Oi(){return Ge.apply(Di(Zn,Jn,Un,_n,jn,Hn,Ln,qn,oo).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ei(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function Ai(e){return e.qTags.indexOf("$qualified")>-1}function Ii({qAxis:e}){const t=[],n=[];for(let o=0;o<e.length;o++){const i=o+1,r=e[o],a=e[i];Ei(r,a)?(Ai(a)?(t.push(i),n.push(o)):(t.push(o),n.push(i)),o++):(t.push(o),n.push(o))}return{qualified:t,nonQualified:n}}function Pi({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let o,i=NaN,r=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,o=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){r="auto",s=!0;break}if(e&&e.queries.inner(n)){r=e.index;const o=t[l+2];o&&o.queries.minor(n)&&(a=o.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(r)&&"auto"!==r){r=i,i=NaN;const e=t[o+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",r="auto");return{outer:i,inner:r,minor:a,isDayOrShorter:s}}}}function Ri({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:o}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map(e=>Math.abs(o(e.qStart)-o(e.qEnd)))):0,i.maxRange),rangeAndWidth(){const n=o.clamp();return o.clamp(!1),i.rangeAndWidth=e.map(e=>({range:Math.abs(o(e.qStart)-o(e.qEnd)),width:t(`${e.qText}`).width+16})),o.clamp(n),i.rangeAndWidth}}}function zi({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Bi({qualified:e,nonQualified:t,qAxis:n,measureText:o,reqAutoFitWidth:i,scale:r},{attributesFactory:a=Ri,queryFactory:s=zi}={attributesFactory:Ri,queryFactory:zi}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:o,scale:r});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 Fi({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:o=0,scale:i},{metaFactory:r=Bi,mapper:a=Ii,resolver:s=Pi}={metaFactory:Bi,mapper:Ii,resolver:Pi}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=r({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:o,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const o=n.key({distance:t});if(n.get(o))return n.get(o);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 n.set(o,i),i}}}function Hi(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const ji=Hi(0).getTime();function _i(e){return(e.getTime()-ji)/86400/1e3}const Vi=new Date,Ui=new Date;function $i(e,t,n,o){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,o,r)=>{const a=[];if(n=i.ceil(n),r=null==r?1:Math.floor(r),!(n<o&&r>0))return a;let s;do{a.push(s=new Date(+n)),t(n,r),e(n)}while(s<n&&n<o);return a},i.filter=n=>$i(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,o)=>{if(e>=e)if(o<0)for(;++o<=0;)for(;t(e,-1),!n(e););else for(;--o>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,o)=>(Vi.setTime(+t),Ui.setTime(+o),e(Vi),e(Ui),Math.floor(n(Vi,Ui))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(o?t=>o(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Wi=1e3,Ki=6e4,Gi=36e5,Yi=864e5,Xi=6048e5,Ji=$i(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Wi)},(e,t)=>(t-e)/Wi,e=>e.getUTCSeconds());Ji.range;const Zi=$i(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wi)},(e,t)=>{e.setTime(+e+t*Ki)},(e,t)=>(t-e)/Ki,e=>e.getMinutes());Zi.range;const Qi=$i(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ki)},(e,t)=>(t-e)/Ki,e=>e.getUTCMinutes());Qi.range;const er=$i(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wi-e.getMinutes()*Ki)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getHours());er.range;const tr=$i(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getUTCHours());tr.range;const nr=$i(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ki)/Yi,e=>e.getDate()-1);nr.range;const or=$i(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yi,e=>e.getUTCDate()-1);or.range;const ir=$i(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yi,e=>Math.floor(e/Yi));function rr(e){return $i(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ki)/Xi)}ir.range;const ar=rr(0),sr=rr(1),lr=rr(2),ur=rr(3),cr=rr(4),dr=rr(5),mr=rr(6);function hr(e){return $i(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Xi)}ar.range,sr.range,lr.range,ur.range,cr.range,dr.range,mr.range;const fr=hr(0),pr=hr(1),gr=hr(2),yr=hr(3),vr=hr(4),br=hr(5),Mr=hr(6);fr.range,pr.range,gr.range,yr.range,vr.range,br.range,Mr.range;const Sr=$i(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());Sr.range;const xr=$i(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());xr.range;const Cr=$i(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cr.every=e=>isFinite(e=Math.floor(e))&&e>0?$i(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,Cr.range;const qr=$i(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());qr.every=e=>isFinite(e=Math.floor(e))&&e>0?$i(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,qr.range;const Tr=1,wr=2,kr=3,Nr=4,Lr=5,Dr=6;function Or({timeScale:e,labels:t,distance:n,isDayOrShorter:o,cache:i,timeOnly:r,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,o,i,r){function a(e){return qr.filter(t=>(t.getUTCFullYear()-r.getUTCFullYear())%e===0)}const s=Ji.count(e,t),l=Qi.count(e,t),u=tr.count(e,t),c=or.count(e,t),d=fr.count(e,t),m=xr.count(e,t),h=qr.count(e,t),f=n/o.second.width-1,p=n/o.minute.width-1,g=n/o.date.width-1,y=n/o.year.width-1,v={type:"year",desc:"year",count:h,interval:qr.every(1),formatter:o.year.formatter,offset:e=>qr.offset(e,-1),floor:qr.floor};if(s<=f)v.type=Tr,v.desc="second",v.count=s,v.interval=Ji.every(1),v.formatter=o.second.formatter,v.offset=e=>Ji.offset(e,-1),v.floor=Ji.floor;else if(s/2<=f)v.type=Tr,v.desc="every other second",v.count=s/2,v.interval=Ji.every(2),v.formatter=o.second.formatter,v.offset=e=>Ji.offset(e,-2),v.floor=Ji.floor;else if(s/5<=f)v.type=Tr,v.desc="every 5 second",v.count=s/5,v.interval=Ji.every(5),v.formatter=o.second.formatter,v.offset=e=>Ji.offset(e,-5),v.floor=Ji.floor;else if(s/15<=f)v.type=Tr,v.desc="every 15 second",v.count=s/15,v.interval=Ji.every(15),v.formatter=o.second.formatter,v.offset=e=>Ji.offset(e,-15),v.floor=Ji.floor;else if(s/30<=f)v.type=Tr,v.desc="every 30 second",v.count=s/30,v.interval=Ji.every(30),v.formatter=o.second.formatter,v.offset=e=>Ji.offset(e,-30),v.floor=Ji.floor;else if(l<=p)v.type=wr,v.desc="minute",v.count=l,v.interval=Qi.every(1),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-1),v.floor=Qi.floor;else if(l/2<=p)v.type=wr,v.desc="every 2 minute",v.count=l/2,v.interval=Qi.every(2),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-2),v.floor=Qi.floor;else if(l/5<=p)v.type=wr,v.desc="every 5 minute",v.count=l/5,v.interval=Qi.every(5),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-5),v.floor=Qi.floor;else if(l/10<=p)v.type=wr,v.desc="every 10 minute",v.count=l/10,v.interval=Qi.every(10),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-10),v.floor=Qi.floor;else if(l/15<=p)v.type=wr,v.desc="every 15 minute",v.count=l/15,v.interval=Qi.every(15),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-15),v.floor=Qi.floor;else if(l/30<=p)v.type=wr,v.desc="every 30 minute",v.count=l/30,v.interval=Qi.every(30),v.formatter=o.minute.formatter,v.offset=e=>Qi.offset(e,-30),v.floor=Qi.floor;else if(u<=p)v.type=kr,v.desc="hour",v.count=u,v.interval=tr.every(1),v.formatter=o.minute.formatter,v.offset=e=>tr.offset(e,-1),v.floor=tr.floor;else if(u/2<=p)v.type=kr,v.desc="every 2 hour",v.count=u/2,v.interval=tr.every(2),v.formatter=o.minute.formatter,v.offset=e=>tr.offset(e,-2),v.floor=tr.floor;else if(u/3<=p)v.type=kr,v.desc="every 3 hour",v.count=u/3,v.interval=tr.every(3),v.formatter=o.minute.formatter,v.offset=e=>tr.offset(e,-3),v.floor=tr.floor;else if(u/6<=p)v.type=kr,v.desc="every 6 hour",v.count=u/6,v.interval=tr.every(6),v.formatter=o.minute.formatter,v.offset=e=>tr.offset(e,-6),v.floor=tr.floor;else if(u/12<=p||i)v.type=kr,v.desc="every 12 hour",v.count=u/12,v.interval=tr.every(12),v.formatter=o.minute.formatter,v.offset=e=>tr.offset(e,-12),v.floor=tr.floor;else if(c<=g)v.type=Nr,v.desc="day",v.count=c,v.interval=or.every(1),v.formatter=o.date.formatter,v.offset=e=>or.offset(e,-1),v.floor=or.floor;else if(c/2<=g)v.type=Nr,v.desc="every 2 day",v.count=c/2,v.interval=or.every(2),v.formatter=o.date.formatter,v.offset=e=>or.offset(e,-2),v.floor=or.floor;else if(c/3<=g)v.type=Nr,v.desc="every 3 day",v.count=c/3,v.interval=or.every(3),v.formatter=o.date.formatter,v.offset=e=>or.offset(e,-3),v.floor=or.floor;else if(d<=g)v.type=Nr,v.desc="week",v.count=d,v.interval=fr.every(1),v.formatter=o.date.formatter,v.offset=e=>fr.offset(e,-1),v.floor=or.floor;else if(d/2<=g)v.type=Nr,v.desc="every 2 week",v.count=d/2,v.interval=fr.every(2),v.formatter=o.date.formatter,v.offset=e=>fr.offset(e,-2),v.floor=or.floor;else if(m<=g)v.type=Lr,v.desc="month",v.count=m,v.interval=xr.every(1),v.formatter=o.date.formatter,v.offset=e=>xr.offset(e,-1),v.floor=or.floor;else if(m/3<=g)v.type=Lr,v.desc="quarter",v.count=m/3,v.interval=xr.every(3),v.formatter=o.date.formatter,v.offset=e=>xr.offset(e,-3),v.floor=or.floor;else if(m/6<=g)v.type=Lr,v.desc="half year",v.count=m/6,v.interval=xr.every(6),v.formatter=o.date.formatter,v.offset=e=>xr.offset(e,-6),v.floor=or.floor;else if(h<=y)v.type=Dr,v.desc="year",v.count=h,v.interval=qr.every(1),v.formatter=o.year.formatter,v.offset=e=>qr.offset(e,-1),v.floor=qr.floor;else if(h/2<=y)v.type=Dr,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=o.year.formatter,v.offset=e=>qr.offset(e,-2),v.floor=qr.floor;else if(h/5<=y)v.type=Dr,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=o.year.formatter,v.offset=e=>qr.offset(e,-5),v.floor=qr.floor;else if(h/10<=y)v.type=Dr,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=o.year.formatter,v.offset=e=>qr.offset(e,-10),v.floor=qr.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=Dr,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=o.year.formatter,v.offset=t=>qr.offset(t,-e),v.floor=qr.floor}return v}(s,l,n,t.all(),o,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,n)=>{const o=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+o),formatter:c.formatter}});let h=[];if(!r&&c.type<=kr){const n=t.getFormat("date"),o=e.ticks(or.every(1));o.length&&s.getUTCDate()!==o[0].getUTCDate()&&o.unshift(or.offset(o[0],-1)),h=(o.length?o:[or.floor(s)]).map((e,t,o)=>{const i=o[t+1]?o[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}})}return{inner:m,outer:h}}const Er=86400,Ar=1440,Ir={};function Pr(e,t,n,o){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:o}}function Rr(e,t,n){const{generator:o,anchor:i,clamp:r,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(r);const[l,u]=e.domain(),c=Oi().domain([Hi(l),Hi(u)]);c.clamp(r),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof o?o:{type:o};let m;m="d3"===d.type?(e,i)=>Or({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Hi(o.initialMin)}):e=>function(e,t,n,o,i,r=!1){if(Ir[[t,n,o,o,r]])return Ir[[t,n,o,o,r]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Hi(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=o-n,m=t/(i-o),h=m/1440,f=m/Er,p=366*m,g=3*m*30,y=a.second.width/f,v=a.minute.width/h,b=a.date.width/g,M=a.year.width/p;let S,x,C,q=0,T=0,w=null,k=null,N=null,L=null,D=null,O=null;const E={outer:[],inner:[]};for(y<1?(w=1,T=1/Er):y<2?(w=2,T=1/Er*2):y<5?(w=5,T=1/Er*5):y<10?(w=10,T=1/Er*10):y<30?(w=30,T=1/Er*30):v<1?(k=1,T=1/Ar):v<2?(k=2,T=1/Ar*2):v<5?(k=5,T=1/Ar*5):v<10?(k=10,T=.006944444444444445):v<30?(k=30,T=.020833333333333336):v<60?(N=1,T=1/24):v<120?(N=2,T=2/24):v<360?(N=6,T=.25):v<720?(N=12,T=.5):b<1/90?(T=1,L=1):b<2/90?(T=2,L=2):b<7/90?(T=7,L=7):b<31/90?(D=1,T=31):b<1?(D=3,T=90):M<1?(O=1,T=366):M<2?(O=2,T=732):M<5?(O=5,T=1826.25):(O=10,T=3652.5),x=Math.floor((d+n%1)/T);q<i;){C=x+1,S=O?Pr("year",[l+x*O,0,1],[l+C*O,0,1],a.year.formatter):D?Pr("month",[l,u+x*D,1],[l,u+C*D,1],a.date.formatter):L?Pr("day",[l,u,c+x*L],[l,u,c+C*L],a.date.formatter):N?Pr("hour",[l,u,c,0+x*N],[l,u,c,0+C*N],a.minute.formatter):k?Pr("minute",[l,u,c,0,0+x*k],[l,u,c,0,0+C*k],a.minute.formatter):Pr("second",[l,u,c,0,0,0+x*w],[l,u,c,0,0,0+C*w],a.second.formatter),q=_i(S.start),E.inner.push(S);const e=Math.floor(q);if(!(r||O||D||L)){const t={type:"day",start:Hi(e),end:Hi(e+1),formatter:a.date.formatter,qStart:e};E.outer[E.outer.length-1]&&E.outer[E.outer.length-1].qStart===t.qStart||E.outer.push(t)}x++}return E.min=o,E.max=i,Ir[[t,n,o,o,r]]=E,E}(n,e,d.min,l,u,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let o;o="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const r=e.clamp();n&&e.clamp(!1);const a=e(o),s=e(t.qStart),l=e(t.qEnd);return e.clamp(r),{value:o,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>m(t,n)[a].map(t=>{let n;return n="start"===i?_i(t.start):"end"===i?_i(t.end):(_i(t.start)+_i(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:_i(t.start),end:_i(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const zr=/t+/i;const Br={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 Fr(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 Hr="continuousPan";var jr={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:o=Ee,viewCache:i,viewState:r,definitionPath:a},s={}){const{engineFetcherFactory:l=Me,snapshotFetcherFactory:u=xe,cacheFetcherFactory:c=Se,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),h=u({layoutService:t,viewCache:i}),f=c({cache:d}),p=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,o;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,o=v,Math.max(1e-6,(o-n)*Le))),g=t.meta.isSnapshot?h:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=h.getSnapshotData()),r.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:o}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",o),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=Te(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return o.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e}).then(e=>we(y,v,e)).then(e=>this.updateLayout(e)).catch(p)},fetch:(e,t)=>g.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const o=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,o=t[t.length-1][0].qNum,i=[],r=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>o&&r.push(e[t])}return[...i,...t,...r]}(e.qMatrix,t.qDataPages[n].qMatrix),i=Te(e.qArea,o);return{...e,qArea:i,qMatrix:o}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),o=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,r=e.qAxis.length;t<r;t++){const r=e.qAxis[t],a=n.indexOf(r.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=o[a];for(let n=0,o=r.qTicks.length;n<o;n++){const o=r.qTicks[n];o.qStart<e?s.push(o):o.qStart>t&&l.push(o)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e)).then(e=>(o.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e)).then(n=>we(e,t,n)).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then(n=>we(e,t,n)),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return le({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return le({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Oe(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=o.query.getShouldProcess()?[o.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:o}=e;function r(e,n,i){return o[e](n,i).then(e=>(o.updateLayout(e),t(),e))}const a=i((e,t)=>r("fetch",e,t),50);return({min:e,max:t},{min:o,max:i})=>!n.meta.isContinuous||e===o&&t===i?Promise.resolve(null):r("fetchFromCache",e,t).then(n=>(a(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,o=NaN;return(i,r)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),o=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<o?r:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:o=50,rtl:i=!1,targetKey:a}){const s=e.get("continuousMin"),l=e.get("continuousMax");return r((e,o)=>{const r=(e=>n.componentsFromPoint(e).filter(e=>e.key===a)[0])(e);if(r){const a=function(e,t,n){let{x:o}=e;return o-=t.element.getBoundingClientRect().left,o-=n.rect.x,Math.max(0,Math.min(1,o/n.rect.width))}(e,n,r),u=i?1-a:a,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),h=m-(o>0?Ne:ke)*m,f=c+h*u,p=d-h*(1-u),g=f<s?s-f:0,y=p>l?p-l:0;t.set("zoom",{min:Math.max(f-y,s),max:Math.min(p+g,l)})}},o)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:o,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Hr,pointers:1,threshold:10,enable(o,i){return this.started===Hr||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)}},events:{[`${Hr}start`](n){n.preventDefault(),this.started=Hr;const{min:i,max:r}=o.get("zoom");this[Hr]={min:i,max:r,size:t.component(e).rect.computedInner.width,span:r-i}},[`${Hr}move`](e){e.preventDefault();const{span:t,min:n,max:r,size:a}=this[Hr],s=-e.deltaX/a;o.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(r+s*t,i.get("continuousMin")+t)})},[`${Hr}end`](e){e.preventDefault(),this.started=!1},[`${Hr}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:Ae,timeAxis:Fe},picassoScales:{time:function e(t,n={}){const o=function(e,t,n){const o={};return Object.keys(t).forEach(i=>{const r=e[i],a=typeof r;"function"===a?o[i]=r(n):"object"!==a||Array.isArray(r)?o[i]="undefined"===a?t[i]:r:o[i]=le(!0,{},t[i],r)}),o}(t,Br,n),{qAxis:i}=o,r=Mn(),s={instance:null,invert:!1},{min:l,max:u}=function(e,t){let n=+e.min,o=+e.max;return Number.isNaN(n)&&Number.isNaN(o)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),o=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===o&&(n-=.5,o+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+o)?1:o}}(o,i);let c,d,m=[];const h=function(e){return Number.isNaN(+e)?NaN:r(e)};h.ticks=({distance:e,resolve:t=c.resolve}={})=>{const n=t(e),r=n[o.ticks.level];if(Number.isNaN(+r)||(m=d.transform(i[r].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(i[n.minor].qTicks,{isMinor:!0});m=m.concat(e)}return"auto"===r&&(m=d.generate(e,n.isDayOrShorter)),m},h.invert=e=>r.invert(e),h.domain=e=>Array.isArray(e)?r.domain(e):r.domain(),h.range=e=>Array.isArray(e)?r.range(e):r.range(),h.norm=e=>(Fr(s,h),s.instance(e)),h.normInvert=e=>(Fr(s,h),s.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(r.clamp(e),r.clamp()),h.min=()=>Math.min(l,u),h.max=()=>Math.max(l,u),r.range(o.invert?[1,0]:[0,1]),r.domain([l,u]),s.invert=o.invert;const f=function(e){const t={},{measureText:n,fn:o,localeInfo:i}=e.formatter,r={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&&zr.test(i.qTimestampFmt)&&(r.minute.pattern+=" tt",r.second.pattern+=" tt"),r.date.pattern=i&&i.qDateFmt?i.qDateFmt:r.date.pattern,Object.keys(r).forEach(e=>{r[e].formatter=o(r[e].pattern),r[e].width=Math.max(r[e].width,n(r[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>r[e],t.all=()=>r,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return r.date;const o=Hi(t[0].data.start),i=Hi(t[n-1].data.start);return or.count(o,i)/n>=1?r.date:tr.count(o,i)/n>0?r.minute:Qi.count(o,i)/n>0?r.second:r.date},t}(o);return d=Rr(r.copy(),o,f),c=Fi({qAxis:i,measureText:o.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:o.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${o.field}`,key:()=>o.field,raw:a(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>f.getFormatFromTicks(m).formatter,h}}};const _r=[["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}]],Vr={};_r.forEach(([e,{width:t,height:n}])=>{Vr[e]={width:t,height:n}});const Ur={getLayoutModes:()=>Vr,getLayoutMode(e,t){let n;for(n=0;n<_r.length;++n)if(e>=_r[n][1].width&&t>=_r[n][1].height)return _r[n][0];return"SPARK"}};function $r(e,t){return{layoutModes:Ur.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}}const Wr=["$date","$timestamp","$time"],Kr=["D","TS","T"],Gr={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>Wr.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&Kr.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(Gr.hasTimeTag(t)&&Gr.hasUnknownFormat(t)||Gr.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&Gr.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&Gr.canBeContinuousDimension(t[0])},maxNumberOfLines:12},Yr=/^[A-Z][A-z0-9_]*$/i,Xr={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},Jr={setValue:(e,t,n)=>{if(!t)return!1;const o=t.split("."),i=o[o.length-1];let r,a=e;for(r=0;r<o.length-1;++r)void 0===a[o[r]]&&(a[o[r]]=Number.isNaN(+o[r+1])?{}:[]),a=a[o[r]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const o=t.split(".");let i,r=e;if(void 0===r)return n;for(i=0;i<o.length;++i){if(void 0===r[o[i]])return n;r=r[o[i]]}return r},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||Yr.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Xr.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},Zr=e=>Jr.getValue(e,"qHyperCube.qDimensionInfo",[]),Qr=e=>Jr.getValue(e,"qHyperCube.qMeasureInfo",[]),ea=e=>Jr.getValue(e,"barGrouping.grouping"),ta={continuous:(e,t=!1)=>!!Gr.canBeContinuous(e)&&(Jr.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!Zr(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===ea(e)&&(Zr(e).length>1||Qr(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&Zr(e).length>1&&1===Qr(e).length},groupedByMeasure(e){return this.grouped(e)&&1===Zr(e).length&&Qr(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==ea(e)&&"butterfly"!==ea(e)||this.continuous(e))&&(Zr(e).length>1||Qr(e).length>1)},stackedByDimension(e){return this.stacked(e)&&Zr(e).length>1&&1===Qr(e).length},stackedByMeasure(e){return this.stacked(e)&&1===Zr(e).length&&Qr(e).length>1},simple:e=>0===Zr(e).length||1===Zr(e).length&&1===Qr(e).length,snapshot:e=>!!Jr.getValue(e,"snapshotData")};function na(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const oa=e=>{throw e.isHandled=!0,e};const ia={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":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?ia.getVerticalDock(t):n?ia.getOppositeDock(ia.getHorizontalDock(t)):ia.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n};var ra=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const aa=166/26,sa=12/11,la={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*aa)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),o=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,o=o?o.length:0;const i=t+n+o;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const o={latin:0,cjk:0};let i;void 0===t?e.forEach(e=>{i=la.getCharacterRatios(e[n]),o.latin+=i.latin,o.cjk+=i.cjk}):e.forEach(e=>{i=la.getCharacterRatios(e[t][n]),o.latin+=i.latin,o.cjk+=i.cjk});const r=Math.max(1,o.latin+o.cjk);return o.latinRatio=o.latin/r,o.cjkRatio=o.cjk/r,o},getAdjustedMaxGlyphCount(e,t,n,o="qText"){const i=la.getTotalCharacterRatios(t,n,o),r=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(la.stringWidthOverMWidth(r)+a*sa)}},ua="#la-vie-tooltip";function ca(){if(!document.querySelector(ua)){const e=document.createElement("div");e.id="la-vie-tooltip",e.setAttribute("data-qs-css",""),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 da({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ca()},beforeUpdate(){ca()},destroyed(){!function(){const e=document.querySelector(ua);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ua),content:({h:e,data:t,style:n})=>t[0].map(t=>e("tr",{},function(e,{h:t,style:n}){return e.map(e=>{const o={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(o.colspan=e.colspan),t("td",o,e.content)})}(t,{h:e,style:n}))),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:'"Source Sans Pro", "Arial", "sans-serif"',"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const ma=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ha=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),fa=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),pa={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>ma.test(e),isRtlChar:e=>ha.test(e)||fa.test(e),detectTextDirection(e){const t=e?e.length:0;let n,o;for(n=0;n<t;n++){if(o=e[n],pa.isLtrChar(o))return"ltr";if(pa.isRtlChar(o))return"rtl"}return"ltr"}},ga={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,n){const o=t.data,i=e.resources.formatter,r=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&o.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(o.fillTooltip.value):o.fillTooltip.label?o.fillTooltip.label:o.fillTooltip.value,!n.coloring.label){const e=r(o.fillTooltip.source.key).field(o.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===o._fillColor?ga.getNodeFillColor(t):o._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 n=pa.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=pa.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const o=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:o,style:{"font-weight":"bold","text-align":n?"right":"left",direction:pa.detectTextDirection(o)},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,n){const o=pa.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],r=pa.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:o}},{content:n?[t.color.value,ga.getColorSymbol(e,t)]:[ga.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:r,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,o,i=!1){const r=pa.detectTextDirection(e.label),a=o?[":",e.label]:[e.label,":"],s=pa.detectTextDirection(e.value);let l;return l=i?o?[e.value,ga.getColorSymbol(t,n)]:[ga.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":o?"right":"left",direction:r}},{content:l,style:{"text-align":o?"left":"right",direction:s,"vertical-align":"middle"}}]}};function ya(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function va(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function ba(){}var Ma=.7,Sa=1/Ma,xa="\\s*([+-]?\\d+)\\s*",Ca="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ta=/^#([0-9a-f]{3,8})$/,wa=new RegExp(`^rgb\\(${xa},${xa},${xa}\\)$`),ka=new RegExp(`^rgb\\(${qa},${qa},${qa}\\)$`),Na=new RegExp(`^rgba\\(${xa},${xa},${xa},${Ca}\\)$`),La=new RegExp(`^rgba\\(${qa},${qa},${qa},${Ca}\\)$`),Da=new RegExp(`^hsl\\(${Ca},${qa},${qa}\\)$`),Oa=new RegExp(`^hsla\\(${Ca},${qa},${qa},${Ca}\\)$`),Ea={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 Aa(){return this.rgb().formatHex()}function Ia(){return this.rgb().formatRgb()}function Pa(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ta.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ra(t):3===n?new Fa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?za(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?za(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=wa.exec(e))?new Fa(t[1],t[2],t[3],1):(t=ka.exec(e))?new Fa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Na.exec(e))?za(t[1],t[2],t[3],t[4]):(t=La.exec(e))?za(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Da.exec(e))?$a(t[1],t[2]/100,t[3]/100,1):(t=Oa.exec(e))?$a(t[1],t[2]/100,t[3]/100,t[4]):Ea.hasOwnProperty(e)?Ra(Ea[e]):"transparent"===e?new Fa(NaN,NaN,NaN,0):null}function Ra(e){return new Fa(e>>16&255,e>>8&255,255&e,1)}function za(e,t,n,o){return o<=0&&(e=t=n=NaN),new Fa(e,t,n,o)}function Ba(e){return e instanceof ba||(e=Pa(e)),e?new Fa((e=e.rgb()).r,e.g,e.b,e.opacity):new Fa}function Fa(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Ha(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}`}function ja(){const e=_a(this.opacity);return`${1===e?"rgb(":"rgba("}${Va(this.r)}, ${Va(this.g)}, ${Va(this.b)}${1===e?")":`, ${e})`}`}function _a(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Va(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ua(e){return((e=Va(e))<16?"0":"")+e.toString(16)}function $a(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ka(e,t,n,o)}function Wa(e){if(e instanceof Ka)return new Ka(e.h,e.s,e.l,e.opacity);if(e instanceof ba||(e=Pa(e)),!e)return new Ka;if(e instanceof Ka)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(a=t===r?(n-o)/s+6*(n<o):n===r?(o-t)/s+2:(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Ka(a,s,l,e.opacity)}function Ka(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function Ga(e){return(e=(e||0)%360)<0?e+360:e}function Ya(e){return Math.max(0,Math.min(1,e||0))}function Xa(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ya(ba,Pa,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Aa,formatHex:Aa,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Wa(this).formatHsl()},formatRgb:Ia,toString:Ia}),ya(Fa,function(e,t,n,o){return 1===arguments.length?Ba(e):new Fa(e,t,n,null==o?1:o)},va(ba,{brighter(e){return e=null==e?Sa:Math.pow(Sa,e),new Fa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ma:Math.pow(Ma,e),new Fa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fa(Va(this.r),Va(this.g),Va(this.b),_a(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ha,formatHex:Ha,formatHex8:function(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}${Ua(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ja,toString:ja})),ya(Ka,function(e,t,n,o){return 1===arguments.length?Wa(e):new Ka(e,t,n,null==o?1:o)},va(ba,{brighter(e){return e=null==e?Sa:Math.pow(Sa,e),new Ka(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ma:Math.pow(Ma,e),new Ka(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Fa(Xa(e>=240?e-240:e+120,i,o),Xa(e,i,o),Xa(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ka(Ga(this.h),Ya(this.s),Ya(this.l),_a(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_a(this.opacity);return`${1===e?"hsl(":"hsla("}${Ga(this.h)}, ${100*Ya(this.s)}%, ${100*Ya(this.l)}%${1===e?")":`, ${e})`}`}}));const Ja=Math.PI/180,Za=180/Math.PI,Qa=.96422,es=.82521,ts=4/29,ns=6/29,os=3*ns*ns,is=ns*ns*ns;function rs(e){if(e instanceof as)return new as(e.l,e.a,e.b,e.opacity);if(e instanceof ms)return hs(e);e instanceof Fa||(e=Ba(e));var t,n,o=cs(e.r),i=cs(e.g),r=cs(e.b),a=ss((.2225045*o+.7168786*i+.0606169*r)/1);return o===i&&i===r?t=n=a:(t=ss((.4360747*o+.3850649*i+.1430804*r)/Qa),n=ss((.0139322*o+.0971045*i+.7141733*r)/es)),new as(116*a-16,500*(t-a),200*(a-n),e.opacity)}function as(e,t,n,o){this.l=+e,this.a=+t,this.b=+n,this.opacity=+o}function ss(e){return e>is?Math.pow(e,1/3):e/os+ts}function ls(e){return e>ns?e*e*e:os*(e-ts)}function us(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function cs(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ds(e,t,n,o){return 1===arguments.length?function(e){if(e instanceof ms)return new ms(e.h,e.c,e.l,e.opacity);if(e instanceof as||(e=rs(e)),0===e.a&&0===e.b)return new ms(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Za;return new ms(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ms(e,t,n,null==o?1:o)}function ms(e,t,n,o){this.h=+e,this.c=+t,this.l=+n,this.opacity=+o}function hs(e){if(isNaN(e.h))return new as(e.l,0,0,e.opacity);var t=e.h*Ja;return new as(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ya(as,function(e,t,n,o){return 1===arguments.length?rs(e):new as(e,t,n,null==o?1:o)},va(ba,{brighter(e){return new as(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new as(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Fa(us(3.1338561*(t=Qa*ls(t))-1.6168667*(e=1*ls(e))-.4906146*(n=es*ls(n))),us(-.9787684*t+1.9161415*e+.033454*n),us(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ya(ms,ds,va(ba,{brighter(e){return new ms(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ms(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return hs(this).rgb()}}));var fs={isDark:function(e){return ds(e).l<70}};function ps(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}const gs={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"}}},ys=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var vs={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:o}=this.settings.settings,[i,r]=t(),a=Math.abs(i)<1e-15,s=Math.abs(r-1)<1e-15,l=(e=>{const t=gs[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:ys(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:ys(t.shadow.endOffset)}}})(n),u="horizontal"===n&&o,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 bs({viewState:e,viewCache:t,layoutService:n,dockService:o,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:o.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),o=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-o)/(i-o),(n.max-o)/(i-o)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let Ms;function Ss(){Ms=Ms||document.createElement("canvas").getContext("2d")}const xs={measureTextWidth(e){Ss();const{width:t}=Ms.measureText(e);return t},lineWrap(e,t,n,o){let i,r;Ss();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof o&&a.length>=o)return a.slice(0,o);for(n&&(Ms.font=n),r=0;r<a.length;r++){for(d=a[r]||"",m=d.split(/\s+/),[h]=m,c="",i=1;i<m.length;i++)if(l=`${h} ${m[i]}`,u=xs.measureTextWidth(l),u>t&&("number"!=typeof o||o>s.length)?(s.push(h),h=m[i]):h=l,"number"==typeof o&&s.length>=o){c=m.slice(i+1).join(" ");break}"number"!=typeof o||s.length<o?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${c}`}return s},wordWrap(e,t,n,o,i){if(Ss(),!e||!e.length)return[];n&&(Ms.font=n);let r=[];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||xs.measureTextWidth(u)<=t?r.push(u):(s=xs.splitWord(u,t,void 0,o-r.length),s.length<=1?r.push(s[0]):(l=s.pop(),r=r.concat(s),a[c+1]?xs.measureTextWidth(`${l} ${a[c+1]}`)>t&&r.length+a.length-c<=o?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return r.forEach((e,t,n)=>{n[t]=e?e.trim():e}),r.length>o?(r=r.splice(0,o),r[r.length-1]=xs.truncate(r[r.length-1],t,n,i).text):(u=r[r.length-1],u&&u.length>1&&xs.measureTextWidth(u)>t&&(r[r.length-1]=xs.truncate(u,t,n,i).text)),r},truncate(e,t,n,o="…"){Ss();let i,r,a,s,l=e;const u=xs.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(Ms.font=n),e&&t){if(xs.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(r=l.substring(0,i-1),a=r.trim()+o,xs.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,n,o){let i;Ss();let r,a=e,s="",l=[];if(xs.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/o);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),r=e.substring(i-1,i)," "===r?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(xs.measureTextWidth(a)<=t));i--);return(!i&&!a||xs.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(xs.measureTextWidth(s)>t?(s=xs.explodeWord(s,t,n-1,o),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,o)=>(Ss(),e&&t?(n&&(Ms.font=n),xs.explodeWord(e,t,o,Math.max(1,xs.measureTextWidth("i")))):[]),wrapText(e,t,n,o,i){let r;return Number.isNaN(t)?[e]:(r=o>1?xs.lineWrap(e,t,n,o):[e],r=xs.wordWrap(r,t,n,o,i),r)},getFontHeight:e=>(Ss(),e&&(Ms.font=e),1.5*xs.measureTextWidth("m")),tokenize(e,t,n,o,i,r,a=1){Ss(),t&&(Ms.font=t);const s=xs.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(r<s)return[];const m=r?Math.max(1,Math.floor(r/l)):o||1;return Array.isArray(o)?(o.forEach(e=>{c+=Number.isNaN(e)||e<=0?0:e}),o.forEach(e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)})):u=[Number.isNaN(o)||o<=0?m:Math.min(m,o)],Array.isArray(e)?e.forEach((e,n)=>{d.length<m&&(d=d.concat(xs.wrapText(e,i,t,u[n])))}):d=xs.wrapText(e,i,t,u[0],n),d}},Cs={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:o,rendHeight:i,flipXY:r,symbol:a}){let s="x",l="y",u=o,c=i,d=t<.5?90:-90;return r&&(s="y",l="x",u=i,c=o,d=t<.5?180:0),a(le({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},qs=le.bind(null,!0),Ts={},{isArray:ws}=Array;function ks(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Ns(e){return void 0===e}function Ls(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Ds(e,t){const n=t.substring(1).split("/").slice(0,-1);let o;return n.forEach((t,i)=>{if(i===n.length)return;o=+t;const r=isNaN(o)?{}:[];e[o||t]=Ns(e[o||t])?r:e[t],e=e[o||t]}),e}function Os(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function Es(e,t,n){let o=!0;if(ks(e)&&ks(t))return Os(e,n)===Os(t,n)&&(Object.keys(e).forEach(i=>{Es(e[i],t[i],n)||(o=!1)}),o);if(ws(e)&&ws(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o+=1)if(!Es(e[o],t[o],n))return!1;return!0}return e===t}Ts.compare=Es,Ts.generate=function(e,t,n){n=n||"";let o=[];return Object.keys(t).forEach(i=>{const r=function(e){return e?qs({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;Es(r,a)||Ls(t,i)||(Ns(a)?o.push({op:"add",path:s,value:r}):ks(r)&&ks(a)?o=o.concat(Ts.generate(a,r,s)):ws(r)&&ws(a)?o=o.concat(function(e,t,n){let o=[];const i=e.slice();let r=-1;function a(e,t,n){if(e[n]&&Ns(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,o=e.length;n<o;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Es(t,i))return o;if(!Ns(t[0])&&Ns(t[0].qInfo)||0===t.length)return o.push({op:"replace",path:n,value:t}),o;for(let e=i.length-1;e>=0;e-=1)r=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===r?(o.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):o=o.concat(Ts.generate(i[e],t[r],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)r=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===r?(o.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):r!==e&&(o.push({op:"move",path:`${n}/${e}`,from:`${n}/${r}`}),i.splice(e,0,i.splice(r,1)[0]));return o}(a,r,s)):o.push({op:"replace",path:`${n}/${i}`,value:r}))}),Object.keys(e).forEach(i=>{Ns(t[i])&&!Ls(e,i)&&o.push({op:"remove",path:`${n}/${i}`})}),o},Ts.apply=function(e,t){t.forEach(t=>{let n=Ds(e,t.path),o=t.path.split("/").splice(-1)[0],i=o&&isNaN(+o)?n[o]:n[+o]||n;const r=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(ws(n))"-"===o&&(o=n.length),n.splice(+o,"add"===t.op?0:1,t.value);else if(ws(i)&&ws(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(ks(i)&&ks(t.value))a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Ls(a,e)&&delete a[e]}),qs(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[o]=t.value}else if("move"===t.op){const i=Ds(e,t.from);ws(n)?n.splice(+o,0,i.splice(+r,1)[0]):(n[o]=i[r],delete i[r])}else"remove"===t.op&&(ws(n)?n.splice(+o,1):delete n[o]);var a})},Ts.clone=function(e){return qs({},e)},Ts.createPatch=function(e,t,n){const o={op:e.toLowerCase(),path:n};return"move"===o.op?o.from=t:void 0!==t&&(o.value=t),o},Ts.updateObject=function(e,t){Object.keys(e).length?Ts.apply(e,Ts.generate(e,t)):qs(e,t)};const As=Math.log(10);function Is(e){return 10**e}const Ps={pow10:Is,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/As,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/As),o=e/Is(n);return t=o<=1?1:o<=2?2:o<=5?5:10,t*Is(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/As);const o=e/Is(t);return o<1?(n=5,t--):n=o<2?1:o<5?2:5,n*Is(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return Is(Math.floor(Math.log(Math.abs(e))/As))},getFraction(e){if(0===e)return 0;return e/Is(Math.floor(Math.log(Math.abs(e))/As))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/As),o=e/Is(n);return t=Math.ceil(o),7!==t&&9!==t||t++,o>1&&o<=1.5?t=1.5:o>2&&o<=2.5&&(t=2.5),t*Is(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)},Rs=[[2,4,6],[2,4],[3]],zs=[,[,,[[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 Bs(e,t,n){const o=e?e.length:0;let i,r=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<o;i++)r=Math.min(r,e[i]/e[i-1]);void 0!==n&&(r=Math.min(r,n/e[o-1])),e.splice(0,0,r)}function Fs(e,t,n){let o;const i=e?e.length:0;for(o=0;o<i;o++)Bs(e[o],t,n)}!function(){let e,t;for(Fs(Rs,1,10),e=0;e<zs.length;e++)if(zs[e])for(t=0;t<zs[e].length;t++)Array.isArray(zs[e][t])&&Fs(zs[e][t])}();const Hs={isInside(e,t,n,o){if(!o)return!0;const i=e.position-e.radius,r=e.position+e.radius;return i>=t&&r<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,o=e.position<t.position?t:e;return o.position-o.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const o=Hs.findSegmentPositionMeetMin(e,t);return Hs.findSegmentPositionMeetMax({center:o,max:o+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const o=Hs.findSegmentPositionMeetMax(e,n);return Hs.findSegmentPositionMeetMin({center:o,min:o-e.radius},t)},layoutPositionFromMin(e,t,n,o=0){const i=e.length-1;let r,a,s=t;for(let t=0;t<i;t++)r=e[t],a=e[t+1],r.position=Hs.findSegmentPositionMeetMaxThenMin(r,s,(r.center+a.center-o)/2),s=r.position+r.radius+o/2;a.position=Hs.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,o=0){const i=e.length-1;let r,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(r=i;r>0&&(a=e[r],s=e[r-1],u=Math.max(0,Hs.getGap(s,a)-o),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));r--);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,r=0;r<=i;r++)a=e[r],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,o=0){const i=e.length-1;if(!(i<0)){if(0===i){const o=e[0];return void(o.position=Hs.findSegmentPositionMeetMaxThenMin(o,t,n))}Hs.layoutPositionFromMin(e,t,n,o),Hs.adjustPositionFromMax(e,t,n,o)}}},js=(e,t,n,o=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-o):i*(2-o)/2:"start"===t?0:"end"===t?i*o:i*o/2},_s=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,Vs=e=>e.filter(_s),Us=(e,t)=>Vs(Jr.getValue(e,t,[])),$s=e=>_s(e)&&(!1!==e.showValue||!1!==e.showLabel),Ws=e=>e.filter($s),Ks=(e,t)=>Ws(Jr.getValue(e,t,[])),Gs=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,Ys=(e,t,n)=>{const{dimensionRefLineInfo:o}=t;if(o[e])return o[e][n]},Xs=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:o,qHeight:i}=n;return void 0!==o&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<o},Js=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:o,qHeight:i}=n;return void 0!==o&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=o+i},Zs=({value:e,qMin:t})=>"NaN"!==t&&e<t,Qs=({value:e,qMax:t})=>"NaN"!==t&&e>t,el={isRefLineVisible:_s,getVisibleRefLines:Vs,getRefLines:Us,getMeasureRefLines:e=>Us(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Us(e,"refLine.dimRefLines"),isRefLineLabelVisible:$s,getVisibleRefLineLabels:Ws,getRefLineLabels:Ks,getMeasureRefLineLabels:e=>Ks(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:Ks(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:o,align:i,invert:r=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=js(s,i,r,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!o)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=o;let u;return l=js(s,i,r,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:o,minOrder:i})=>{const r=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:o});for(let o=0;o<n.length;o++){const{id:a,order:s}=n[o],l=e([t,a]);if(void 0!==l)return l-r*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:r,minOrder:a})),(void 0===u?s(n):u)+l}return l=js(s,i,r),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:o})=>{const{isGroupedByDimension:i}=o.meta,r={},a=Jr.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():Jr.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return r;const u=s?"qData.0.qSubNodes":"qMatrix",c=Jr.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,o=t[d];r[o]||(r[o]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],o=c[t][1],i=t+m,a=n[d];r[a]?(r[a].minOrder=Math.min(r[a].minOrder,i),r[a].maxOrder=Math.max(r[a].maxOrder,i),r[a].innerValues[r[a].innerValues.length]={id:o.qElemNumber,order:i}):r[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:o.qElemNumber,order:i}],dataNode:c[t]},0===t?0===i&&(r[a].isMinOrderOk=!0):a!==e&&(r[a].isMinOrderOk=!0,r[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,o=t[d];r[o]||(r[o]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})(),r},getInputValue:Gs,extractInfoFromInputValue:Ys,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const o=Gs({refLineLayout:e,layoutService:n});return Ys(o,t,"id")},isDiscreteMinOutOfBounds:Xs,isDiscreteMaxOutOfBounds:Js,isContinuousMinOutOfBounds:Zs,isContinuousMaxOutOfBounds:Qs,isOutOfRange:({value:e,qMin:t,qMax:n})=>Zs({value:e,qMin:t})||Qs({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&Js({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&Xs({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},tl=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function nl(e){return e.showValue?`… ${e.valueString}`:"…"}function ol(e,t,n=70){for(let o=0;o<e.length;o++){const i=e[o],r=tl({label:i,labelStyle:t});i.lines=xs.tokenize(i.title,r,nl(i),3,n),i.maxNumLines=i.lines.length}}function il({title:e,font:t,ellipsis:n,maxNumLines:o=5,maxWidth:i=200}){const r=xs.tokenize(e,t,n,o,i),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n${r[e]}`}return s}function rl({oobs:e,font:t,ellipsis:n,maxNumLines:o=5,maxWidth:i=200}){const r=e.map(e=>il({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:o,maxWidth:i})),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n\n${r[e]}`}return s}function al(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const sl=3,ll=2;function ul({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const o=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${o}]`,"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 cl=({label:e,dataPages:t,qMin:n,qMax:o})=>{if(void 0!==n&&void 0!==o){const{inputValue:t}=e;if(el.isContinuousMaxOutOfBounds({value:t,qMax:o}))return 1;if(el.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return el.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:el.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},dl={hasEngineFormat:ul,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:o,orientation:i,rtl:r,isContinuous:a,isDimension:s}){const l=el.getInvert({orientation:i,rtl:r,isContinuous:a}),u="S"===o.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=o.getHyperCubeValue(u),{canBeContinuous:d}=o.meta;let m,h;if(s&&d){const e=o.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,h=e.qMax}for(let i=0;i<e.length;i++){const r=e[i],{value:s,align:u,valueInfo:d}=r,f=cl({label:r,dataPages:c,qMin:m,qMax:h});r.scaledValue=1===f?l?-.1:1.1:-1===f?l?1.1:-.1:el.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:o,isContinuous:a}),r.center=r.scaledValue*n}},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:n,canBeContinuous:o,localeInfo:i}){let r;if(n)for(let n=0;n<e.length;n++){const o=e[n],{value:a,inputValue:s,inputValueLabel:l}=o;r=ul({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,o.valueString=`${pa.lrm}(${r})${pa.lrm}`,o.title=dl.getTitle(o)}else if(o)for(let t=0;t<e.length;t++){const n=e[t],{valueText:o,inputValue:a,inputValueLabel:s}=n;r=ul({inputValue:a,inputValueLabel:s,localeInfo:i})?s:o,n.valueString=`${pa.lrm}(${r})${pa.lrm}`,n.title=dl.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];r=n.valueText,n.valueString=`${pa.lrm}(${r})${pa.lrm}`,n.title=dl.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const o=e[n];o.totalWidth=t(o.title,o).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map(n=>t(n,e).width)),getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,o=0){const i=e.length-1;if(i<0)return;let r,a;if([r]=e,r.cMin=t,0!==i){for(let t=0;t<i;t++)r=e[t],a=e[t+1],r.cMax=(r.center+a.center-o)/2,a.cMin=r.cMax+o;a.cMax=n}else r.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const o=t-1,i=e.filter(e=>e.maxNumLines===t),r=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-r;e--)i[e].maxNumLines=o},reduceTotalMaxNumLines(e,t,n){const o=Math.floor(n/t);let i=3;do{const t=dl.getTotalNumLines(e)-o;if(t<=0)return;dl.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let o=0;o<e.length;o++){const i=e[o];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,o){for(let i=0;i<e.length;i++){const r=e[i];r.width=Math.min(t,dl.measureLabelMaxLineWidth(r,o)),r.height=r.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const o=e[n],{center:i}=o,r=o[t],a=r/2;o.segment={center:i,range:r,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:o,upperLimit:i,gap:r,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:h,isContinuous:f,isDimension:p}){const g=e.map(e=>e),y=n;dl.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:c,rtl:m,isContinuous:f,isDimension:p}),al(e,"center"),dl.addLabelsNeighborInfo(e,o,i,r),ol(e,a,s),dl.reduceTotalMaxNumLines(g,l,i-(g.length-1)*r),"vertical"===c&&(dl.reduceMaxNumLines(e,l,.05*r),function(e,t,n=70){for(let o=0;o<e.length;o++){const i=e[o],r=tl({label:i,labelStyle:t});i.lines.length>i.maxNumLines&&(i.lines=xs.tokenize(i.title,r,nl(i),i.maxNumLines,n))}}(e,a,s)),dl.addLabelsSize(e,s,l,d),dl.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:o,area:i,lineHeight:r=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=o,{minorCenter:c}=i,{fontSize:d,fontFamily:m,fontStyle:h,fontWeight:f,textDecoration:p,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,o=t.length,i=t.map((t,i)=>{const g={type:"text",text:t,title:il({title:e.title,font:a,ellipsis:nl(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||m,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||f,textDecoration:e.textDecoration||p,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return g[l]=c,g[s]=e.segment.position,g.y+=(i-(o-1)/2)*r,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:o,label:i,lineHeight:r,background:a}){const{lines:s}=i,{borderRadius:l=sl,padding:u={}}=a,{top:c=ll,bottom:d=ll,left:m=ll,right:h=ll}=u,f=s.length,p={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(m+h),height:i.height+(c+d),value:i.value,dock:o};return p[n]=e,p[t]=i.segment.position,p.x-=i.width/2+m,p.y-=f*r/2+c,p}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:r,background:g})),y=y.concat(i)}),y}};function ml(e,t,n){let o;const i=typeof t;if("string"===i||"object"===i)o=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;o=e&&e[0]?e[0].formatter():null}return o}function hl(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:o,bottom:i,maxLabelWidth:r}=t;let a=1;return dl.getMaxTextWidth(e)>r&&(ol(e,t,r),a=Math.max(...e.map(e=>e.lines.length))),a*n+o+i}(t,n):function(e,t){const{left:n,right:o,maxLabelWidth:i}=t;return Math.min(i,dl.getMaxTextWidth(e))+n+o}(t,n)}function fl(e,t){return t?e.domain():[0,1]}function pl(e,t,n,o="value"){let i=e.filter(e=>e[o]>=t);i=i.filter(e=>e[o]<=n);const r=e.filter(e=>e[o]<t),a=e.filter(e=>e[o]>n);return{filteredLabels:i,minOobs:r,maxOobs:a,numMinOobs:r.length,numMaxOobs:a.length}}function gl(e){let t,n=0;for(let o=1;o<10;o++)t=e(o),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function yl(e,t){return e>9?t[1]:t[0]}function vl({alignment:e,dockValue:t,oobs:n,style:o,rect:i,symbol:r,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:h,minorDimension:f,dock:p}=s,g=i[f],y=Cs.createOob({oob:Cs.getDefaultSettings({size:o.size,fill:o.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:r});y.dock=p;const v=`c${m}`,b=`c${h}`,M={type:"circle",r:l,stroke:"transparent",fill:o.text.background.fill,strokeWidth:0,dock:p};M[b]=g/2,M[v]=a;const S={type:"text",text:c>9?"9+":c,title:rl({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:o.text.fontSize,fontFamily:o.text.fontFamily,fill:o.text.fill,baseline:"central",anchor:"middle",dock:p};return S[h]=g/2,S[m]=a,[y,M,S]}const bl=e=>{const t=tl({labelStyle:e}),n=xs.getFontHeight(t)*(e.lineHeightMultiplicator||1),o=e.gap||12,i=e.maxWidth||75,r=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:o,maxLabelWidth:i,top:r,bottom:a,left:s,right:l}},Ml=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 Sl={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:o,localeInfo:i}=this.settings,r=!!o||n.meta.canBeContinuous,a=Ml(this.settings.labels),s=ml(this.chart,this.settings.formatter,e);dl.addLabelTitles({labels:a,formatter:s,isContinuous:o,canBeContinuous:r,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:o,layoutService:i})=>{if(n){const[o,i]=fl(t,n);return pl(e,o,i)}if(o){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:o}=t;if("NaN"!==n&&"NaN"!==o)return pl(e,n,o,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:o,canBeContinuous:r,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:o,fontFamily:i,fontWeight:r}=n||{};return this.renderer.measureText({text:e,fontWeight:r||t.label.fontWeight,fontSize:o||t.label.fontSize,fontFamily:i||t.label.fontFamily})},c&&c.length){const e=bl(t.label),{dock:n}=this.settings.layout;return dl.measureLabelsWidth(c,this.measureText),d=hl(n,c,e),d}const m=gl(this.measureText),h=l?yl(l,m):0,f=u?yl(u,m):0;return d=Math.max(h,f),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:o,theme:i,isContinuous:r,isDimension:a,localeInfo:s}=this.settings,l=!!r||o.meta.canBeContinuous,u=Ml(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,h=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),f=function(e,t,n){const o=e[t.minorDimension];return{minorSize:o,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(o-n.right-n.left)/2+n.left:(o-n.top-n.bottom)/2+n.top}}(this.rect,h,m),{orientation:p,majorDimension:g}=h,{majorSize:y}=f,v=bl(n.label),{font:b,lineHeight:M,gap:S,maxLabelWidth:x}=v,C=ml(this.chart,this.settings.formatter,e),q=y;dl.addLabelTitles({labels:u,formatter:C,isContinuous:r,canBeContinuous:l,localeInfo:s}),dl.calculateLabelPositions({labels:u,scale:e,size:q,layoutService:o,orientation:p,rtl:d,isContinuous:r,isDimension:a});const[T,w]=fl(e,r),{filteredLabels:k,lowerOobs:N,upperOobs:L,lowerCircleSize:D,upperCircleSize:O,lowerOobSpace:E,upperOobSpace:A}=function({labels:e,minValue:t,maxValue:n,orientation:o,rtl:i,isContinuous:r,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=pl(e,t,n,u),h="scaledValue"!==u&&el.getInvert({orientation:o,rtl:i,isContinuous:r}),f=function(e,t,n){return n?t:e}(d,c,h),p=function(e,t,n){return n?e:t}(d,c,h),g=f.length,y=p.length,v=gl(l),b=yl(g,v),M=yl(y,v),S=function(e,t,n,o,i){return("vertical"===o?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,o,s),x=function(e,t,n,o,i){return("vertical"===o?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,M,o,s);return{filteredLabels:m,lowerOobs:f,upperOobs:p,lowerCircleSize:b,upperCircleSize:M,lowerOobSpace:S,upperOobSpace:x}}({labels:u,minValue:T,maxValue:w,orientation:p,rtl:d,isContinuous:r,style:n,padding:m,measureText:this.measureText,prop:r?"value":"scaledValue"}),I=E,P=y-A;al(N),al(L);const R=vl({alignment:0,dockValue:0,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+D/2,areaProps:h,radius:D/2,font:b}),z=vl({alignment:1,dockValue:1,oobs:L,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+O/2),areaProps:h,radius:O/2,font:b});dl.addLabelsInfo({labels:k,scale:e,majorSize:y,lowerLimit:I,upperLimit:P,labelStyle:v,lineHeight:M,gap:S,maxLabelWidth:x,majorDimension:g,orientation:p,measureText:this.measureText,rtl:d,layoutService:o,isContinuous:r,isDimension:a}),Hs.layout(k.map(e=>e.segment),I,P,n.label.gap);const B=k.filter(e=>Hs.isInside(e.segment,I,P,r));return dl.createLabels({labels:B,style:n.label,maxLabelWidth:x,areaProps:h,area:f,lineHeight:M,font:b,theme:i}).concat([...R,...z])}};var xl={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function Cl(e){const{qHyperCube:t,...n}=e,{qAxisData:o,qDataPages:i,qStackedDataPages:r,qTreeDataPages:l,...u}=t,c=le(!0,{},{...n,qHyperCube:{...u}}),{dataRelatedPropertiesPaths:d}=xl;function m(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==a(e,t)&&s(e,t,void 0));const o=t.substring(0,n),i=t.substring(n+2),r=i.startsWith(".")?i.substring(1):i;a(e,o,[]).forEach(e=>{r&&m(e,r)})}return d.forEach(e=>{m(c,e)}),c}var ql={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:o}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(o){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:o,dock:i}){return({currentNodes:r,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&r.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==i&&"right"!==i||r.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||r.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?r.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||o?r.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):r.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=o,e.y-=i):e.transform=`translate(${-o}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x;0===t.y-n.y&&0===o||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=o):(e.x-=o,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=o,e.x2-=o);else{const t="x"===e.major.p?o/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:o/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x;0===t.y-n.y&&0===o||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=o,e.cy-=i;break;case"rect":e.x-=o,e.y-=i;break;case"path":e.transform=`translate(${-o}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=o,e.y-=i):(e.cx-=o,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y,r=t.width-n.width,a=t.height-n.height;let s=-o,l=-i;e.forEach(e=>{switch(e.dock){case"right":o>0&&(s=t.width);break;case"left":r<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Cl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Cl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:Tl,extractInfoFromInputValue:wl,resolveValue:kl}=el;var Nl={resolveValue:kl,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const o=Tl({refLineLayout:e,layoutService:n});return wl(o,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const o=Tl({refLineLayout:e,layoutService:n});return wl(o,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:o}=t,{canBeContinuous:i}=n.meta,r=Tl({refLineLayout:e,layoutService:n});return o[r]&&i?o[r].qText:r},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const o=Tl({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[o]}};function Ll({isDimension:e,refLineModel:t={},layoutService:n,colorModel:o,dockService:i,animationsEnabled:r,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:h}){const f=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!f.length)return!1;const p={key:c,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:r,trackBy:ql.lines.trackBy,compensateForLayoutChanges:ql.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return f.forEach(r=>{p.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:o,colorModel:i,dockService:r,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{const m={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||o.meta.isContinuous?(m.scale=s,m.value=t.refLineExpr.value):(m.valueInfo=Nl.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:o}),m.value=()=>{const e=el.getScaledPosition({scale:a.scale(s),value:Nl.resolveValue({refLineLayout:t,refLineModel:n,layoutService:o}),valueInfo:m.valueInfo,size:a.component(c)?.rect["horizontal"===r.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:o,isContinuous:d});return Number.isNaN(e)?void 0:e}),m})({isDimension:e,refLineLayout:r,refLineModel:t,layoutService:n,colorModel:o,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),p}function Dl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:o,animationsEnabled:i,dock:r,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:h}){const f=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!f.length)return[];const p=[],g=!e||n.meta.isContinuous,y=f.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:o,scale:i,theme:r,isContinuous:a})=>{const s=o.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:u}=e,{fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f}=u||{},p={align:l,text:e.label,fill:e.coloredBackground?r.getContrastingColorTo(s):s,fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(p.background={fill:s}),a?(p.scale=i,p.value=e.refLineExpr.value):(p.value=()=>Nl.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueText=()=>Nl.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueInfo=()=>Nl.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),p})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:o,scale:a,theme:u,isContinuous:g}));return p.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:o,labels:i,scale:r,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:r,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:o.referenceLine.label.name.fontFamily,fontSize:o.referenceLine.label.name.fontSize,fontStyle:o.referenceLine.label.name.fontStyle,fontWeight:o.referenceLine.label.name.fontWeight,textDecoration:o.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:o.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:o.referenceLine.outOfBounds.fontFamily,fontSize:o.referenceLine.outOfBounds.fontSize,fill:o.referenceLine.outOfBounds.color,background:{fill:o.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:ql.refLineLabels.trackBy,compensateForLayoutChanges:ql.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:r,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:g,localeInfo:c})),p}const Ol={combineBounds(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach(e=>{e&&(t=Math.min(t,e.x,e.x+e.width),n=Math.max(n,e.x,e.x+e.width),o=Math.min(o,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))}),{x:t,y:o,width:n-t,height:i-o}}},El=(e,t,n)=>{if(!e)return Promise.resolve();let o=Ts.generate(t,n);return le(!0,t,n),o&&o.length?(o=o.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(o,!0)):Promise.resolve()},Al=e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1));function Il(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(e?.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const Pl={ref:null,refFn:e=>{const t=e.qHyperCubeDef.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id);return`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0.qExpression`},change(e){const t=e.qHyperCubeDef?.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id),n=Jr.getValue(e,`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0`),o=Jr.getValue(e,"color");n&&(n.id="colorByExpression",o&&(o.colorExpression=n.qExpression))}};function Rl({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const o=l(n);return o.setAlpha(e?.alpha>=0?e.alpha:1),o.isInvalid()?void 0:o.getRGBA()}function zl({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:o}=e,i=""===e.measureValue?void 0:+e.measureValue;if(Ps.isNumber(i))return i;const{dimensionCount:r,measureCount:a}=n.meta;if(2===r)return 0;const s=e.measureIndex?+e.measureIndex:0;return Ps.isNumber(s)&&!(s>=a||0===r)&&1===r?t[o]?.dataNode[s+1]?.qNum:void 0}const Bl={index:-1,color:"#595959"};function Fl({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,rtl:s,majorScale:u,minorScale:c,mainComponentKey:d,data:m,key:h}){if(!Array.isArray(m)||0===m.length)return!1;const f={resolveUIColor:o.getMain().getPaletteColor},p=i.getTheme(),g="horizontal"===a.meta.major.orientation,y=!(!g||!s),{canBeContinuous:v,isContinuous:b,isButterfly:M}=r.meta,S=r.getLayout(),x=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=l(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const o=n?.bgColor?.color;return Rl({color:o,colorModel:t})}({layout:S,colorModel:f})??p.getStyle("object","","backgroundColor"),C=el.getDimensionValuesInfo({layout:S,canBeContinuous:v,discreteModel:n,layoutService:r}),q=b?m:m.filter(e=>!!C[e.dimensionValue]),T={};q.map(e=>e.dimensionValue).forEach(e=>{C[e]&&(T[e]?(T[e].innerValues=C[e].innerValues,T[e].minOrder=Math.min(T[e].minOrder,C[e].minOrder),T[e].maxOrder=Math.max(T[e].maxOrder,C[e].maxOrder),T[e].isMinOrderOk=T[e].isMinOrderOk||C[e].isMinOrderOk,T[e].isMaxOrderOk=T[e].isMaxOrderOk||C[e].isMaxOrderOk):T[e]={id:C[e].id,dataNode:C[e].dataNode,qText:C[e].qText,innerValues:C[e].innerValues,minOrder:C[e].minOrder,maxOrder:C[e].maxOrder,isMinOrderOk:C[e].isMinOrderOk,isMaxOrderOk:C[e].isMaxOrderOk},T[e].numInnerValues=(T[e].maxOrder||0)-(T[e].minOrder||0)+1)}),q.forEach(e=>{const t=zl({point:e,dimensionValueInfo:T,layoutService:r});if(e.validMeasureValue=M&&1===e.measureIndex?-t:t,r?.meta?.isStacked){const t=T[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),o=t[e.measureIndex+1]?.qNum;if("number"==typeof o&&0!==o){const t=Math.sign(o);e.validMeasureValue=n.reduce((e,n)=>{const o=n.qNum;return"number"==typeof o&&Math.sign(o)===t?e+o:e},0)}}}const n=Rl({colorModel:f,color:e.style?.label?.color||Bl}),o=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=o?n:void 0,e.labelColor=o?i.getTheme().getContrastingColorTo(n):n,e.hasBackground=o,e.maxLabelWidth=100});const w={scale:u,fn:({datum:t})=>{const n=e.scale(u),o=t.value.dimensionValue;if(b)return n("string"==typeof o?""===o?void 0:+o:o);if(void 0===T[o])return;return el.getScaledPosition({scale:n,value:T[o].id,valueInfo:T[o],size:e.component(d)?.rect[g?"width":"height"],align:"center",invert:y,layoutService:r,isContinuous:b})}},k={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:h,type:"point",data:q,settings:{x:g?w:k,y:g?k:w,strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Rl({colorModel:f,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Rl({colorModel:f,color:e.value.style?.fill}):x,size:({datum:e})=>`${e.value.style?.dataPointSize??10}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:ql.points.compensateForLayoutChanges}}}const Hl=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,jl=!0,_l=!1,Vl={index:0,color:"none"},Ul={index:-1,color:"#595959"},$l={index:-1,color:"#595959"},Wl=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},Kl=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},Gl=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},Yl=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>Gr.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!Gr.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Hl(n.layout),convertFunctions:{get:(e,t,n,o)=>void 0===o.measureValue?1:0,set(e,t,n,o,i){0===e?(i.measureValue=0,delete i.measureIndex):(i.measureIndex=0,delete i.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Hl(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Hl(n.layout),invalid:(e,t,n)=>{return e.measureIndex<0||e.measureIndex>=(o=n.layout,o?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0);var o}}}),Xl=()=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:_l,showAlpha:jl,defaultValue:Vl},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:_l,showAlpha:jl,defaultValue:Ul},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:_l,showAlpha:jl,defaultValue:$l},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:3,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:10,min:3,max:30,step:1}}),Jl=({translator:e,pluginOptions:t})=>{const n={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),Gl(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach(Gl),Gr.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Wl(e);break;case"line":t=e,t.points?.forEach(Wl)}var t}):e.plugins.forEach(e=>{switch(e.type){case"point":Kl(e);break;case"line":t=e,t.points?.forEach(Kl)}var t}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:Yl({translator:e})},styleSection:{component:"items",items:Xl()}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:Yl({translator:e})},styleSection:{component:"items",items:Xl(),show:(e,t,n)=>{const o=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return o?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:_l,showAlpha:jl,defaultValue:Ul},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return n};var Zl=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,o=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=o.length):(n=arguments[1],t=arguments[2]),t&&o?(o.length>n&&(o=o.substr(0,n)),new e(o,t)):null}},Ql=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,o){let i,r;if(t.length===n)return r=this._value,this.setValue(o),r;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,o)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return Zl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Zl.newInstanceIfNeeded(e,t,this._value);const o=n.getLongestMatch(e,t+1);return o||Zl.newInstanceIfNeeded(e,t,this._value)}},eu=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new Ql);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new eu;let o,i,r;for(o in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[o]&&e.hasOwnProperty(o)&&(t[e[o]]=o);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(r=t[i].toLowerCase().substr(1),n.put(r,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const tu={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var nu={OPTIONS:tu,DEFAULT:tu.MINI_CHART};function ou({layoutService:e,discrete:t}){return({h:n,rect:o,orientation:i,minThumbSize:r})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=o[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<r){const e=(r-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=r}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function iu({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),o=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-o)/(i-o),(n.max-o)/(i-o)]}(t,n):function(e){return e.get("viewRange")}(t)}const ru=e=>({miniChart:e===nu.OPTIONS.MINI_CHART.value,bar:e===nu.OPTIONS.BAR.value,none:e===nu.OPTIONS.NONE.value});function au({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return ru(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return ru(nu.DEFAULT.value);const o=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return ru(!n&&(o||!o&&i)?nu.OPTIONS.NONE.value:nu.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===nu.OPTIONS.MINI_CHART.value,n.bar=t.value===nu.OPTIONS.BAR.value,n.none=t.value===nu.OPTIONS.NONE.value),n}function su({layoutService:e,dockService:t,discrete:n,continuousDataModel:o,viewState:i,viewCache:r,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=au({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?o.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>iu({layoutService:e,viewState:i,viewCache:r})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const f=a.getStyles();return f.color&&(h.style={standard:{thumb:{"border-color":f.color,opacity:.4},before:{background:f.color,opacity:.1},after:{background:f.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(h.settings.injections=()=>[ou({layoutService:e,discrete:n})]),h}function lu({componentKey:e,chart:t,viewState:n,viewCache:o,layoutService:i,dockService:r,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===r.meta.major.orientation,h=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,f=m?d.rect.computedInner.width:d.rect.computedInner.height,p=m&&a?f-h:h,g=Math.max(0,Math.min(p/f,1)),[y,v]=iu({layoutService:i,viewState:n,viewCache:o}),b=g<y,M=g>v,S=!b&&!M;return{pixel:p,relative:g,thumb:S?p-y*f:0,beforeThumb:b,afterThumb:M,onThumb:S}}}function uu({componentKey:e,chart:t,viewState:n,viewCache:o,layoutService:i,dockService:r}){return()=>{const a=t.component(e),{orientation:s}=r.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=iu({layoutService:i,viewState:n,viewCache:o});return{size:c,thumbSize:(m-d)*c}}}function cu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=lu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),c=uu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(o,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(r.meta.isContinuous){const e=o.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),r=i.get("continuousMax"),s=n+(r-n)*a.relative;o.set("zoom",{min:Math.min(s-t/2,r-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const du="data-scrollbar-handle";function mu({e:e}){return(e.srcEvent||e).srcElement.getAttribute(du)||""}const hu="scrollbarResize";function fu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:s}){const l=lu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:s});return{type:"Pan",key:`event:${hu}`,options:{event:hu,threshold:0,enable(e,t){return!(!r.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[hu]=this[hu]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&mu({e:t})&&(this[hu].panningEvent=t.srcEvent),!!this[hu].panningEvent))}},events:{[`${hu}start`](n){n.preventDefault(),this[hu]=this[hu]||{},this[hu].panningEvent&&t.component(e).emit("dragStart",this[hu].panningEvent)},[`${hu}move`](n){if(n.preventDefault(),this[hu]=this[hu]||{},!this[hu].panningEvent)return;const r=o.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=mu({e:this[hu].panningEvent});let m="start"===d?Math.min(c,r.max):r.min,h="end"===d?Math.max(c,r.min):r.max;m===h&&(m-="start"===d?u:0,h+="end"===d?u:0),o.set("zoom",{min:m,max:h}),t.component(e).emit("render")},[`${hu}end`](n){n.preventDefault(),this[hu]=this[hu]||{},delete this[hu].panningEvent,t.component(e).emit("dragEnd")},[`${hu}cancel`](n){n.preventDefault(),this[hu]=this[hu]||{},delete this[hu].panningEvent,t.component(e).emit("dragEnd")}}}}const pu="scrollbarPan";function gu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=lu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),c=uu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a});return{type:"Pan",key:`event:${pu}`,options:{event:pu,threshold:0,enable(o,i){return this[pu]=this[pu]||{},!(i&&!this[pu].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e))}},events:{[`${pu}start`](n){n.preventDefault();const a=u(n);if(this[pu]=this[pu]||{},this[pu].isPanning=!0,t.component(e).emit("lockState"),r.meta.isContinuous){const e=o.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),r=i.get("continuousMax"),s=n+(r-n)*a.relative;s<e.min?o.set("zoom",{min:Math.min(s,r-t),max:Math.max(s+t,n+t)}):s>e.max&&o.set("zoom",{min:Math.min(s-t,r-t),max:Math.max(s,n+t)}),this[pu].relative=a.relative,this[pu].zoom=o.get("zoom"),this[pu].zoom.span=this[pu].zoom.max-this[pu].zoom.min,this[pu].zoom.fullSpan=r-n}else if(a.onThumb)this[pu].offset=a.thumb;else{const e=c();this[pu].offset=a.beforeThumb?0:e.thumbSize}},[`${pu}move`](n){n.preventDefault();const a=u(n);if(this[pu]=this[pu]||{},r.meta.isContinuous){const e=a.relative-this[pu].relative,{fullSpan:t,span:n,min:r,max:s}=this[pu].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");o.set("zoom",{min:Math.min(r+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[pu].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${pu}end`](n){n.preventDefault(),this[pu]=this[pu]||{},this[pu].isPanning=!1,t.component(e).emit("unlockState")},[`${pu}cancel`](n){n.preventDefault(),this[pu]=this[pu]||{},this[pu].isPanning=!1,t.component(e).emit("unlockState")}}}}function yu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){return[cu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}),fu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),gu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l})]}function vu({componentKey:e,chart:t,actions:n,layoutService:o}){const i=(i,r)=>{if(!o.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,r)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function bu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){return{gestures:[...yu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l})],native:vu({componentKey:e,chart:t,actions:n,layoutService:r})}}const Mu={background:"rgba(0, 0, 0, 0.1)"},Su={top:-1,bottom:-1,width:6},xu={width:2,background:"#595959"};var Cu={before:Mu,after:Mu,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Su,endHandle:Su,startHandleBorder:xu,endHandleBorder:xu};const qu={background:"rgba(0, 0, 0, 0.1)"},Tu={top:-1,bottom:-1,width:6},wu={width:2,background:"#595959"};var ku={before:qu,after:qu,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Tu,endHandle:Tu,startHandleBorder:wu,endHandleBorder:wu};const Nu={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Lu={pointerEvents:"initial"},Du={pointerEvents:"none"};const Ou="ew-resize",Eu="default";function Au(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,o=n?e.computedInner.width:e.computedInner.height,i=t.range(),r=n&&t.rtl;return{size:o,start:(r?1-i[1]:i[0])*o,end:(r?1-i[0]:i[1])*o}}function Iu(){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?Ou:Eu}function Pu(e,t,n){const{min:o}=this.settings.settings.size.thumb;if(n-t<o){const i=(o-(n-t))/2,r=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+r,end:n+i+r}}return{size:e,start:t,end:n}}function Ru(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function zu(){const{size:e,start:t,end:n}=Au.call(this);this.renderer.render(this.elements(this.h,Pu.call(this,e,t,n)))}function Bu(){const{state:e,settings:t,style:n}=this,o=t.settings.style;return e.style[o]||(e.style[o]=function({id:e,style:t}){const n="slim"===e?ku:Cu;return{container:{...Nu},before:{...Nu,...n.before,...t.before},after:{...Nu,...n.after,...t.after},thumb:{...Nu,...n.thumb,...t.thumb},startHandle:{...Nu,...Lu,...n.startHandle},endHandle:{...Nu,...Lu,...n.endHandle},startHandleBorder:{...Nu,...Du,...n.startHandleBorder},endHandleBorder:{...Nu,...Du,...n.endHandleBorder}}}({id:t.settings.style,style:n[o]})),e.style[o]}var Fu={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(){zu.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||!Ru.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=mu({e:e});t&&(this.state.hover[t]=!0),Iu.call(this),zu.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Iu.call(this),zu.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=mu({e:e});t&&(this.state.drag[t]=!0),Iu.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Iu.call(this),zu.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:o}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*o))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:o}=Au.call(this);return this.elements(e,Pu.call(this,t,n,o))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:o}){const{settings:i}=this.settings,r=i.injections().map(t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min}));return function({h:e,size:t,start:n,end:o,properties:i,startHandleActive:r,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},m={[i.start]:o},h={left:-3},f={left:1},p={right:-3,left:"auto"},g={left:3},y=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?p:h},class:"scrollbar--start-handle",[du]:"start"},r?e("div",{style:{...s.startHandleBorder,...u?g:f}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?h:p},class:"scrollbar--end-handle",[du]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?f:g}}):void 0);b.push(n)}const M=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-o},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,M,v,...c])}({h:e,size:t,start:n,end:o,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:Bu.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:r})}};const Hu={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:o,rendHeight:i,flipXY:r,symbol:a}){let s="x",l="y",u=o,c=i,d=t<.5?90:-90;return r&&(s="y",l="x",u=i,c=o,d=t<.5?180:0),a(le({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function ju({i:e,width:t,height:n,resolved:o,keys:i,flipXY:r,calcKey:a="box"}){let s,l=null,u=null;void 0!==o.major.settings.binStart?(l=o.major.items[e].binStart,u=o.major.items[e].binEnd,s=o.major.settings.binStart.scale):(s=o.major.settings.major.scale,l=s?o.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=le({},{major:l,majorEnd:u},o.minor.items[e]);i.forEach(t=>{d[t]=o[t].items[e]});const m=r?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:o,maxMajorWidth:i}){const r=e>=0?1:-1;let a=Math.min(r*e*t,Number.isNaN(Number(o))?i:o/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*r}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),f=(c-h)/2,p=f+d.major+h/2;return{item:d,boxCenter:p,boxWidth:h,boxPadding:f,rendWidth:t,rendHeight:n}}function _u({keys:e,data:t,defaultSettings:n,style:o,settings:i,width:r,height:a,resolver:s}){const l=le(!0,{},n||{},o||{}),u={major:"horizontal"===i.orientation?a:r,minor:"horizontal"===i.orientation?r: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:le(!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:le(!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 h;const f={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:le(!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 n=0,o=e.length;n<o;n++)h=e[n],f[h]=s.resolve({data:t,defaults:l[h],settings:i[h],scaled:u});return f}const Vu=["oob"];const Uu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,o="horizontal"===this.settings.settings.orientation,{data:i,style:r,resolver:a,symbol:s}=this,l=_u({keys:Vu,data:i,defaultSettings:{oob:Hu.getDefaultSettings()},style:r,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:o,keys:i,symbol:r,dockValue:a,_calcItemRenderingOpts:s=ju}){const l=[],{items:u}=o.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:h,rendHeight:f}=s({i:c,width:e,height:t,resolved:o,keys:i,flipXY:n,calcKey:"oob"}),p=u[c].data,g=[];if(d.oob.show){g.push(Hu.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:h,rendHeight:f,flipXY:n,symbol:r}));const e={type:"container",data:p,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:o,resolved:l,keys:Vu,symbol:s,dockValue:n});return d}},$u={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Wu=["hat"];function Ku(e,t=!0){let n="";for(let t=0;t<e.length;t++){const o=e[t];n+=0===t?`M${o.x} ${o.y}`:`L${o.x} ${o.y}`,n+=" "}return t&&(n+="Z"),n}function Gu({item:e,boxWidth:t,boxPadding:n,rendWidth:o,rendHeight:i,flipXY:r}){let a="x",s="y",l=o,u=i,c=e.hat.alignment||0;r&&(a="y",s="x",l=i,u=o,c=1-c);const d=(n+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 h=le({},e.hat,{type:"path",d:Ku(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[h,le({},e.hat,{type:"path",d:Ku(m)})]}const Yu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:o,style:i,resolver:r}=this,a=_u({keys:Wu,data:o,defaultSettings:$u,style:i,settings:this.settings.settings,width:e,height:t,resolver:r}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:o,keys:i,_calcItemRenderingOpts:r=ju}){const a=[],{items:s}=o.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h}=r({i:l,width:e,height:t,resolved:o,keys:i,flipXY:n,calcKey:"hat"}),f=s[l].data,p=[];u.hat.show&&p.push(...Gu({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h,flipXY:n}));const g={type:"container",data:f,collider:{type:"bounds"},children:p};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:Wu});return u}};var Xu={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function Ju(e,t,n,o){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map(t=>{const r=i([t.data.value,o?n-1:0]),a=i([t.data.value,o?0:n-1])+e.bandwidth();return{position:(r+a)/2,label:t.label,data:t.data,start:r,end:a}}),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(o){const i=e.pxScale(o);return i===e?this:Ju(i,t,n)},i}function Zu(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},o={}){const i=t(e,n,o),r=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return r.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),Ju(i,a,l,e.invert)})}const Qu=()=>({version:"1.39.12",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}),ec={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 tc(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const nc={getImageSize(e,t){let n;function o(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,o()}const r={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=r[t]*(n>l?1:n/l),c=r[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},o()):(e={height:u,width:c},o()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function oc(e,t,n){let o=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,o,i,r,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",o=t.host||"localhost",i=t.port?`:${t.port}`:"",r=t.prefix?t.prefix:"/","/"!==r[r.length-1]&&(r=`${r}/`),n+o+i+r}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(o,i),o=o.replace(/"/g,'\\"'),o=o.replace(/'/g,"\\'"),o=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(o,i));const{height:r,width:a,imageError:s}=await nc.getImageSize(o,t);return{src:o,size:t,height:r,width:a,imageError:s}}async function ic(e,t,n,o){const{app:i,flags:r}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const d=o.data?.customTooltipAttrExps?.value||[];let m;if(-1!==c&&d[c]&&(m=d[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return oc(s,l,i);if("url"===u)return async function(e,t,n,o,i){let r,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&tc(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await nc.getImageSize(t,o);r={src:t,size:o,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await nc.getImageSize(a,o);r={src:a,size:o,height:e,width:t,imageError:n}}return r}(i,r,s,l,m);if(r.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&m&&m.label){return async function(e,t,n,o){let i;const r=o.label,a=`qmem://${t.qFallbackTitle}/${r}`;if(tc(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:o,width:r,imageError:a}=await nc.getImageSize(e,n);i={src:e,size:n,height:o,width:r,imageError:a}}}catch(e){}return i}(i,n[c],l,m)}return[]}const rc={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:o}){const i=t,r=[];for(let t=0;t<i.length;t++)r.push(ic(e,o,n,i[t]));const a=await Promise.all(r);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},ac={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:o}){let i=t;return i=await rc.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:o}),i},checkIfPromisesExist:({customTooltipModel:e})=>rc.checkIfPromisesExist({customTooltipModel:e})};const sc=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,o=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,r=t;return{qInfo:{qType:ec.CHART.CHART_PARENT_TYPE,qId:ec.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:o,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:r}},lc=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:ec.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const uc={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",o=ec.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:o,height:o,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:ec.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":o}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:o,customTooltipModel:i,rtl:r})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await uc.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const o=n,i=ec.CHART.STATE,r=t.qStateName;o.miniChartToken.alternateState||(o.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,r),o.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const o=n;o.miniChartToken.sessionObj?.id&&await e.destroySessionObject(o.miniChartToken.sessionObj.id);const i=ec.CHART.STATE,r=sc(t,i),a=await e.createSessionObject(r),s=lc(t);if(a.id!==ec.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);o.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(o.miniChartToken.sessionObj&&o.miniChartToken.sessionObj.id===a.id)return o.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==o?o:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===o&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],o=void 0!==e.value?[e.value]:[];o.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),o,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(ec.CHART.CONTAINER_ID),u={direction:r?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await uc.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(uc.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(ec.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,o=ec.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(o)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function cc(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function dc(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:o}=ec.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[o]=!0,i}function mc(e){const t=dc();return e.filter(e=>t[e.id])}const hc={getNodes(e,t){const n=function(e,t){let n=0,o=0;e.center?(n+=e.center.x,o+=e.center.y):(n+=e.clientX,o+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:o-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,o=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const r=t.data?.selectionDimension??t.data;if(!r||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],o.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===r.value&&t.label===r.label});t.length>0&&(o=o.concat(t[0]))}}),o},displayTooltip(e,t,{nodes:n,opts:o={},customTooltipModel:i,extractedNodes:r=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=hc.getAttrExprData(a);r.length||n.length?ac.handlePromises({customTooltipModel:i,nodes:hc.getDataNodes(s,r.length>0?r:n),attrExps:l,opts:o}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&uc.hide({app:o.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>ac.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,o=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[o]||(n[o]=[]),n[o]},getAttrExprData(e){let t=[],n="";const o=e.qHyperCube?.qDimensionInfo||[];if(o.length>0){const i=o.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[ec.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let o=n.qLayoutExclude;o||(n.qLayoutExclude={quarantine:{}},o=n.qLayoutExclude),o.quarantine||(o.quarantine={}),o.quarantine[ec.CUSTOM.QUARANTINE]=[],e.forEach(e=>{o.quarantine[ec.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=o}(mc(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[ec.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[ec.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=cc(e);if(!n)return;const o=void 0!==t?t:n.length-1;if(!n[o])return;const i=this.getAttrExps(e,n[o]);if(0===mc(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],r=e;r.qHyperCubeDef?r.qHyperCubeDef.qDimensions[o].qAttributeExpressions=n:r.qHyperCube.qDimensionInfo[o].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let o=[];const i=cc(e)||[];[...i,t].forEach(e=>{const t=mc(e.qAttributeExpressions||[]);t.length>0&&(o=t)});const r=dc(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!r[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(o));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=>e.tooltip?.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:pa.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=pa.detectTextDirection(e.src),o=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){o.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;o.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,o),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function fc({layout:e,app:t,picasso:n,model:o,chart:i,translator:r,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:o,chart:i,translator:r,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:hc,miniChartToken:{},embed:s}}function pc(e,t,n,o){const i=t.qHyperCube?.[n]?.[o]?.qAttrExprInfo||[],r=[],a=e.qSubNodes&&e.qSubNodes[o]?e.qSubNodes[o].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case ec.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case ec.CUSTOM.TITLE:case ec.CUSTOM.DESCRIPTION:case ec.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);r.push({source:{key:"qHyperCube",field:`${n}/${o}/qAttrExprInfo/${t}`},label:s,value:"value"})}),r):r}const gc={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,o="qDimensionInfo";return{field:`${o}/${n}`,value:t=>pc(t,e,o,n)}}};const yc={getCustomAttrExps(e,t,n){const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return o;return function(e,t,n,o){const i={[ec.CUSTOM.TITLE]:!0,[ec.CUSTOM.DESCRIPTION]:!0},{attrExps:r,fieldPath:a}=hc.getAttrExprData(e);return 0===t.length||0===r.length||""===a||r.forEach((e,r)=>{const s=t[r];if(e.id===ec.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${r}`).formatter()(s.value);o.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&&o.customTooltipInfoAttrExpsArr.push({...e.id===ec.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),o}(n,i.map(t=>ga.getMeasure(e,t)),e,o)}};function vc({nodes:e,layout:t,dataset:n}){const o=function(e,t,n){const o=[];return e.forEach(e=>{o.push(yc.getCustomAttrExps(n,e,t))}),o}(e,t,n);return o.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function bc(e){const t=ec.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}}function Mc(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const Sc={migrateProperties(e){const t=le(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let o=Mc(t);return o=function(e,t){return t.concat(e.map(e=>bc(e)))}(n,o),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(o,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,o=function(e,t,n){let o=e.length;const i=[];return t.forEach(e=>{const t=bc(e),r=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${o}`,qOp:"add",qValue:r}),o++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Mc(e),t,n);return o},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const o=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},r=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,o)&&e.getEffectiveProperties().then(t=>{if(r){const o=this.migrateProperties(t);e.setProperties(o).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const o=this.getPatches(t);e.applyPatches(o,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var xc={attrExpr:Sc};const{CUSTOM:Cc}=ec;function qc({flags:e,layout:t,app:n,model:o,picasso:i,chart:r,translator:s,localeInfo:l,embed:u,options:c}){const d={properties:void 0},m=fc({layout:t,app:n,model:o,picasso:i,chart:r,translator:s,localeInfo:l,embed:u}),h="rtl"===c.direction,f=()=>{const e=!!d.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{d.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&a(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const o=vc({dataset:e,nodes:n,layout:t});return{title:o.customTooltipInfoAttrExpsArr.find(e=>e.id===Cc.TITLE)?.title,description:o.customTooltipInfoAttrExpsArr.find(e=>e.id===Cc.DESCRIPTION)?.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>hc.checkIfPromisesExist({customTooltipModel:m}),createImageRow:({value:e,h:t})=>hc.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:o})=>{const i=hc.getDataNodes(r,o),{attrExps:a}=hc.getAttrExprData(t);return ac.handlePromises({customTooltipModel:m,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&u&&"function"==typeof o?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>uc.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>hc.getFooterRow(s.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>uc.show({app:n,properties:t,selectedNodes:e,customTooltipModel:m,rtl:h}),hasAlternateState:()=>!!m.miniChartToken?.alternateState,hide:()=>uc.hide({app:n,customTooltipModel:m}),destroy:()=>uc.destroyVisualization({customTooltipModel:m})}}}var Tc=7005;const wc=e=>e.qError?.qErrorCode!==Tc,kc=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&Jr.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Nc=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&Jr.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&Jr.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Lc=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},Dc=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,o=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===o.length){const o=n[0];return o.qLibraryId?t.getDimension(o.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Nc(e,n)}return o}):t.getField(o.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(Nc(e,t),o)),()=>o)}return kc(e),Promise.resolve()};function Oc(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:o}}=e;t.length>1&&e.color?s(e,"color.persistent",!0):"byDimension"===o&&n.length>1?s(e,"color.mode","byMultiple"):"byExpression"===o&&0===n.length?s(e,"color.mode","primary"):0===t.length&&n.length>0&&(s(e,"color.byMeasureDef",void 0),s(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==o&&s(e,"color.mode","primary"))}const Ec=(e,t)=>{Oc(t),ps(e),hc.addCallbackCustomTooltip(t)},Ac=e=>{Oc(e)};function Ic({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,o,i){let r;const a=i?.layout?i.layout.qHyperCube.qDimensionInfo.filter(e=>wc(e)).length:t.qHyperCubeDef.qDimensions.length;return o.isAutoChart&&n>a-1?r="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?r="Visualizations.Descriptions.Stack":(r="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):r="Visualizations.Descriptions.Bars",e.get(r)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?Dc(t,n.app).then(()=>(Ec(e,t),e)):(Lc(t),Ec(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter(e=>wc(e)).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),kc(t),Oc(t),hc.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Oc(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),hc.removeCallbackCustomTooltip(t,e)},replace(e,t,n,o){hc.replaceCallbackCustomTooltip(o,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?Dc(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,Ac(t),e)):(Lc(t),Ac(t),e),move(e,t){kc(t),Oc(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Oc(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Pc(e){return{properties:Qu(),data:{targets:[{path:"/qHyperCubeDef",...Ic(e)}]}}}var Rc={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"en-US":"The chart is not displayed because it contains only negative values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。","zh-CN":"未显示图表,因为它仅包含负值。","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения."}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"en-US":"The data set contains negative values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值。","zh-CN":"数据集包含无法在此图表中显示的负值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};const zc="REJECTED",Bc=()=>{},Fc=1e4,Hc={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},jc=50,_c=10,Vc=100;var Uc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),o=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),r=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,r-e.qArea.qLeft),u=Math.min(r+o-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:r},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const o=n.qTop-_c<=t.qTop,i=n.qLeft+n.qWidth+_c>=t.qLeft+t.qWidth,r=n.qTop+n.qHeight+_c>=t.qTop+t.qHeight,a=n.qLeft-_c<=t.qLeft;return o&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||r&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var $c={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),o=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),r=Math.max(0,o-e.qArea.qTop),a=Math.min(o+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-o-(a-r),l={qArea:{qHeight:a-r,qWidth:e.qArea.qWidth,qTop:o,qLeft:i},qData:[{...e.qData[0],qUp:o,qDown:s,qSubNodes:[]}]};for(let t=r;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const o=n.qTop-_c<=t.qTop,i=n.qTop+n.qHeight+_c>=t.qTop+t.qHeight;return o&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var Wc={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 Kc="pages";const Gc="discretePan",Yc=10;function Xc({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r}){return{type:"Pan",key:"discrete:pan",options:{event:Gc,pointers:1,threshold:Yc,enable(o,i){return this.started===Gc||!i||!(!t.scroll.enabled()||!r.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${Gc}start`](e){e.preventDefault(),this.started=Gc;const t="horizontal"===o.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-Yc:Yc},[`${Gc}move`](e){e.preventDefault();const t="horizontal"===o.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,r.scroll(s)},[`${Gc}end`](e){e.preventDefault(),this.started=!1},[`${Gc}cancel`](e){e.preventDefault(),this.started=!1}}}}function Jc({chart:e,componentKey:t,actions:n,scroller:o}){return function(i){if(!n.scroll.enabled()||!o.enabled())return;const[r]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!r)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*Vc;o.scroll(s)}}function Zc({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Fc/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const o=Math.min(t,Math.max(Hc.MAXIMUM,n));return{width:e,height:Math.max(Hc.MINIMUM,Math.min(n*Hc.MULTIPLIER,o))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:o,height:i}=t({width:e.qWidth,height:e.qHeight}),r=i?Math.ceil((i-e.qHeight)/2):0,a=o?Math.ceil((o-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:o?Math.min(o,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-r,n.height-i)):e.qTop,qLeft:o?Math.max(0,Math.min(e.qLeft-a,n.width-o)):e.qLeft}}}function Qc(e){let t,n;const o=i=>{t=i;const{method:r,args:a}=t.request;e[r](...a).then(e=>{if(t.canceled||n)return t.reject(zc),t=null,void(n&&(o(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,r)=>{const a={request:e,resolve:i,reject:r,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(zc),n=e})(a):o(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(zc),n=null)},i}const ed={command:{update:()=>{}}};var td={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const{pixel:i}=t,r=e.getDataPages()[0],a=i/o;return[a,n.inView>=n.inTotal?a+1:a+r.qArea.qWidth/n.inView]}};var nd={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:o}){const i=void 0===o?4:o,r=Math.max(0,Math.floor(t)-i/2);return{qTop:r,qHeight:Math.min(e.meta.size.y-r,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const{pixel:i}=t,r=e.getDataPages()[0],a=o/n.inView,s=(i+r.qArea.qTop*a)/o;return[s,n.inView>=n.inTotal?s+1:s+r.qArea.qHeight/n.inView]}};function od(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function id(e,t){const n=[];for(let o=0;o<e.length;o++){const i=t(e[o]);-1===n.indexOf(i)&&n.push(i)}return n.length}function rd(e){return id(e.qMatrix,e=>e[0].qElemNumber)-1}var ad={inTotal:function({layoutService:e}){const t=od(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:o}){const i=od(e),r=void 0===o?i:o,a=t/(i+1),s=Math.max(0,Math.floor((t-a-r/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+r)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const i=od(e),r=e.getDataPages()[0],a=o/n.inView,{pixel:s}=t,l=rd(r),u=r.qArea.qHeight*i+l,c=(s+(r.qArea.qTop*i+r.qArea.qTop)*a)/o;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const sd=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function ld(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return sd(e,n);const o=((e,t)=>{const n={successful:!0,count:0};let o=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=o;t++){if(!e[t])return n.successful=!1,n;const r=e[t][0].qElemNumber;-1===i.indexOf(r)&&(i.push(r),o--)}return n.count=i.length-1,n})(t.qMatrix,n);return o.successful?o.count:sd(e,n)},area(t,n,o){if(0!==t.qArea.qTop)return sd(e,n);return id(t.qMatrix.slice(0,o.qTop+1),e=>e[0].qElemNumber)-1}}}var ud={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:o}){const i=ld(t).itemOffset(e(),n),r=Math.max(0,Math.floor(n-i));return{qTop:r,qHeight:Math.min(t.meta.size.y-r,Math.max(0,Math.ceil(o+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:o,viewSize:i,upperBound:r}){const a=t.getDataPages()[0],s=i/o.inView,{item:l,pixel:u}=n,c=ld(t).area(e(),l,a.qArea),d=rd(a),m=a.qArea.qHeight+d,h=u===r?(o.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[h,o.inView>=o.inTotal?h+1:h+m/o.inView]}};function cd({chart:e,rect:t,dockService:n,itemWidths:o,axisKey:i,renderer:r,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:h}=o[n.meta.chart.mode],f="horizontal"===n.meta.major.orientation,{axisDisplayMode:p="auto",maxVisibleItems:g=10,label:y}=s,v=f?t.width:t.height,b=v/l>=m;switch(p){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:o={},isGrouped:i,itemSize:r,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=o;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>r;const h=(90-d)*(Math.PI/180);return m>Math.cos(h)*r}({chart:e,isHorizontal:f,axisKey:i,renderer:r,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}var dd="AVERAGE",md="LINEAR",hd="POLYNOMIAL2",fd="POLYNOMIAL3",pd="POLYNOMIAL4",gd="EXPONENTIAL",yd="LOG",vd="POWER";function bd({dimValue:e,value:t,qTrendLine:n}){const{qType:o,qCoeff:i}=n,r={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(o){case fd:return r.y+=i[3]*t**3,r;case pd:return r.y+=i[4]*t**4+i[3]*t**3,r;default:return r}}var Md={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:bd,polynomial3:bd,polynomial4:bd,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function Sd(e,t){const n=Md[t.qType.toLowerCase()],o=Math.max(1,e/500);let i=1/0,r=-1/0;for(let a=0;a<e;a+=o){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),r=Math.max(e,r)}return{min:i,max:r}}function xd(e){return Md[e.qType.toLowerCase()]}function Cd(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,o,i)=>{const r=[],a=xd(n),s=t.get("zoom"),l=n.start??s.min,u=n.end??s.max,c=(u-l)/100,d=e.meta.isButterfly&&i>0;if(c>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=o,t.measureIndex=i,t.dimValue=e,r.push(t)};let t=l;for(let n=l;n<=u;n+=c)e(n),t=n;t!==u&&e(u)}return r},calculate:(e,t)=>xd(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,o)=>{const i=[],r=e.getDataPages()[0],a=r.qData[0].qSubNodes,s=r.qArea.qTop,l=Md[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const r=a[e],u=l({dimValue:r.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=o,u.dimValue=r.qText,i.push(u)}return i},findMinMax:Sd}}(e):function(e){return{generate:(t,n,o)=>{const i=[],r=e.getDataPages()[0],a=r.qMatrix,s=r.qArea.qTop,l=Md[t.qType.toLowerCase()],u=e.meta.isButterfly&&o>0;for(let e=0;e<a.length;e++){const r=a[e][0],c=e+s+1,d=l({dimValue:r.qElemNumber,value:c,qTrendLine:t});u&&(d.y=-d.y),d.layerId=n,d.measureIndex=o,d.dimValue=r.qText,i.push(d)}return i},calculate:(e,t,n)=>(0,Md[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:Sd}}(e)}var qd={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},Td={color:"#f93f17",index:9};const{isDark:wd}=fs,kd={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Nd=({layoutService:e,viewState:t,colorModel:n,chart:o,env:i,keys:{colorScale:r},isEnabled:a=()=>!1})=>{const{translator:s}=i,l=[kd],u=[],c=[],d=Cd(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map(()=>t)))});const h=m(e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=o.scale(r)(t);return wd(n)?function(e){const t=ds(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=ds(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(Td)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:h,getLineDash:e=>{const{style:t}=u[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=u[e]||{};return t?.lineThickness??2},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(qd.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach(o=>{const i=d.findMinMax(e.meta.size.y,o);t=Math.min(i.min,t),n=Math.max(i.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const o=u[e];return d.calculate(o,t,n)}},command:{update:()=>{l.length=0,u.forEach((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)})}}}};var Ld={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Dd=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Od=(e,{layoutService:t,trendLineModel:n,dockService:o,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const r=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:o,dockService:i,animationsEnabled:r})=>{const a=Dd(o);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:Ld,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:r,trackBy:ql.nonUpdatingNode.trackBy,compensateForLayoutChanges:ql.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:o,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:o,dockService:i})=>{const r=Dd(o),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:r},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:Ld,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:o});return[r,a]};function Ed(e,t){const{getLabel:n,getType:o,getLineDash:i,getStroke:r}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:r(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:o(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Ad(e,{h:t,style:n}){return e.map(e=>{const o={style:{direction:"string"==typeof e.content?pa.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(o.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:pa.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",o,i)})}function Id(e,t){return({h:n,data:o,style:i})=>{const r=o[0].title,a=o.filter(e=>e.title===r),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:pa.detectTextDirection(t)},t);return e("tr",{},n)}(n,r),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},Ad(e.row,{h:n,style:i})))}),o.length>2){const i=o.length-2;l.push(...function(e,t,n,o){const i=t?t.get("Object.ChartTooltip.NMore",o):`+${o} more`,r=pa.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:r},colspan:3},i))]}(n,e,t,i))}return l}}function Pd(e,{trendLineModel:t,translator:n},o={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=o,r=da({key:e.tooltip,rtl:i});return le(!0,r,{settings:{extract:Ed(e,t),content:Id(n,i),placement:"pointer",direction:o.rtl?"rtl":"ltr"}})}function Rd(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function zd(e,{chart:t,viewState:n,trendLineModel:o,layoutService:i,rtl:r}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Rd(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=o.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(o,a)=>{const l=Rd(o,t),u=t.shapesAt({cx:(c=l).x,cy:c.y,r:3},s);var c;if(u.length){const o=function(e,t,n,o){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=o?1-i:i;const{min:r,max:a}=n.get("zoom");return r+(a-r)*i}(l,a,n,r),s=t.scale(e.majorInnerScale),c=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(o);u.forEach(e=>{e.data.dimValue.value=o,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,o).y})}return u}}return n=>{const o=t.component(e.tooltip);if(o&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,o);return e.length?(o.emit("show",n,{nodes:e}),!0):(o.emit("hide"),!1)}return!1}}const Bd=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},Fd=e=>{Bd(e),e.qMultiDimMode="Sum",e.qXColIx=0};function Hd(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:o=!1}=e;return{show:(e,t,{layout:n})=>!ta.dimensionless(n)&&!ta.groupedByDimension(n)&&(o||!ta.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:qd.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(qd.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:qd.ADD_BUTTON,add:Fd,globalChange:e=>{const t=a(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),o=(e=>!a(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=o}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:qd.TYPE,options:[{value:dd,translation:qd.TYPES.AVERAGE},{value:md,translation:qd.TYPES.LINEAR},{value:hd,translation:qd.TYPES.POLYNOMIAL2},{value:fd,translation:qd.TYPES.POLYNOMIAL3},{value:pd,translation:qd.TYPES.POLYNOMIAL4},{value:gd,translation:qd.TYPES.EXPONENTIAL},{value:yd,translation:qd.TYPES.LOG},{value:vd,translation:qd.TYPES.POWER}],defaultValue:dd},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:Td,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:qd.STYLE.DASHED,type:"boolean",defaultValue:!0,change:Bd}}}}var jd={};function _d(){_d.init.call(this)}jd.isObject=function(e){return"object"==typeof e&&null!==e},jd.isNumber=function(e){return"number"==typeof e},jd.isUndefined=function(e){return void 0===e},jd.isFunction=function(e){return"function"==typeof e};var Vd=_d;_d.EventEmitter=_d,_d.prototype._events=void 0,_d.prototype._maxListeners=void 0,_d.defaultMaxListeners=10,_d.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},_d.prototype.setMaxListeners=function(e){if(!jd.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},_d.prototype.emit=function(e){var t,n,o,i,r,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],jd.isUndefined(n))return!1;if(jd.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,i=new Array(o-1),r=1;r<o;r++)i[r-1]=arguments[r];n.apply(this,i)}else if(jd.isObject(n)){for(o=arguments.length,i=new Array(o-1),r=1;r<o;r++)i[r-1]=arguments[r];for(o=(a=n.slice()).length,r=0;r<o;r++)a[r].apply(this,i)}return!0},_d.prototype.addListener=function(e,t){var n;if(!jd.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,jd.isFunction(t.listener)?t.listener:t),this._events[e]?jd.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,jd.isObject(this._events[e])&&!this._events[e].warned)&&((n=jd.isUndefined(this._maxListeners)?_d.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,jd.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),jd.isFunction(console.trace)&&console.trace()));return this},_d.prototype.on=_d.prototype.addListener,_d.prototype.once=function(e,t){if(!jd.isFunction(t))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}return o.listener=t,this.on(e,o),this},_d.prototype.removeListener=function(e,t){var n,o,i,r;if(!jd.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,o=-1,n===t||jd.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(jd.isObject(n)){for(r=i;r-- >0;)if(n[r]===t||n[r].listener&&n[r].listener===t){o=r;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},_d.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],jd.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},_d.prototype.listeners=function(e){return this._events&&this._events[e]?jd.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},_d.listenerCount=function(e,t){return e._events&&e._events[t]?jd.isFunction(e._events[t])?1:e._events[t].length:0};var Ud=Z(Vd);const $d={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 Wd=e=>(Object.keys(Ud.prototype).forEach(t=>{e[t]=Ud.prototype[t]}),Ud.init(e),e);var Kd={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}},Gd={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",BASE_TOOLTIP_NEW:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const Yd=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Tc),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Tc);return 1===(t?.length??0)&&2===(n?.length??0)},Xd=e=>({layout:e})=>{const t=Gr.canBeContinuous(e),n=ta.continuous(e),o=ta.dimensionless(e),i=Yd({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:Gr.isTime(n,e),isDimensionless:o,isSimple:ta.simple(e),isGrouped:!i&&ta.grouped(e),isGroupedByMeasure:!i&&ta.groupedByMeasure(e),isGroupedByDimension:!i&&ta.groupedByDimension(e),isStacked:!i&&ta.stacked(e),isStackedByDimension:!i&&ta.stackedByDimension(e),isStackedByMeasure:!i&&ta.stackedByMeasure(e),isSnapshot:ta.snapshot(e),isButterfly:i}};function Jd({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:o,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&o({componentName:"continuousRangeBrush",brushName:!1})}function Zd({chart:e,actions:t,selections:n}){const o=e.scale(Gd.SCALE.MAIN.MAJOR);return h({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:o,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:Jd},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}const Qd=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const o=e.qDimensionInfo[n];if(!(o.qLocked||o.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function em({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function tm({app:e,model:t,translator:n,picasso:o,localeInfo:i,theme:r,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,m={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=u.model().mode,g=c||p||d,y=!c&&(p||d)&&l?l.getHyperCube():void 0,v=y?"legendCube":void 0;return m.main=f({app:e,model:t,translator:n,picasso:o,layoutService:s,config:{localeInfo:i,auto:em,key:Gd.SCALE.MAIN.COLOR},createConfig:()=>({hc:g?y||s.getHyperCube():u.model().cube,source:g?v:"miniCube",theme:r})}),h.push(m.main.initialize()),c&&(m.mini=f({app:e,model:t,translator:n,picasso:o,layoutService:s,config:{localeInfo:i,auto:em,key:Gd.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:r})}),h.push(m.mini.initialize())),Promise.all(h)},getMain:()=>m.main,getMini:()=>m.mini}}function nm({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:o,isDimensionless:i}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:o?`${t.data.label}, ${t.data.stack.label}`:i?void 0:t.data.label}function om({chart:e,actions:t,translator:n,rtl:o,viewState:i,viewModel:r,layoutService:a,dockService:s,colorService:l,themeService:u,trendLineModel:c,custom:d}){const{isTwoDimensional:m,isStacked:h,isGroupedByDimension:f,isGroupedByMeasure:g,isStackedByDimension:y,isStackedByMeasure:v}=a.meta,{fontFamily:b}=u.getStyles(),M=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:o,BAR_OOB_MAX:i,GROUP_AXIS:r}=Gd.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,u="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:c,collectedBounds:d})=>{const[m]=t,{triggerer:h}=l;if(h===o||h===i)return{key:m.key,bounds:m.bounds};if(u&&(h===n||h===r)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===o||e.key===i)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===o||e.key===i)&&e.data.value===m.data.value),r=e.findShapes("path").find(e=>s&&h===n?e.key===i&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:e.key===i&&e.data.value===m.data.value);if(t)return a?{key:r?r.key:Gd.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!u&&!c.some(e=>e.bounds.height+e.bounds.width!==0)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===o||e.key===i)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===o||e.key===i)&&e.data.value===m.data.value);if(t)return{key:t.key,bounds:t.bounds}}return!1},"collectible"]}({layoutService:a,dockService:s}),S=zd({majorInnerScale:Gd.SCALE.MAIN.MAJOR_INNER,tooltip:Gd.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:Gd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:i,trendLineModel:c,layoutService:a,rtl:o}),x=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);e.findShapes("container").filter(e=>e.key===Gd.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>v?e.data?.value===n.data.value:e.data?.stack.value===n.data.value).forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return p({chart:e,translator:n,config:{rtl:o,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:b},main:{key:Gd.COMPONENT.BASE_TOOLTIP_NEW,suppress:({event:e})=>S(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:Gd.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>g?t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Gd.COMPONENT.BAR_AXIS||t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:y?e.stack.value:e.value},{key:`${Gd.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX||t.triggerer===Gd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${Gd.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Gd.COMPONENT.BAR_OOB_MIN||t.triggerer===Gd.COMPONENT.BAR_OOB_MAX||t.triggerer===Gd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[Gd.COMPONENT.BAR],collect:{from:"single"},placement:M},{keys:[Gd.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>f?[e.value,e.group.value]:e.value,after:x},placement:M},{keys:[Gd.COMPONENT.BAR_OOB_MIN,Gd.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>g?[e.value,e.measureIndex.value]:f?[e.value,e.group.value]:e.value,after:x},placement:M},{keys:[Gd.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:M}],layout:{grouping:m,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:o,formatter:i,create:s,util:l})=>{const[u]=n,{title:c,description:m,measures:h}=d.isEnabled()?d.getAttributes({dataset:o,nodes:[u]}):{},f=[];c&&f.push(s.text({value:c,style:{bold:!0}})),m&&f.push(s.text({value:m}));const p=d.hideBasic();if(p&&!h.length&&(c||m)||f.push(s.text({value:nm({layoutService:a,node:u}),style:{bold:!0}})),!p){const t=void 0!==u.data.fill?.value?e.scale(Gd.SCALE.MAIN.COLOR)(u.data.fill.value):void 0;f.push(s.color({nodes:n,property:Gd.SCALE.MAIN.COLOR,fillColor:t})),f.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:o,util:i,node:r}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(Gd.FORMATTER.MINOR),{segment:a}=r.data,l=s&&t?t(a.value):a.label;return o.measure({label:i.dataset.title(r.data.source.key,e.fields.minor[s?0:r.data.measureIndex.value]),value:!0===r.data.null?.value||"NaN"===l?"-":l})}const{data:l}=r,{end:u}=l,{key:c,field:d}=u.source;return o.measure({label:i.dataset.title(c,d),value:u.label})}({viewModel:r,layoutService:a,formatter:i,create:s,util:l,node:e})))}h&&f.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),f.push(s.raw({value:d.chart.createLimitationRow()}))):f.push(s.raw({value:d.chart.createContainer({h:t})})));const{customTooltipImages:g}=u.data;return d.isEnabled()&&g&&f.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t})}))),f.filter(Boolean)},sections:({nodes:t,formatter:o,meta:i,create:r,sections:a})=>{if(!h||i.triggerer!==Gd.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===Gd.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const u=o(Gd.FORMATTER.MINOR),c=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:u?u(e):e}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:u?u(e):e}))}a.unshift(r.section({content:[r.text({value:l.data.label,style:{bold:!0}}),...c]}),r.divider())},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:Gd.COMPONENT.LEGEND_CAT_TOOLTIP,component:Gd.COMPONENT.LEGEND_COLOR_CAT}}}})}const im={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:o}=n[t];return o},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:o=0,qSelected:i=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+o+i:t}};function rm({layoutService:e}){return g({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const o=e.getLayout().qHyperCube.qDimensionInfo[1];return im.getDimensionSize(o)>Gr.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function am(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function sm(e){return e.some(am)}function lm(e,t){let n=NaN,o=NaN;return e.forEach(e=>{sm(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),o=Number.isNaN(o)?e.qNum:Math.max(e.qNum,o))})}),{min:n,max:o}}function um(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const o=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==o&&"minMax"!==o||(t=+e.getLayoutValue("measureAxis.min")),"max"!==o&&"minMax"!==o||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function cm(e,t){let n=NaN,o=NaN;return e.forEach(e=>{if(!sm(e)){let i=0,r=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?r+=e.qNum:i+=e.qNum)}),n=Number.isNaN(n)?i:Math.min(i,n),o=Number.isNaN(o)?r:Math.max(r,o)}}),{min:n,max:o}}function dm(e,t){const n={};e.forEach(e=>{if(!sm(e)){const o=e[0].qElemNumber;n[o]=n[o]?n[o]:{min:0,max:0,cId:o},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[o].max+=e.qNum:n[o].min+=e.qNum)})}});let o=NaN,i=NaN;return Object.keys(n).forEach(e=>{o=Number.isNaN(o)?n[e].min:Math.min(n[e].min,o),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)}),{min:o,max:i}}function mm(e){return"number"==typeof e&&!Number.isNaN(e)}function hm(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,mm(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,mm(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>mm(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>mm(e.qMax)).map(e=>e.qMax))}}const{isNumber:fm}=Ps;function pm(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function gm(e){return!Number.isNaN(+e.qNum)}function ym(e){return e.qNum}function vm(e){return!Number.isNaN(+e.qNum)}function bm(e){return e.qNum}function Mm(e,t){return e.push(...t),e}const{getValueWithOffset:Sm,isNumber:xm}=Ps,Cm=5,qm=.2;function Tm(e,t){return Math.abs(e/t)<Cm||0===t}function wm({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:o=cm,stackedByDimensionExtractor:i=dm,straightExtractor:r=lm,measureInfoExtractor:s=hm,explicitExtractor:l=um}=n,{meta:u}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:o,count:i}){let r,a;if(Array.isArray(n)?({min:r,max:a}=this.extractFromStacked(n)):({min:r,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();r=Number.isFinite(e)?Math.min(r,e):r,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(o),u=this.extractExplicit(),c=[0,r,a].filter(e=>xm(e));let d=Math.min(...c),m=Math.max(...c);d=Tm(s,d)?Math.min(d,s):d,m=Tm(l,m)?Math.max(m,l):m;const h=[u.explicitMin,u.explicitMax,d,m].filter(e=>xm(e));return r=Number.isNaN(u.explicitMin)?Math.min(...h):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...h):u.explicitMax,r===a&&(Number.isNaN(u.explicitMin)?r=Sm(r,-qm):Number.isNaN(u.explicitMax)&&(a=Sm(a,qm))),{min:r,max:a,implicitMin:d,implicitMax:m,otherMin:s,otherMax:l,hasOtherMin:s<r,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:o,isExplicitMax:i}=l(e);return{hasExplicitMinMax:o||i,hasExplicitMin:o,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.filter(e=>fm(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...n[0].qSubNodes.filter(e=>fm(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0};var n},extractFromStraight(t,n){const a=t.length?t[0].qMatrix:[];return u.isStackedByMeasure?o(a,n):u.isStackedByDimension?i(a,n):e.getHyperCubeValue("qHasOtherValues")?r(a,n):s(e)},extractOthers:e=>u.isStackedByDimension?function(e){const t=pm(a(e,"0.qData.0.qSubNodes",[]),am,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):u.isGroupedByDimension?function(e){const t=a(e,"0.qMatrix",[]).filter(sm).reduce(Mm,[]).filter(vm).map(bm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=pm(a(e,"0.qMatrix",[]),sm,[]).filter(gm).map(ym);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function km(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:o,getHyperCubeValue:i}=t,r=e=>!e.length&&o.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!o.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(o.isContinuous){const e=o.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const u=o.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(r(e))return a(l);let t=[];return l&&(t=o.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}})}}}(e),n=wm(e);return t.resolve().then(e=>n.extract(e))}const Nm="lasso",Lm=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:o},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:o,options:{event:Nm,enable(e,n){if(this.started===Nm||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==Nm&&(i.actions.select.emit("start",Nm),this.chart.component(e).emit("lassoStart",t),this.started=Nm)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",Nm),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const Dm=({targets:e,requireFailure:t,recognizeWith:n,components:o,eventName:i="tap"},r)=>{let a;const s=r.customTooltipModel?r.customTooltipModel.utils:void 0,l=s?r.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!r.actions.select.enabled()&&!r.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let o,i;return e.center?(({x:o}=e.center),({y:i}=e.center)):(o=e.clientX,i=e.clientY),{x:o-n.left,y:i-n.top}}(t,this.chart),u=r.hitRadius?r.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=r.shapesAt?r.shapesAt(c):this.chart.shapesAt(c,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),m=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&m&&m.show;if(!r.isLocked(a)&&!r.tooltipOnly&&r.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1,r.actions.select.emit("start",i,e)),d.length&&o){this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof o?o(t,d):o;this.chart.brushFromShapes(d,{components:e}),r.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:r.largeDataService,chart:this.chart})}}if(m&&r.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=r;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:r,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else h&&m.emit("hide")}}}};const Om=({key:e,requireFailure:t,recognizeWith:n,eventName:o="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${o}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${o}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const Em=({eventName:e,key:t,fillTargets:n=[],requireFailure:o,recognizeWith:i},r,a)=>({key:`event:${t}`,type:"Pan",requireFailure:o,recognizeWith:i,options:{event:e,enable(o,i){if(this.started===e||!i)return!0;if(!r.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),r.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof r.updateOnMove&&r.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),r.actions.select.emit("end",e),this.started=!1,"function"==typeof r.updateOnEnd&&r.updateOnEnd()}}});function Am(e,t){const n=function(e){const{key:t,targets:n,fillTargets:o,targetSelector:i,targetFillSelector:r,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:n.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:o,selector:i,fillSelector:r,fill:"rgba(82,204,82,0.2)"}}}}(e),o=Em(e,t,"range");return{interactions:[e.onEdited?Om(e,t):null,o].filter(Boolean),components:[n]}}const Im={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},Pm="inner-time-axis",Rm="outer-time-axis";const zm={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const o=t?0:e.qDimensionInfo.length-1;n=im.getMaxGlyphCount(e,o)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?a(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=zm.getAxisData(e,t),o=!e.qDimensionInfo.length,i=o||t?void 0:e.qDimensionInfo.length-1,r=zm.getMajorAxisMaxGlyphCount(e,t),a=o?"qFallbackTitle":"qText";return la.getAdjustedMaxGlyphCount(r,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=zm.getAxisData(e),n=im.getMaxGlyphCount(e,0);return la.getAdjustedMaxGlyphCount(n,t,0)}};var Bm=3,Fm=13;function Hm(e,t,n,o){const{meta:i}=t.layoutService,r=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?r.push(...function(e,t,n,o){const{meta:i}=t.layoutService,{axis:r,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,m=Im[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:Im.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:ql.lines.trackBy,compensateForLayoutChanges:ql.lines.compensateForLayoutChanges}},f=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",o=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:r.line.major.color},minorGuideLine:{stroke:r.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:o},guideLine:{major:{justify:o},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:ql.axes.trackBy({isTime:!0}),compensateForLayoutChanges:ql.axes.compensateForLayoutChanges({isTime:!0})}};c.push(le(!0,{},d,{key:Pm,scale:Gd.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:le(!0,{},a,{line:{stroke:r.line.major.color},majorGuideLine:{stroke:r.line.minor.color},minorGuideLine:{stroke:r.line.major.color}})})),c.push(le(!0,{},d,{key:Rm,scale:Gd.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:Gd.SCALE.MAIN.MAJOR,layout:{dock:`@${Rm}`,minimumLayoutMode:m}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Gd.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Pm}`,minimumLayoutMode:m}}),c.push(f)}return c.push(le(!0,{},h,{key:"inner-time-grid",x:{scale:Gd.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(le(!0,{},h,{key:"outer-time-grid",x:{scale:Gd.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,renderer:Il(t.flags),scale:Gd.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:r.line.major.color},line:{show:!o},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:ql.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:ql.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Gd.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:m}}),c.push(f)),c.push(le(!0,{},h,{key:"continuous-grid",x:{scale:Gd.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,o)):r.push(...function(e,t,n,o){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,r=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,m=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:Il(t.flags),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:Im[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...m},line:{show:!o,stroke:r.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:ql.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:ql.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(le(!0,{},h,{key:"group-axis",scale:Gd.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:zm.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&h.settings.line.show}}}));const f=zm.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(le(!0,{},h,{key:Gd.COMPONENT.BAR_AXIS,scale:Gd.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:f,maxLengthPx:d,tiltThreshold:f>Bm&&f<Fm?1:void 0},line:{show:!(u&&l)&&h.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,o));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&r.push({type:"axis",key:"y-axis",renderer:Il(t.flags),formatter:Gd.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:Im.measureAxis.minimumLayoutMode},scale:Gd.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:ql.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:ql.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),r}var jm={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function _m({layoutService:e,discrete:t}){const{isContinuous:n,isGrouped:o}=e.meta;if(n)return 1;const i=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(i?.style?.width){const{style:e}=i;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=jm.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),o=e.width+n;return o>1?e.width-(o-1):e.width}:e.width}return o?.9:.7}const Vm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Um(e,t,n={}){return({data:o})=>{const i=e.chart.component(t).rect;if(!o.items.length||!i)return 2;const{min:r,max:a}=e.viewState.get("zoom");if(n[[r,a]])return n[[r,a]];const s=Vm[Ur.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-r),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=Math.min(l/u/.2,1),d=2*(1-(m=1-c))+s*m;var m;return n[[r,a]]=Math.max(2,Math.min(s,d)),n[[r,a]]}}function $m(e,t){const{hasExplicitMax:n,explicitMax:o}=t;return!!n&&e>o&&o<=0}function Wm(e,t){const{hasExplicitMin:n,explicitMin:o}=t;return!!n&&e<o&&o>=0}function Km(e,t){const{hasExplicitMax:n,explicitMax:o}=t;return!!n&&e>o&&o>0}function Gm(e,t){const{hasExplicitMin:n,explicitMin:o}=t;return!!n&&e<o&&o<0}const Ym="max",Xm="min",Jm={min:"Min",max:"Max"};function Zm(e,t,n){return void 0===n?$m(e,t)||Wm(e,t):n===Ym?$m(e,t):Wm(e,t)}function Qm({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${Jm[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===Ym?e.implicitMax:e.implicitMin;return!Zm(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function eh(e,{barComponent:t,type:n,isStacked:o}){const{viewCache:i,dockService:r,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===Ym?s.implicitMax:s.implicitMin;if(!Zm(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===Ym?r.meta.minor.end:r.meta.minor.start;let d="end";o&&(d=n===Ym?"sumOfPositives":"sumOfNegatives");const m=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:ia.getDockValue(c),oob:le({},t.settings.box,{fill:m.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!o||0!==e.datum[d].value)&&Zm(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:ql.barOobs.compensateForLayoutChanges}}}function th(e){return Math.min(Math.max(0,e),1)}const nh=(e,{chart:t,type:n,componentKey:o,collectionKey:i})=>{const{layoutService:r,dockService:a,viewCache:s}=e,{isStacked:l}=r.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!Qm({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${Gd.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:Gd.SCALE.MAIN.MAJOR,fn:d},minor:{scale:Gd.SCALE.MAIN.MINOR,start:e=>th(t.scale(Gd.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const o=t.scale(Gd.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[i]?e.datum[i].value:o[n]();return th(o(r))}},box:{width:_m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const o=t.scale(Gd.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[i]?e.datum[i].value:o.max();return"max"===n?r>o.max():r<o.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function oh(e,t){const{style:n,styleService:o,dockService:i}=t,r=o.label.getStyle(),a=r.useContrastColor&&!e.onBackground?function(e){return function(t){return fs.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):r.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function ih(e){return{placements:e.simplifiedPlacements.map(t=>oh(t,e)),label:e.label}}function rh(e,t){if(t){if(function(e,t){return $m(e,t)}(e,t))return-1;if(function(e,t){return Wm(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function ah(e,t,n,o){const i=rh(e,o);let r="up";return"vertical"===t&&i<0?r="down":"horizontal"===t&&(r=i>=0&&!n||i<0&&n?"right":"left"),r}function sh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:o,isContinuous:i}=t.layoutService.meta;return!o||!i&&!!n.showSegmentLabels}function lh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:o,isContinuous:i}=t.layoutService.meta;return!!o&&(!!i||!1!==n.showTotalLabels)}function uh(e,t,n,o){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:o}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function ch({layout:e,component:t,minorScale:n},o,i){if(!sh(e,o))return!1;const{viewModel:r,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=o,{meta:d}=l,m=s.get("minorMinMax"),h=c.getStyles(),f=o.styleService.label.getStyle();let p;!d.isStacked&&(p=d.isStacked?1:0);const g=0===p?1:0,y=d.isStacked?.5:1,v=r.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let M,S=-1;M=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>S?b(e.data.segment.value):""}:function(e){return e.data.end.label};const x={label:M,simplifiedPlacements:uh(p,g,y,d.isContinuous),style:h.label.value},C=[ih(le(o,x))],q=[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ah(e.data.end.value,u.meta.minor.orientation,i,m),labels:C,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily,linkData:ql.labels.linkData}}}],T={key:"bar-labels",type:"labels",renderer:Il(o.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:q},animations:{enabled:o.viewModel.animations.enabled,trackBy:ql.labels.trackBy,compensateForLayoutChanges:ql.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(T.beforeRender=()=>{S=function(e,t,n){const o="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),r=i&&i.rect?i.rect[o]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/r}(t,o,n)}),T}const dh={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let o;return t.isStackedByDimension?o=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(o=n.group?n.group.label:void 0),void 0!==o?`${n.label}, ${o}`:n.label},getMeasure(e,t,n,o,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const r=t.data,a=n.isStacked?o.viewModel.fields.minor[n.isStackedByDimension?0:r.measureIndex.value]:void 0,s=n.isStacked?{source:{key:r.source.key,field:a},label:!0===r.null?.value?"":n.isStackedByDimension&&i?i(r.segment.value):r.segment.label}:r.end;return ga.getMeasure(e,s)},getMeasures(e,t,n,o,i){const r=e.resources.dataset;return t.map(e=>dh.getMeasure(r,e,n,o,i)).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const o=e.resources.dataset;return vc({nodes:t,layout:n.layoutService.getLayout(),dataset:o})},extractBarTooltipData(e,t,n,o,i){const r={title:dh.getTitle(t,n),color:ga.getColor(e,t,o),measures:dh.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,o,i)};if(dh.useCustomTooltip(o)){const n=dh.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],o);r.customMeasures=n.customTooltipAttrExpsArr,r.customTitle=n.customTooltipInfoAttrExpsArr.filter(e=>e.id===ec.CUSTOM.TITLE),r.customDescription=n.customTooltipInfoAttrExpsArr.filter(e=>e.id===ec.CUSTOM.DESCRIPTION);let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach(e=>{e.data.customTooltipImages?.length>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)}),i.length>0&&(r.customImages=i);const a=o.layoutService.getLayout();if(a.tooltip?.chart?.object?.refId&&o.app&&o.customTooltipModel.embed&&"function"==typeof o.customTooltipModel.model?.getEffectiveProperties)if(o.app.isInModalSelection?.()){if(a?.qHyperCube?.qDimensionInfo?.length>0){uc.destroyVisualization({customTooltipModel:o.customTooltipModel});const e=o.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");r.customLimitation=e}}else{const t=uc.createContainer({ctx:e,layout:a});r.customChart=t}}return r},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData:(e,t,n)=>({title:e.data.label,measures:[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter(e=>0!==e).map(e=>({label:`${dh.getTotalStackTitle(e,t)}`,value:n?n(e):e}))}),extractTooltipData(e,t){const n=t.chart.formatter(Gd.FORMATTER.MINOR),{meta:o}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],r=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map(e=>dh.extractStackTotalBarTooltipData(e,t.translator,n)):[];return{barTooltipData:i.map(i=>dh.extractBarTooltipData(e,i,o,t,n)),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:r}},extractBarNodeData(e,t,n,o,i,r,a){let s=!i&&ga.getTitleRow(t,o);const l=ga.hideColorRow(t,n),u=!r&&!l&&ga.getColorRow(e,t,o),c=t.measures.map(i=>!a&&ga.getMeasureRow(i,e,t,o,l&&i.field===n.coloring.field)).filter(e=>!dh.isSameMeasureAndColorRow(e,u,o));if(dh.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map(n=>ga.getMeasureRow(n,e,t,o,!1)),r=!(!t.customTitle[0]||i)&&ga.getTitleRow(t.customTitle[0],o),a=!(!t.customDescription[0]||i)&&ga.getDescriptionRow(t.customDescription[0],o);s=!dh.shouldIgnoreTitleRowForCtt(r,a,c,n)&&s;const l=[r,a,s,u,...c,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(hc.getFooterRow(t.customLimitation,o)),t.customImages){const n=t.customImages.map(t=>hc.getImageRow(t,e));l.push(...n)}return l.filter(Boolean)}return[s,u,...c].filter(Boolean)},extractStackTotalBarNodeData:(e,t,n)=>[!!t.measures.length&&ga.getTitleRow(t,n),...t.measures.map(o=>ga.getMeasureRow(o,e,t,n,!1))].filter(Boolean),useCustomTooltip:e=>a(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,o)=>!1===n[0]&&0===o.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some(e=>e.field===n.coloring.field),shouldIgnoreDefaultRows:(e,t)=>dh.useCustomTooltip(t)&&a(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,o){const{meta:i}=t.layoutService,r=t.layoutService.getLayout(),a=o.length;let s,l,u=[];const c=dh.shouldIgnoreDefaultRows(r,t);for(s=0;s<a;s++){l=o[s];const r=dh.shouldIgnoreTitleRow(i,s),d=c||dh.shouldIgnoreColorRow(i,s),m=c||dh.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(dh.extractBarNodeData(e,l,t,n,r,d,m)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let o=[];return n.some(e=>e.measures.length)&&n.forEach(n=>{o=o.concat(dh.extractStackTotalBarNodeData(e,n,t))}),o},extractData(e,t,n){const{barTooltipData:o,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:r}=dh.extractTooltipData(e,t),a=dh.extractStackTotalBarsData(e,n,r);a.length&&a.push(ga.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=dh.extractBarsData(e,t,n,o),u=a.concat(s),c=i+l;return c&&u.push(ga.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter(e=>{const t=e.bounds;return t.width>0&&t.height>0}),n=t.length?t:e;return Ol.combineBounds(n.map(e=>e.bounds))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:o,data:i,groupProp:r}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,m;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===o&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,m=n===o&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[r]?i[r].value:void 0,d=u(n===o&&void 0!==c?[c,e]:e),m=n===o&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const h=(d+m/2)*a[l],f={width:0,height:0};return"horizontal"===s?(f.x=h,f.y=a.height):(f.y=h,f.x=0),f},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:o,barAxisKey:i,majorScale:r,majorInnerScale:a,groupProp:s}){const l=n.filter(e=>e.children&&e.children.length);let u;return u=l.length?dh.calculateBoundsFromBars(l):dh.calculateBoundsFromScale({opts:e,barKey:o,scale:t[0].key===i?r:a,majorScale:r,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter(e=>e.data&&t.indexOf(e.key)>-1),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels(e,t,n,o){const i=e.filter(e=>t.some(t=>n(e,t,o)));return i},findBarsFromGroupLabelsInGroupedByDim(e,t,n){const o=dh.isBarMatchingLabelOnProp;return dh.findBarsMatchingLabels(e,t,o,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter(e=>t.some(t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)),findBarsFromLabelsInSingleDim(e,t){const n=dh.isBarMatchingLabel;return dh.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,o){const i=t.filter(e=>e.key===n),r=t.filter(e=>e.key!==n),a=dh.findBarsFromBarLabelsInGroupedByDim(e,i,o),s=dh.findBarsFromGroupLabelsInGroupedByDim(e,r,o);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=dh.isBarMatchingLabel;return dh.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=dh.isBarMatchingLabel;return dh.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const o=dh.isBarMatchingLabelOnProp;return dh.findBarsMatchingLabels(e,t,o,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>dh.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:o,groupProp:i,stackProp:r}){const{meta:a}=t.layoutService,s=dh.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?dh.findBarsFromLabelsInStackedByDim(s,e,r):a.isStackedByMeasure?dh.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?dh.findBarsFromLabelsInGroupedByDim(s,e,o,i):dh.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:o}=t.layoutService;if(o.isStacked){const i=dh.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return o.isStackedByDimension?dh.findStackTotalBarsFromLabelsInStackedByDim(i,e):dh.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:m}=t.layoutService;if(e.length){let h=dh.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(h=h.filter(d)),dh.isSingleBarMode(m,h))return[h[0]];if(h.length){let m=dh.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,r,a],stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l});d&&(m=m.filter(d));const f=dh.calculateTotalBounds({opts:t,labels:e,bars:m,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),p=dh.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:o});return[{key:n,bounds:f,childrenNodes:h,data:h.map(e=>e.data),stackTotalBarNodes:p}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,groupAxisKey:r,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let m=dh.filterNodesOnKeys(e,[i,r]),h=m&&m.length?[m[0]]:[];const f=dh.filterNodesOnLabels({labels:h,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(f&&f.length)return f;const{meta:p}=t.layoutService;if(p.isStackedByMeasure){m=dh.filterNodesOnKeys(e,[a,s]),h=m&&m.length?[m[0]]:[];const r=e=>dh.filterNodesForOob(e,n,a),f=dh.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:r});if(f&&f.length)return f[0].stackTotalBarNodes=void 0,f}if(p.isStackedByDimension){m=dh.filterNodesOnKeys(e,[a,s]),h=m&&m.length?[m[0]]:[];const r=e=>dh.filterNodesForOob(e,n,a),f=dh.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:r});if(f&&f.length)return f[0].stackTotalBarNodes=void 0,f}const g=dh.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function mh(e,t={},n){let o=[];const i=da({key:Gd.COMPONENT.BASE_TOOLTIP,rtl:n});return le(!0,i,{scale:Gd.SCALE.MAIN.COLOR,settings:{filter:e=>dh.filterNodes({nodes:e,opts:t,barKey:Gd.COMPONENT.BAR,stackTotalBarKey:Gd.COMPONENT.STACK_TOTAL_BAR,barAxisKey:Gd.COMPONENT.BAR_AXIS,groupAxisKey:Gd.COMPONENT.GROUP_AXIS,barOobMaxKey:Gd.COMPONENT.BAR_OOB_MAX,barOobMinKey:Gd.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(o=e.node.childrenNodes?e.node.childrenNodes:[e.node],dh.extractData(e,t,n)),placement:"bounds",afterShow:()=>{const{app:e,properties:i,customTooltipModel:r}=t;e&&!e.isInModalSelection?.()&&r.useCustomTooltip&&r.embed&&uc.show({app:e,properties:i,selectedNodes:o,customTooltipModel:r,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const hh={extractData:(e,t)=>[ga.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter(e=>e.data&&e.key===t);return n.length?[n[0]]:[]}};function fh(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const o=da({key:Gd.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return le(!0,o,{scale:Gd.SCALE.MAIN.COLOR,settings:{filter:e=>hh.filterNodes(e,Gd.COMPONENT.LEGEND_COLOR_CAT),extract:e=>hh.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function ph(e,{fill:t}){return{[Gd.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[Gd.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const gh=1,yh=3;function vh(e){return e.getLayoutValue("gridLine.auto")}function bh(e){return!vh(e)&&e.getLayoutValue("gridLine.spacing")===gh}function Mh(e){return!vh(e)&&e.getLayoutValue("gridLine.spacing")===yh}const Sh=e=>({enabled:e.animations.enabled,trackBy:ql.lines.trackBy,compensateForLayoutChanges:ql.lines.compensateForLayoutChanges}),xh=(e,{themeService:t,layoutService:n,dockService:o,viewModel:i})=>{if(!vh(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:r}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:Im.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!bh(n)||((e,t)=>t%2==0),stroke:r.line.major.color},minorTicks:{show:Mh(n),stroke:r.line.minor.color},animations:Sh(i)};return a["horizontal"===o.meta.major.orientation?"y":"x"]=Gd.SCALE.MAIN.MINOR,a};function Ch(e,t){const n=[xh(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:o})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const r=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:Gd.SCALE.MAIN.MINOR,line:{stroke:r.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:Gd.SCALE.MAIN.MINOR,lines:a,animations:Sh(o)}})(t)),n}const qh="areaPan",Th=e=>({type:"Pan",key:"panorama",options:{event:qh,pointers:1,threshold:10,enable(t,n){return this.started===qh||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Gd.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=qh;const n=e.viewState.get("zoom");this[qh]={min:n.min,max:n.max,size:e.chart.component(Gd.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:o,max:i,size:r}=this[qh],a=-t.deltaX/r;e.viewState.set("zoom",{min:Math.min(o+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function wh(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:o,chart:i}=e,{rtl:r}=t,a=jr.event.onZoom({viewCache:n,viewState:o,chart:i},{threshold:100,rtl:r,targetKey:Gd.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Gd.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function kh({chart:e},t,n){const o=e.component(Gd.COMPONENT.BASE_TOOLTIP);o&&o.show&&(o.emit("hide"),n?.customTooltipModel?.useCustomTooltip&&t&&t({},o,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const i=e.component(Gd.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&i.emit("hide");const r=e.component(Gd.COMPONENT.TREND_LINES_TOOLTIP);r&&r.show&&r.emit("hide")}function Nh(e,t){const{viewCache:n,viewState:o,chart:i,trendLineModel:r,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?jr.event.onZoom({viewCache:n,viewState:o,chart:i},{rtl:s,threshold:50,targetKey:Gd.COMPONENT.BAR}):void 0,u=zd({majorInnerScale:Gd.SCALE.MAIN.MAJOR_INNER,tooltip:Gd.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:Gd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:o,trendLineModel:r,layoutService:a,rtl:s}),c=[Gd.COMPONENT.BAR,Gd.COMPONENT.BAR_AXIS,Gd.COMPONENT.GROUP_AXIS,Gd.COMPONENT.BAR_OOB_MAX,Gd.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,m=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,o=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===Gd.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),o=!0)}!o&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===Gd.COMPONENT.LEGEND_COLOR_CAT),n&&(o=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),o&&t.preventDefault(),kh(e,m,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),o=this.chart.component(Gd.COMPONENT.BASE_TOOLTIP);if(o&&o.show)if(n.some(e=>c.indexOf(e.key)>-1)){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);m(t,o,{nodes:i,opts:e,customTooltipModel:n})}else o.emit("show",t)}else o.emit("hide");const i=this.chart.component(Gd.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some(e=>e.key===Gd.COMPONENT.LEGEND_COLOR_CAT)?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&kh(this,m,e)},mouseleave(){kh(this,m,e)}}}}const Lh=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...bu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Th(e),wh(e,t)]]});function Dh(e,t){const n=[Lh(e,t),Nh(e,t),bu({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&n.push(e.discrete.interactions.native),n}function Oh(e,t){const{viewCache:n,viewState:o,chart:i}=e,{rtl:r}=t,a=e.layoutService.meta.isContinuous?jr.event.onZoom({viewCache:n,viewState:o,chart:i},{rtl:r,threshold:50,targetKey:Gd.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,o=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===Gd.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(i,Math.sign(-t.deltaY)),o=!0)}!o&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===Gd.COMPONENT.LEGEND_COLOR_CAT),n&&(o=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),o&&t.preventDefault()}}}}const Eh=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...bu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Th(e),wh(e,t)]]});function Ah(e,t){const n=e.tooltipService.getInteractions(),o=[Eh(e,t,n),Oh(e,t),bu({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&o.push(e.discrete.interactions.native),o}const Ih=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:ql.bars.compensateForLayoutChanges});const Ph=(e,t,{collectionKey:n})=>{if(!au({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:o,viewModel:i},{collectionKey:r}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>o.getDimensionCardinality()>1,data:{collection:r},settings:{box:le(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:le(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ih(i)}}(e,t,{collectionKey:n});const{mode:o,scales:i}=t.reducedDataModel;let r;return o.isGroupedByDimension&&!o.isReduced?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:o.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:o.isReduced||o.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:r},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ih(t.viewModel)}},{measureText:Rh}=t.renderer("svg")();function zh(e,t,n){const o=function(e){const t=le(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:o,align:i,getProp:r}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:o,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=le(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=le(!0,{},t,{min:()=>r("continuousMin"),max:()=>r("continuousMax")})),a}(e,t.major,n);return{reducedMinor:o,reducedMajor:i}}const Bh=50,Fh=100,Hh=200;function jh(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Bh;case 1:return Fh;case 2:return Hh;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function _h(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function Vh(e,t,n){return 0===t||0===e||t===n.length-1}function Uh(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function $h(e,t,n,o,i){e.domain([t,n]),e.nice(10);const[r,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,o=e.length-t;return e.slice(n,o).some(e=>0===e)}(s),c=u?Vh:_h;s=s.filter(c),l&&!u&&!o&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(Gd.FORMATTER.MINOR):void 0;return Uh(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:r,roundedMax:a,ticks:s}}function Wh(e,t,n,o,i,r,a,s){const l=r.formatter(Gd.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Rh({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[m,h]=e.domain(),f=e.ticks(o);function p(){const e=f.map(l);return!Uh(e)&&function(e){const t=i/f.length;return Math.max(...e.map(d))<=t}(e)}for(let i=o-1;i>0&&!p();i--)e.domain([t,n]),e.nice(i),[m,h]=e.domain(),f=e.ticks(i);return{roundedMin:m,roundedMax:h,ticks:f}}const Kh=(e,t)=>e.value-t.value,Gh=e=>({value:e,isMinor:!1}),Yh=e=>({value:e,isMinor:!0});function Xh(e,t,n){const o=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=o}function Jh({chart:e,viewCache:t,dockService:n,layoutService:o,themeService:i,viewModel:r,ds:a}){const{isButterfly:s}=o.meta,{explicitMin:l,explicitMax:u,hasExplicitMin:c,hasExplicitMax:d}=t.get("minorMinMax"),{min:h,max:f}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(h),Math.abs(f)):f,g=s?-p:h,y=m(()=>{const s=function(e,t,n){let o;return e?o=n.meta.chart.size:({rect:o}=t.component(Gd.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?o.height:o.width}(t.get("isPreRender"),e,n),m=jh(s,o),h=function(e,t,n){const o=Mn().domain([e,t]);return o.nice(n),o}(g,p,m);let f,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:f,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(g,p)):(({roundedMin:f,roundedMax:y,ticks:v}=Wh(h,g,p,m,s,e,n,i)),Xh(v,l,u)&&({roundedMin:f,roundedMax:y,ticks:v}=$h(h,g,p,c||d,e)));const b=function(e,t){const n=[];for(let o=0;o<e.length-1;o++){const i=e[o],r=(e[o+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+r*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(c,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,u,v);let M=function(e,t){return[...e.map(Gh),...t.map(Yh)].sort(Kh)}(v,b);if(o.meta.isButterfly){const e=r.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(M=M.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:f,roundedMax:y,ticks:M}},()=>t.get("isPreRender"));return{values:()=>y().ticks,min:()=>c?l:y().roundedMin,max:()=>d?u:y().roundedMax}}function Zh(e,{picasso:t,discrete:n,layoutService:o,dockService:i,viewModel:r,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d,ds:m},{localeInfo:h,rtl:f}){const{meta:p}=o,{fields:g}=r,y=()=>{if("custom"!==o.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},v=!("none"===o.getLayoutValue("measureAxis.show"))?(b=i.meta.minor.orientation,M=i.meta.minor.dock,"vertical"===b?"near"===M||"left"===M?0:1:"near"===M||"bottom"===M?1:0):.5;var b,M;const S={},x="vertical"===i.meta.minor.orientation&&f,C=l.getMain().getScales(),q=l.getMini().getScales();if(Object.assign(S,C,{reducedFill:q.reducedFill}),S[Gd.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:o,viewModel:i,layoutService:r,themeService:a,ds:s},{rtl:l}){const u=Jh({chart:e,dockService:n,viewCache:o,layoutService:r,themeService:a,viewModel:i,ds:s}),c={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:u.values},minorTicks:{count:1},min:u.min,max:u.max};return r.meta.isStacked||(c.data={source:"qHyperCube",fields:t.minor}),c}({chart:d,viewModel:r,dockService:i,viewCache:a,layoutService:o,themeService:u,ds:m},{rtl:f}),p.isGroupedByDimension)[Gd.SCALE.MAIN.MAJOR_INNER,Gd.SCALE.MAIN.MAJOR].forEach((e,t)=>{S[e]={invert:x,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...r.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),r.isDimensionLocked(0)||(S[Gd.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)S[Gd.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:x,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:o,viewCache:i,picasso:r,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=r.formatter("q-time"),d=l.getStyles(),m=e=>Rh({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),o=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),r=u().map(e=>e.qName);return[e,Number.parseFloat(o).toFixed(12),...r].toString()}};return{innerTime:{data:{field:o.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:o.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:o.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:o.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:c,viewModel:r,viewCache:a,themeService:u,layoutService:o},f);S[Gd.SCALE.MAIN.MAJOR_INNER]=e,S[Gd.SCALE.MAIN.MAJOR]=n}else p.isContinuous?S[Gd.SCALE.MAIN.MAJOR]={type:"linear",invert:x,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:S[Gd.SCALE.MAIN.MAJOR]={invert:x,data:{extract:p.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:T,reducedMajor:w}=zh(s,{major:S[Gd.SCALE.MAIN.MAJOR],minor:S[Gd.SCALE.MAIN.MINOR]},{majorScaleInvert:x,maxPxStep:y,align:v,getProp:a.get});return p.isDiscrete&&(S[Gd.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(S[Gd.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),S[s.scales.major]=w,S[s.scales.minor]=T,S}function Qh(e,t,n){const{layoutService:o,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[Dm(e,t)],components:[]}}({targets:[o.meta.isStackedByDimension&&o.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?Gd.COMPONENT.STACK_TOTAL_BAR:Gd.COMPONENT.BAR,Gd.COMPONENT.BAR_AXIS,Gd.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",Gd.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const o={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return Gd.COMPONENT.BAR===t[0].key?[{...o,data:["selectionDimension"]}]:[Gd.COMPONENT.BAR_AXIS,Gd.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...o,data:["selectionDimension","axisSelectionDimension"]}]:[o]}},{...e,isLocked:n=>n.some(e=>e.key===Gd.COMPONENT.LEGEND_COLOR_CAT)?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function ef(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},o=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[Lm(n,t)],components:[o]}}({key:"lasso",componentTargetKey:Gd.COMPONENT.BAR,components:[t?{key:Gd.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:Gd.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function tf(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:o,fillTargets:i,dock:r}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:o},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[Em(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:Gd.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",Gd.COMPONENT.BAR_AXIS,Gd.COMPONENT.BAR],fillTargets:["group-axis",Gd.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function nf(e,t,n){const{selectionService:o}=e,{isUnsupportedFeature:i}=t,r=void 0===n,a=o.getIsSingleSelect(n),s=Qh(e,r,a);if(r||a)return{components:[...s.components],gestures:[...s.interactions]};const l=ef(e),u=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:Am({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",Gd.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:Gd.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?Am({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",Gd.COMPONENT.BAR]:["continuous-axis",Gd.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?Gd.SCALE.MAIN.MAJOR_INNER:Gd.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:o}){const i=e.layoutService.meta.isTime?o.formatter():e.chart.formatter(Gd.FORMATTER.MINOR),r=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||r?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=tf(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}const{isNumber:of}=Ps;function rf({layoutService:e,viewModel:t,dockService:n}){const{meta:o}=e;if(!o.isStackedByDimension||o.isContinuous)return!1;const{fields:i}=t,r=e.getLayoutValue("components",null),a=r?r.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>of(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>of(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>of(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>of(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:Gd.SCALE.MAIN.MAJOR},minor:{scale:Gd.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:ql.shadowBars.trackBy,compensateForLayoutChanges:ql.bars.compensateForLayoutChanges}}}const af={min:"Min",max:"Max"};function sf(e,t,n){const o=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?Km(e,t)||Gm(e,t):n===Ym?Km(e,t):Gm(e,t)}(Number(o.toFixed(13)),e,t)}function lf(e,{barComponent:t,type:n,isStacked:o}){const{viewCache:i,layoutService:r,dockService:a}=e,s=i.get("minorMinMax"),l=n===Ym;if(function(e,t){return!e[`hasOther${af[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${af[t]}`]}(s,n))return!1;if(sf(s,n,l))return!1}if(function(e,t,n){const o=n?e=>e<0:e=>e>0;return e[`hasExplicit${af[t]}`]&&o(e[`explicit${af[t]}`])}(s,n,l))return!1;let u="end";o&&(u=l?"sumOfPositives":"sumOfNegatives");const c=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(Gd.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[u].value>c():e=>e.datum[u].value<c(),m=Gd.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),f=h?h.filter(e=>e.key===m)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:le({},t.settings.box,{fill:r.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:_m({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:f?.style?.strokeWidth?jm.BAR.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:jm.BAR.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??jm.BAR.STROKE.COLOR})}}}function uf(e,{collectionKey:t},n){const{meta:o}=e.layoutService,{fields:i}=e.viewModel,r=o.isStackedByDimension&&!o.isContinuous?"qValue":"qNum";function a(t,n){const i=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=Jr.shouldUseFormat(i),l=o.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>{return"NaN"===e[r]?0:(t=e[r],l&&0!==t?-t:t);var t},label:e=>s?(e=>"NaN"===e[r]?"-":a(e[r]))(e):e.qText}}function s(e){if(!o.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[r]<0}}const l=o.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map((t,r)=>{const u=e.colorService.getMain().getDatumProps(r),c=e.colorService.getMini().getDatumProps(r),d=u[Object.keys(u)[0]],m=d?.field,h=m?{field:m,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,f={field:o.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,r),negative:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:o.isStacked?a(t):void 0,group:o.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:o.isStacked?{field:i.majorStack}:void 0,measureIndex:o.isGroupedByDimension||o.isStackedByDimension?void 0:r,timeStart:o.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:o.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:h,...u,...c,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${r}`},customTooltipAttrExps:0!==o.dimensionCount?gc.getNode(e.layoutService.getLayout(),o):void 0}};var p;return o.isDimensionless&&(f.value=r),void 0!==n&&(f.source=n),Jr.deleteUndefinedProperties(f.props),f}),filter:o.isButterfly?e=>!e.negative.value:void 0}};return o.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:cf}=Ps;function df({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:o}=e,{fields:i}=t;if(!o.isStacked)return!1;let r;return r=o.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(o,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>cf(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>cf(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(o,i),{key:n,data:{extract:r}}}const mf="main-collection",hf="stack-total-collection";function ff(e,{collectionKey:t}){const{layoutService:n,colorService:o,reducedDataModel:{fields:i,mode:r}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>{return"NaN"===e[s]?0:(t=e[s],n&&0!==t?-t:t);var t}}}function u(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:i.minor.map((e,t)=>{const n=r.isReduced?{}:o.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:u(e),group:{field:i.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:r.isDimensionless?e:i.major,props:a};return r.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const pf="mini-collection",gf="mini-stack-collection",yf="mini-continuous-collection",vf="miniCube",bf=(e,t)=>{const n=(e=>{const t=[uf(e,{collectionKey:mf})];return e.layoutService.meta.isStacked&&t.push(df(e,{collectionKey:hf})),t})(t),o=((e,t)=>{const n=[];return au({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(uf(t,{collectionKey:yf},vf)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:o,mode:i}}=e;return{key:t,data:{extract:o.minor.map((e,t)=>{const r={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(r.timeStart={field:o.major,value:e=>e.qNum},r.timeEnd=r.timeStart),{source:"miniCube",field:o.major,props:r}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:gf})):n.push(ff(t,{collectionKey:pf}))),n})(0,t);return n.concat(o)};function Mf(e,t,n,o){const i=[{position:e,onBackground:!0,justify:0,overflow:o}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function Sf({layout:e,component:t},n,o){if(!lh(e,n))return!1;const{layoutService:i,chart:r,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!sh(e,n),m=l.getStyles(),h=u.label.getStyle(),f=h.useContrastColor;function p(e){const t=r.formatter(Gd.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:Mf("outside",d,f,c.isContinuous),style:m.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:Mf("opposite",d,f,c.isContinuous),style:m.label.value},v=[ih(le(n,g)),ih(le(n,y))];return{key:"stack-total-labels",type:"labels",renderer:Il(n.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ah(e.data.sumOfPositives.value,a.meta.minor.orientation,o),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:ql.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:ql.labels.trackBy,compensateForLayoutChanges:ql.labels.compensateForLayoutChanges}}}function xf(e,t,n){const o=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return o.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}function Cf({layout:e,type:t},n){const{layoutService:o,viewCache:i,themeService:r,styleService:a}=n,{meta:s}=o,{isStacked:l}=s;if(!l&&!sh(e,n)||l&&!lh(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===Ym&&0===u.max||t===Xm&&0===u.min)return!1;if(!Zm(t===Ym?u.implicitMax:u.implicitMin,u,t))return!1;const c=r.getStyles(),d=a.label.getStyle();let m=e=>e.data.end.label;s.isStacked&&(m=t===Ym?function(e){if(Zm(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,o=n.chart.formatter(Gd.FORMATTER.MINOR);return o?o(t):t}return""}:function(e){if(Zm(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,o=n.chart.formatter(Gd.FORMATTER.MINOR);return o?o(t):t}return""});const h={label:m,simplifiedPlacements:xf("outside",0,s.isContinuous),styles:c},f={label:m,simplifiedPlacements:xf("opposite",0,s.isContinuous),styles:c},p=[ih(le(n,h)),ih(le(n,f))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${Gd.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:p,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:ql.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:Il(n.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:ql.labels.trackBy,compensateForLayoutChanges:ql.labels.compensateForLayoutChanges}}}function qf(e){return"all"===e||"title"===e}function Tf(e,t,n){if(!qf(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const o=t.alternativeService.getAlternatives(),{actions:i}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:Im[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:o.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function wf(e,t,n){if(!qf(e.measureAxis.show))return!1;const o=t.alternativeService.getAlternatives(),{actions:i}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:o.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"measure"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function kf({environment:e,rtl:t,refLineModel:n,layoutService:o,colorService:i,dockService:r,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},m=a.getStyles(),h=s.animations.enabled;return[Ll({refLineModel:n,layoutService:o,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Gd.SCALE.MAIN.MINOR,axis:"horizontal"===r.meta.major.orientation?"y":"x",key:Gd.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:Im.refLines.minimumLayoutMode}),Ll({isDimension:!0,refLineModel:n,layoutService:o,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Gd.SCALE.MAIN.MAJOR,axis:"horizontal"===r.meta.major.orientation?"x":"y",rtl:t,key:Gd.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:Gd.COMPONENT.BAR,minimumLayoutMode:Im.refLines.minimumLayoutMode}),...Dl({refLineModel:n,layoutService:o,colorModel:d,animationsEnabled:h,dock:r.meta.minor.opposite,scale:Gd.SCALE.MAIN.MINOR,style:m,formatter:Gd.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:Gd.COMPONENT.MEASURE_REF_LINE_LABEL}),...Dl({isDimension:!0,refLineModel:n,layoutService:o,colorModel:d,animationsEnabled:h,dock:r.meta.major.opposite,scale:Gd.SCALE.MAIN.MAJOR,style:m,theme:u,localeInfo:c,rtl:t,key:Gd.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function Nf({dockService:e,layoutService:t,discrete:n,continuousDataModel:o,viewModel:i,flags:r}){if(!r?.isEnabled("VIZ_199_ADD_SPACE_BETWEEN"))return!1;if(!!au({layoutService:t}).none)return!1;const{rtl:a}=e.config,s="horizontal"===e.meta.chart.orientation,l=!s,{dock:u}=e.meta.major,{show:c}=t.getLayoutValue("dimensionAxis",{}),d="none"!==c;if(l&&d&&"bottom"===u)return!1;if(s&&d){if(!a&&"right"===u)return!1;if(a&&"left"===u)return!1}const m=a?"left":"right";return{type:"space",key:Gd.COMPONENT.SPACE,layout:{dock:l?"bottom":m,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?o.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:i.animations.enabled,trackBy:()=>Math.random()}}}function Lf({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,context:s,resources:l,viewCache:u}){const c=[],d=r.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return c;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=Jr.generateId)})}(d);const m=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((u,d)=>{const h=`points-addon-${d}`,f=`lines-addon-${d}`;switch(u[0]?.type){case"point":c.push(Fl({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Gd.SCALE.MAIN.MAJOR,minorScale:Gd.SCALE.MAIN.MINOR,mainComponentKey:Gd.COMPONENT.BAR,data:u,key:h})),m.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":c.push(function({chart:e,chartModel:t,discreteModel:n,colorService:o,layoutService:i,dockService:r,rtl:a,majorScale:s,minorScale:l,mainComponentKey:u,data:c,key:d,scales:m={}}){if(!Array.isArray(c)||0===c.length)return!1;const h={resolveUIColor:o.getMain().getPaletteColor},f="horizontal"===r.meta.major.orientation,p=!(!f||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=el.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),M=[];c.forEach((e,t)=>{const n=(e?.points??[]).map((n,o)=>({...n,lineId:t,style:0===o?e.style:void 0}));M.push(...n)});const S={},x=[];c.forEach(e=>x.push(...(e?.points??[]).map(e=>e.dimensionValue))),x.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const C=M[0];M.forEach(t=>{const n=zl({point:t,dimensionValueInfo:S,layoutService:i}),o=t?.scale,r=C?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let u=n;const c=r&&o&&r!==o,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(c)u=function(e,t,n){const o=t.min(),i=t.max(),r=n.min(),a=n.max();return i===o?r:r+(e-o)/(i-o)*(a-r)}(n,m[o]||e.scale(o),m[r]||e.scale(r));else if(d)u=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);u=e.reduce((e,n)=>{const o=n.qNum;return"number"==typeof o&&Math.sign(o)===t?e+o:e},0)}}t.validMeasureValue=u});const q={scale:s,fn:({datum:t})=>{const n=e.scale(s),o=t.value.dimensionValue;return y?n("string"==typeof o?""===o?void 0:+o:o):void 0!==S[o]?el.getScaledPosition({scale:n,value:S[o].id,valueInfo:S[o],size:e.component(u)?.rect[f?"width":"height"],align:"center",invert:p,layoutService:i,isContinuous:y}):void 0}},T={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:M,settings:{connect:!0,coordinates:{major:f?q:T,minor:f?T:q,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"linear",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??2,stroke:({datum:e})=>Rl({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:ql.nonUpdatingNode.trackBy,compensateForLayoutChanges:ql.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:o,layoutService:r,dockService:a,rtl:s.rtl,majorScale:Gd.SCALE.MAIN.MAJOR,minorScale:Gd.SCALE.MAIN.MINOR,mainComponentKey:Gd.COMPONENT.BAR,data:u,key:f})),u.forEach((u,d)=>{if(u?.showPoints&&u?.points){const h=`points-${d}-for-${f}`;c.push(Fl({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Gd.SCALE.MAIN.MAJOR,minorScale:Gd.SCALE.MAIN.MINOR,mainComponentKey:Gd.COMPONENT.BAR,data:u.points,key:h})),m.push({key:h,lines:!0,labels:!0,duplicates:!0})}else u?.points&&m.push({key:f,lines:!0,labels:!1,duplicates:!0,points:u.points})})}}),c.push(function({layoutService:e,dockService:t,chartModel:n,themeService:o,configs:i,flags:r,cache:a}){const s=e.getLayoutValue("plugins"),{rtl:l}=t.config,{orientation:u}=t.meta.major,{isOneDimensional:c,isStacked:d}=e.meta,m=o.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:Il(r),settings:{all:!0,cache:a,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:d?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<s.length;t++){const n=s[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:u,pointValue:e=>e.value?.validMeasureValue,rtl:l},style:m.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:ql.nonUpdatingNode.trackBy,compensateForLayoutChanges:ql.labels.compensateForLayoutChanges}}}({layoutService:r,dockService:a,chartModel:t,themeService:i,configs:m,flags:l.flags,cache:u})),c}const Df=(e,t,n)=>{const{layoutService:o,dockService:i,colorService:r,chart:a,actions:s,discrete:l,continuousDataModel:u,reducedDataModel:c,viewModel:d,viewState:m,viewCache:h,themeService:f,refLineModel:p,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:M,disclaimerService:S}=t,{localeInfo:x}=n,C=function(e,t){const{disclaimerService:n,themeService:o,translator:i}=e,r=n.getDisclaimer();if(!r)return!1;const{fontFamily:a}=o.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:r.alignment},settings:{isRTL:t,label:i.get(`Object.Disclaimer.${r.key}`)},style:{fontFamily:a}}}(t,v);if(S.getHasSuppressingDisclaimer())return{components:[C]};const q=Zh(e,t,{localeInfo:x,rtl:v}),T=!s?.interact?.enabled(),w=r.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:T}),k=w.components[0];if(k){const{dock:e}=k.layout;if(q.fillRange&&(["right","left"].includes(e)||v)&&(q.fillRange.invert=!0),"legend-seq"===k.type&&void 0!==d.selectionDimensionIdx&&q.fillRange&&q.fillRange.min<q.fillRange.max){const e=Am({eventName:"legendRange",key:"legendRangeBrush",targets:[k.key],fillTargets:[k.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:k.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);w.components.push(...e.components),w.interactions.unshift(...e.interactions)}}else q.fillRange&&v&&(q.fillRange.invert=!0);const N=((e,{componentKey:t,collectionKey:n})=>{const{meta:o}=e.layoutService,i=e.colorService.getMain().getPaletteColor;let r,a;o.isGroupedByDimension?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:o.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let s=2;o.isContinuous?(a={start:"timeStart",end:"timeEnd"},s=Um(e,t)):o.isStacked&&(a="stack");const l=o.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,u=e=>!0===e.datum.null?.value,c=e.layoutService.getLayoutValue("components",null),d=c?c.filter(e=>e.key===t)[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:o.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:o.isContinuous||l?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:Gd.SCALE.MAIN.MAJOR,fn:r,ref:a},minor:{scale:Gd.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:_m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:s,fill:e.colorService.getMain().getColor(),opacity:e=>u(e)?0:void 0,minHeightPx:function(e){return o.isStacked?.1:u(e)?.01:.3},strokeWidth:d?.style?.strokeWidth?jm.BAR.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:jm.BAR.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color?i(d?.style?.strokeColor):jm.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:ql.bars.trackBy,compensateForLayoutChanges:ql.bars.compensateForLayoutChanges}}})(t,{componentKey:Gd.COMPONENT.BAR,collectionKey:Gd.COLLECTION.MAIN}),L=((e,{componentKey:t,collectionKey:n})=>{const{meta:o}=e.layoutService;if(!o.isStacked)return!1;let i=2;o.isContinuous&&(i=Um(e,t));const r={key:t,type:"box",data:{collection:n},settings:{major:{scale:Gd.SCALE.MAIN.MAJOR},minor:{scale:Gd.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:_m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return o.isContinuous&&(r.settings.major.ref={start:"timeStart",end:"timeEnd"}),r})(t,{componentKey:Gd.COMPONENT.STACK_TOTAL_BAR,collectionKey:Gd.COLLECTION.STACK_TOTAL}),D=nf(t,n,d.selectionDimensionIdx),{isStacked:O}=o.meta;let E;E=c.mode.isContinuous?Gd.COLLECTION.MINI_CONTINUOUS:O?Gd.COLLECTION.MINI_STACK:Gd.COLLECTION.MINI;const A=O?L:N,I=Ch(0,t),P=t.flags.isEnabled("VIZ_266_BARCHART_REFACTOR_TOOLTIP"),R=[...I,lf(t,{barComponent:A,type:"max",isStacked:O}),lf(t,{barComponent:A,type:"min",isStacked:O}),eh(t,{barComponent:A,type:"max",isStacked:O}),eh(t,{barComponent:A,type:"min",isStacked:O}),nh(t,{chart:a,type:"max",collectionKey:O?Gd.COLLECTION.STACK_TOTAL:Gd.COLLECTION.MAIN}),nh(t,{chart:a,type:"min",collectionKey:O?Gd.COLLECTION.STACK_TOTAL:Gd.COLLECTION.MAIN}),...Hm(e,t,v,!!I[0]),N,L,rf({layoutService:o,viewModel:d,dockService:i}),Tf(e,t,v),wf(e,t,v),...kf({environment:n,rtl:v,refLineModel:p,layoutService:o,colorService:r,dockService:i,themeService:f,viewModel:d,chart:a}),bs({viewState:m,viewCache:h,layoutService:o,dockService:i,rtl:v}),Nf({dockService:i,layoutService:o,discrete:l,continuousDataModel:u,viewModel:d,flags:t.flags}),Ph(N,t,{collectionKey:E}),su({layoutService:o,dockService:i,discrete:l,continuousDataModel:u,viewState:m,viewCache:h,themeService:f,rtl:v,deviceType:n.deviceType}),...Od({majorScale:Gd.SCALE.MAIN.MAJOR,minorScale:Gd.SCALE.MAIN.MINOR,tooltipOverlay:Gd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:o,trendLineModel:M,dockService:i,animationsEnabled:d.animations.enabled}),...w.components,ch({layout:e,component:Gd.COMPONENT.BAR,minorScale:q.minor},t,v),Sf({layout:e,component:Gd.COMPONENT.STACK_TOTAL_BAR},t,v),Cf({layout:e,type:"max"},t),Cf({layout:e,type:"min"},t),...D.components,!P&&mh(0,{...t,coloring:r.getMain().getSettings()},v),!P&&fh(0,{...t,coloring:r.getMain().getSettings()},v),...P?y.getComponents():[!1],!1!==e.showDisclaimer&&C,Pd({tooltip:Gd.COMPONENT.TREND_LINES_TOOLTIP,formatter:Gd.FORMATTER.MINOR},t,{rtl:v}),...t.flags.isEnabled("TLV_1274_PLUGINS_BAR_CHART")?Lf({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:r,themeService:f,layoutService:o,dockService:i,context:{},resources:t,viewCache:h}):[]].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(R);const z=[...w.interactions,...D.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0));return{interactions:P?Ah(t,{rtl:v,hammer:{gestures:z}}):Dh(t,{rtl:v,hammer:{gestures:z}}),scales:q,palettes:r.getMain().getPalettes(),components:g.extendComponents(R),strategy:$r(0,{logicalSize:b,minCenterRatio:0}),formatters:ph(t,q),collections:bf(0,t)}};const Of=({environment:e,services:t,chart:n,viewState:o,bootstrapped:i})=>{$(r=>{if(!e||!t||!i)return;const{layoutService:a,dockService:s,colorService:l,discrete:u,continuousDataModel:c,reducedDataModel:d}=t,{width:m,height:h}=s.meta.chart.size;if(r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:m,h:h}},a.meta.isSnapshot)return Promise.resolve();r.snapshotData.content.chartData={scrollOffset:o.get("scrollOffset"),zoom:o.get("zoom"),legendScrollOffset:na(n,Gd.COMPONENT.LEGEND_COLOR_CAT)};const{properties:f}=i,p=f?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return p&&(r.tooltip.auto=!0),a.meta.isDiscrete?(u.command.setSnapshotData(r),d.setSnapshotData(r)):c.setSnapshotData(r),l.getMain().getSnapshotData().then(e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}}).catch(()=>{})}),W(()=>({getViewState(){if(o&&n)return{scrollOffset:o.get("scrollOffset"),zoom:o.get("zoom"),legendScrollOffset:na(n,Gd.COMPONENT.LEGEND_COLOR_CAT)}}}),[o,n])},Ef=e=>"[object Object]"===Object.prototype.toString.call(e),Af=e=>Array.isArray(e);function If(e,t){if(e===t)return!0;if(Af(e)){if(!Af(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!If(e[n],t[n]))return!1;return!0}if(Ef(e)){if(!Ef(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++){if(!Object.hasOwn(t,n[o]))return!1;if(!If(e[n[o]],t[n[o]]))return!1}return!0}return e===t}const Pf=({properties:e,layout:t,isStacked:n,isContinuous:o,model:i,layoutService:r})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=le(!0,{},e);return((e,t,n)=>{const{color:{mode:o}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===o&&t.length>1?n.color.mode="byMultiple":"byExpression"===o&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==o&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!o&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),i.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:o}=e.color||{};if("byExpression"===o){const o=t.getLayout();if("colorByExpression"===o.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:r}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:o,target:i}=n.reduce((e,n,o)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=o),void 0!==e.target||t.includes(o)||(e.target=o),e),{current:void 0,target:void 0});return{current:o,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[r].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:r}),!Ts.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};function Rf(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==Tc).length,o=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==Tc).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(o+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(o+n))))}}const zf=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Bf=(e,t,n)=>{const o=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:o,options:()=>t.getOptions(o),defaultValue:()=>t.getDefaultValue(o)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function Ff(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(zf).map(e=>zf[e]),schemaIgnore:!0,defaultValue:zf[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!ta.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Tc).length,o=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Tc).length,i="grouped"===e.barGrouping?.grouping&&o>0&&n+o>2;return ta.continuous(t)?1:i?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(nu.OPTIONS).map(e=>nu.OPTIONS[e]),schemaIgnore:!0,defaultValue:nu.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function Hf(e,t,n,o=!1){return o?Ff(t):function(e,t,n){const o=x({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(zf).map(e=>zf[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!ta.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:o}=n,{barGrouping:i,qHyperCubeDef:r}=o,a=r.qMeasures.length,s=r.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return ta.continuous(o)?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Bf("axis.title",o,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:Bf("axis.label.name",o,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Bf("label.value",o,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:Bf("legend.title",o,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:Bf("legend.label",o,e)}}}:void 0}}}(e,t,n)}const jf=e=>e.qError?.qErrorCode!==Tc,_f=(e,t)=>e?.qHyperCube[t].filter(e=>jf(e)),Vf=e=>{if(!e)return!1;const t=le(!0,{},e);return t.qHyperCube.qMeasureInfo=_f(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=_f(e,"qDimensionInfo"),t&&!ta.continuous(t)&&ta.stacked(t)},Uf=({translator:e,flags:t,anything:n})=>{const o=n?.sense?.isUnsupportedFeature?.("continuousData"),i={items:{labels:{items:{header:{show:(e,t,n)=>_f(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!Vf(t.layout)&&_f(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>Vf(t.layout),convertFunctions:{get:(e,t,n,o)=>o.dataPoint.showLabels&&o.dataPoint.showSegmentLabels,set(e,t,n,o,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>Vf(t.layout),convertFunctions:{get:(e,t,n,o)=>o.dataPoint.showLabels&&o.dataPoint.showTotalLabels,set(e,t,n,o,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>_f(n.layout,"qDimensionInfo").length&&_f(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,o)=>"labels"===o.dimensionAxis.show||"none"===o.dimensionAxis.show,set(e,t,n,o,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>_f(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,o)=>"labels"===o.measureAxis.show||"none"===o.measureAxis.show,set(e,t,n,o,i){i.measureAxis.show=e?"labels":"all"}}}}}}},r=n?.sense?.theme,a={uses:"settings",items:{simpleStyling:Hf(r,t,e,!0),simpleLabels:i,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:Hf(r,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{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"}];return Yd({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=_f(t.layout,"qMeasureInfo").length,o=_f(t.layout,"qDimensionInfo").length;return o>0&&n+o>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||Yd({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||Yd({layout:n.layout})||(e.barGrouping.grouping="stacked"),_f(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>ta.continuous(n.layout),convertFunctions:{get(e,t,n){const o="stacked";return"butterfly"===e(t.type)?Yd({layout:n.layout})?e(t.type):o:ta.continuous(n.layout)?o:e(t.type)},set(e,t,n){const o=ra(n.type,n);t(n.type,e,o)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>ta.continuous(n.layout),convertFunctions:(s="vertical",{get:(e,t,n)=>ta.continuous(n.layout)?s:e(t.type),set(e,t,n){const o=ra(n.type,n);t(n.type,e,o)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(nu.OPTIONS).map(e=>nu.OPTIONS[e]),defaultValue:nu.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!ta.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(Vf(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Vf(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&Vf(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:Pl}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!ta.continuous(n.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const o=_f(n.layout,"qMeasureInfo").length,i=_f(n.layout,"qDimensionInfo").length,r=e.dimensionAxis.maxVisibleItems;return r<0||r>1e4/(i+o)},globalChange:Rf,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!o}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var s;return t?.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(a.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"}]}}}),a.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},a},$f={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){ps(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:o,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:r}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&o.length>=1&&r>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Wf=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:t?.isEnabled("CLIENT_TLV_694_PLUGINS_UI")&&t?.isEnabled("TLV_1274_PLUGINS_BAR_CHART")?Jl({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}]}):void 0}}),Kf=({translator:e,flags:t,anything:n})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,o){if(n?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const i=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>jf(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,t),r=ta.continuous(o.layout);return!(i&&r)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:n?.sense?.isUnsupportedFeature?.("trendlines")?void 0:Hd({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}});function Gf({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Kf({translator:e,flags:t,anything:n}),sorting:$f,addons:Wf({translator:e,flags:t}),settings:Uf({translator:e,flags:t,anything:n})}}}const Yf=e=>e.qError?.qErrorCode!==Tc;function Xf({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const o=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter(e=>Yf(e)).length;return 1===o&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{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"}];return Yd({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){return t.qHyperCube.qMeasureInfo.filter(e=>Yf(e)).length+t.qHyperCube.qDimensionInfo.filter(e=>Yf(e)).length>2&&!ta.continuous(t)&&(n=t,!(n?.qHyperCube?.qDimensionInfo?.filter(e=>Yf(e)).length>1&&n?.qHyperCube?.isHCEnabled));var n},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!ta.continuous(t)}}},color:{uses:"color"}}}}function Jf(e){const t={},n=a(e,"components"),o=a(e,"dimensionAxis.axisDisplayMode"),i=a(e,"dimensionAxis.maxVisibleItems"),r=n?n.filter(e=>"bar"===e.key)[0]:void 0,s=a(e,"tooltip");if(r&&r.style&&Object.keys(r.style).forEach(e=>{t[`chart_style_${e}`]=r.style[e]}),i&&(t.chart_dimaxis_maxVisibleItems=i),o&&(t.chart_dimaxis_axisDisplayMode=o),s){t.chart_tooltip_custom=!s.auto;const e=a(s,"chart.object.refId");!s.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const Zf=e=>!!(e&&e.qHyperCube.qSize.qcy>0),Qf={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function ep(){const e=[];return Object.keys(Qf).forEach(t=>{e.push(Qf[t])}),e}function tp(e){return{definition:Gf(e),softDefinition:Xf(e),support:{snapshot:Zf,export:Zf,exportData:!0,sharing:Zf,viewData:!0,effects:!0,modifiers:ep()},importProperties:(t,n,o,i)=>{const r={layout:{templateId:n.templateId}};o.mapProperties(r);const a={defaultDimension:o.getDefaultDimensionProperties(),defaultMeasure:o.getDefaultMeasureProperties()},s=G.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Ic(e),defaultPropertyValues:a,hypercubePath:i,extension:o}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),G.conditionalShow.unquarantine(l),G.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{G.conditionalShow.quarantine(e.qProperty),G.conditionalShow.quarantineAlternative(e.qProperty);return G.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(ps),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(ps)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:o,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:r}=n;(r||!r&&o)&&(e.scrollbar=nu.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Jf}}}}});
7
+ System.register(["picasso.js","picasso-plugin-q","hammerjs","qlik-chart-modules","qlik-chart-modules/react","@nebula.js/stardust","qlik-object-conversion"],function(e){"use strict";var t,n,o,i,r,a,s,l,u,c,d,m,h,f,p,g,y,v,b,M,S,x,C,q,T,w,k,N,L,D,O,E,A,I,P,R,z,B,F,H,j,_,V,U,$,W,K,G;return{setters:[function(e){t=e.default},function(e){n=e.default},function(e){o=e.default},function(e){i=e.debouncer,r=e.throttler,a=e.getValue,s=e.setValue,l=e.createColor,u=e.pointLabelComponent,c=e.cache,d=e.storage,m=e.memoize,h=e.selectionService,f=e.colorService,p=e.tooltipService,g=e.disclaimerService,y=e.layoutService,v=e.dockService,b=e.themeService,M=e.alternativeService,S=e.pluginService,x=e.fontResolver},function(e){C=e.reactRenderer,q=e.disclaimerComponent,T=e.axisTitleComponent},function(e){w=e.useTranslator,k=e.useEmbed,N=e.useTheme,L=e.useState,D=e.useDeviceType,O=e.useAppLayout,E=e.useEffect,A=e.useElement,I=e.useOptions,P=e.useLayout,R=e.useAction,z=e.useStaleLayout,B=e.useModel,F=e.useApp,H=e.usePlugins,j=e.useSelections,_=e.useConstraints,V=e.useRect,U=e.usePromise,$=e.onTakeSnapshot,W=e.useImperativeHandle,K=e.useRenderState},function(e){G=e.default}],execute:function(){e("default",function(e){const s=function(){const e=t();return e.use(n),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",J(e))};return void e.interaction("hammer",J(Hammer))}(o)),e.use(Wu),e.renderer("react-qcm",C),e.component("box-sliced-hat",Vu),e.component("box-out-of-bounds",Bu),e.component("disclaimer",q),e.component("scrollbar",Au),e.component("scroll-hint",ms),e.component("reference-line-labels",pl),e.component("axis-overlay",Pr.picassoComponents.axisOverlay),e.component("time-axis",Pr.picassoComponents.timeAxis),e.component("space",Uu),e.component("axis-title",T),e.component("point-label",u),e.scale("q-time-axis",Pr.picassoScales.time),e}();return{qae:Lc(e),ext:Yf(e),component(){const t=function({env:e}){const{flags:t}=e,n=e.anything?.sense?.isUnsupportedFeature,o=w();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Dc).forEach(t=>{e.add(Dc[t])})}}(e.translator);const i=k(),r=N(),[a,s]=L(),l=D(),u=O(),{qLocaleInfo:c}=u;return E(()=>{s({translator:o,theme:r,embed:i,deviceType:l,localeInfo:c,isUnsupportedFeature:n,flags:t})},[c,n,o.language(),r.name(),l]),a}({env:e}),{viewState:n,viewCache:o}=function(){const[e]=L(()=>c()),[t]=L(()=>d({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:e,viewState:t}}(),l=function({picasso:e}){const t=A(),n=I(),[o,i]=L();return E(()=>{if(!e)return()=>{};t.style.overflow="hidden";const o=e({renderer:{prio:[n?.renderer||"canvas"]}}).chart({element:t,data:[],settings:{}});i(o);const{destroy:r}=o;return()=>{r()}},[n.renderer]),o}({picasso:s}),u=function({picasso:e,chart:t,environment:n,viewState:o,viewCache:i}){const s=z(),l=B(),u=F(),d=H(),m=j(),h=I(),[f,p]=L(),[g,x]=L(),[C,q]=L(),T=_(),k=function(){const[e]=L({}),[t]=L({}),n=function(){const e=P(),t=w(),n=!!e?.qSelectionInfo?.qInSelections,o=!!e?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[i,r]=L(!1),[a,s]=L(!1),[l,u]=L({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),c=e=>{s("boolean"==typeof e?e:!a)};return R(()=>(u({key:"lasso",action:c,enabled:()=>i,active:()=>a}),{key:"lasso",label:t.get(a?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:Fd,hidden:!i||!n||o,active:a,action:c}),[n,o,a,i,t.language()]),{get:()=>l,setAllows:e=>{r(!!e)}}}(),[o,i]=L();return E(()=>{const o={};o.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:o}=e;return t.allowScroll&&(n?.meta.isContinuous||o?.query.getCanScroll())}},o.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},o.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},o.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},o.lasso=n.get(),Object.keys(o).forEach(e=>Hd(o[e])),i(o)},[]),E(()=>{o&&n&&(o.lasso={...o.lasso,...n.get()})},[n]),{get:()=>o,setAllows:e=>{Object.assign(t,e),n.setAllows(e?.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(o).forEach(e=>o[e].removeAllListeners())}}}();return E(()=>{if(!t)return()=>{};const e=k.get(),n=Wd({chart:t,actions:e,selections:m});return x(e),q(n),()=>{n.destroy(),k.destroy()}},[t]),E(()=>{if(!T)return;const e={allowScroll:!T.active,allowInteract:!T.active,allowTooltip:!T.passive,allowSelect:!T.select&&!T.active};k.setAllows(e)},[T]),E(()=>{if(!C||!n)return;const{theme:m,translator:f,localeInfo:x,flags:q,embed:T}=n,{direction:w="ltr"}=h,N="rtl"===w,L=y({source:s,metaAdditionsFn:Ud(),experimental:{filter:!0}});C.setFilteredFields(L.meta.filteredFields);const D=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(L.getLayout())?y({source:L.getLayout()}):void 0,O=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:s,options:h}),E=function({layoutService:e,viewCache:t,options:n}){const o={};return o.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),o.selectionDimensionIdx=Kd(e.getHyperCube()),o.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,o.selectionDimensionProp=e=>void 0===o.selectionDimensionIdx||void 0!==e&&o.selectionDimensionIdx!==e?{}:{selectionDimension:{field:o.selectionDimensionIdx}},o.animations={enabled:()=>!1!==n.chartAnimations&&(!(o.animations.isPartialUpdating||o.animations.isSizeChanging||o.animations.hasSlicedHats)&&!vl.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},o}({layoutService:L,viewCache:i,options:h}),A=v({chart:t,layoutService:L,config:{logicalSize:O,rtl:N},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),I=Qd({layoutService:L}),P=b({theme:m,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),R=Pr.model({model:l,layoutService:L,viewCache:i,viewState:o}),z=function({enigma:e,layoutService:t,viewModel:n,definitionPath:o,reducedHyperCubePath:i},r={}){const a=function(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(Jr).then(e=>{const n=t.getHyperCubeValue("qMode"),o=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&o.length>1&&e[0]?.qIsReduced,r=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:r,qDimensionInfo:o.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),o=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:o,qWidth:e.length+i.length+o,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}(e,t,o),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,o=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return o.should=e=>t&&n&&1===e.qDimensionInfo.length,o}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var o;u.should(e)&&u(e),c.mode=ne(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(o=e).qDimensionInfo.length&&2===o.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},c.scales={major:_d.SCALE.REDUCED.MAJOR,minor:_d.SCALE.REDUCED.MINOR},c.cube=e,r.qDataPages=e.qDataPages},fetchMinMaxData(){if(r.qDataPages)return Promise.resolve(r.qDataPages);let n=a.settings();const o="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=ne(!0,{},n,{rect:{qHeight:o}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=c.cube}}}({enigma:l,layoutService:L,viewModel:E});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const o=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",o.scrollOffset),t.preventSet("legendScrollOffset",o.legendScrollOffset||0),o.zoom&&t.preventSet("zoom",o.zoom)}({layoutService:L,viewState:o,viewStateOptions:h?.viewState});const B=Yd({picasso:e,model:l,app:u,translator:f,localeInfo:x,theme:m,continuousDataModel:R,layoutService:L,legendLayoutService:D,reducedDataModel:z}),F=M({app:u,translator:f}),H=function({layoutService:e,themeService:t,colorService:n}){const o=t.getStyles(),i=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),r=(e,t)=>{const o=n.getMain().getPaletteColor;if(e?.color&&o){const n=o(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=i("axis")?.axis?.title;return{fontFamily:e?.fontFamily??o.axis.title.fontFamily,fontSize:e?.fontSize??o.axis.title.fontSize,color:r(e?.color,o.axis.title.color)}}},label:{getStyle:()=>{const e=i("axis")?.axis?.label?.name;return{fill:r(e?.color,o.axis.label.name.color),fontSize:e?.fontSize??o.axis.label.name.fontSize,fontFamily:e?.fontFamily??o.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{const e=i("legend")?.legend?.title;return{fontFamily:e?.fontFamily??o.legend.title.fontFamily,fontSize:e?.fontSize??o.legend.title.fontSize,color:r(e?.color,o.legend.title.color)}}},label:{getStyle:()=>{const e=i("legend")?.legend?.label;return{fontFamily:e?.fontFamily??o.legend.label.fontFamily,fontSize:e?.fontSize??o.legend.label.fontSize,color:r(e?.color,o.legend.label.color)}}}},label:{getStyle:()=>{const e=i("label")?.label?.value;return{fill:r(e?.color,o.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??o.label.value.fontSize,fontFamily:e?.fontFamily??o.label.value.fontFamily}}}}}({layoutService:L,themeService:P,colorService:B}),j=xd({layoutService:L,viewState:o,colorModel:{settings:()=>B.getMain().getSettings(),resolveUIColor:e=>B.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:_d.SCALE.MAIN.COLOR},isEnabled:()=>!L.meta.isGroupedByDimension&&(!L.meta.isStackedByDimension||q.isEnabled("TRENDLINES_STACKED_DIM"))&&!L.meta.isDimensionless});gc.attrExpr.updateProperties(l,s);const _=lc({layout:s,app:u,model:l,picasso:e,chart:t,translator:f,localeInfo:x,embed:T}),V=vc({app:u,chart:t,embed:T,flags:q,layout:L.getLayout(),localeInfo:x,model:l,options:{direction:h.direction},picasso:e,translator:f}),U=Jd({chart:t,actions:g,translator:f,rtl:N,viewState:o,viewModel:E,layoutService:L,dockService:A,colorService:B,themeService:P,trendLineModel:j,custom:V});let $;L.meta.isDiscrete&&($=function({chart:e,actions:t,componentKey:n,enigmaModel:o,layoutService:i,dockService:s,trendLineModel:l,itemWidths:u,viewState:d,rtl:m,options:{definitionPath:h="/qHyperCubeDef",getRect:f,axisKey:p,renderer:g,areaBuffer:y,processDataPage:v=()=>{}}={}}){const b=c(),M=function({qMode:e}){switch(e){case"K":return Fc;case"T":return Hc;default:return Bc}}({qMode:i.getHyperCubeValue("qMode")}),S=function({state:e,contains:t}){return e.set(jc,[]),{add:t=>{const n=e.get(jc);n.length=0,n.push(t)},getCurrent:()=>e.get(jc)[0],getAll:()=>e.get(jc),contains:n=>t(e.get(jc)[0],n)}}({state:b,contains:M.contains});!function({layoutService:e,dataStore:t,composition:n}){const o=e.getDataPages()[0];if(!o)return;const i=n.patcher({layoutService:e});i.should(o)&&i(o);t.add(o)}({layoutService:i,dataStore:S,composition:M});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:y}),C=function({dataStore:e,composition:t,enigmaModel:n,layoutService:o,trendLineModel:i=Gc,definitionPath:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:n,expand:o,request:i,process:r,connectionless:a,processDataPage:s}){const l=(l,{onProcessing:u}={})=>{if(e.contains(l)){const o=e.getCurrent();if(a)return Promise.resolve(t(o,l));const i=n.release(o.qArea,l),s=r.isProcessing();if(!i&&s&&r.cancel(),!i||s)return Promise.resolve(t(o,l))}if(a)return Promise.resolve(e.getCurrent());r.isProcessing()&&u&&u();const c=o(l);return r(i(c)).then(n=>(s(n),e.add(n),t(n,l)))};return l}({dataStore:e,slice:l,warden:u({bounds:{width:o.meta.size.x,height:o.meta.size.y}}),expand:Wc({layoutService:o}),request:c({definitionPath:a}),process:Kc(n),connectionless:o.meta.isSnapshot,processDataPage:s}),m=r((e,{onProcessing:t,onData:n})=>{d(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==Oc)throw e})},Pc);return function(e,{onProcessing:t=Ec,onDataPage:n=Ec}={}){m(e,{onProcessing:t,onData:e=>{o.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}({dataStore:S,composition:M,enigmaModel:o,layoutService:i,trendLineModel:l,definitionPath:h,processDataPage:v}),q=function({chart:e,componentKey:t,state:n,dataStore:o,pageData:i,layoutService:r,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:h}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const f=function({chart:e,getRect:t,getDataPages:n,layoutService:o,dockService:i,getItemWidths:r,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:o}=e.meta;if(t)return Yc;if(!n)return Xc;return o?ed:od}({layoutService:o}),h=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,f=e=>e?h()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const n=o.getLayoutValue("dimensionAxis"),l=c({layoutService:o});return{inTotal:l,inView:id({chart:e,rect:t(),dockService:i,itemWidths:r(),axisKey:a,renderer:s,isGrouped:o.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Ac/(o.meta.dimensionCount+o.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t,i=Math.min(0,Math.max(e,p(n,o))),r=o?Math.abs(o*i/h()):0;return{start:{pixel:i,item:r},end:{item:Math.min(r+(o||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return p(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:o}){const i=e/n*t,r=Math.abs(o)/i,a=Math.min(1,r+e/i);return[r,a]}({viewSize:h(),inTotal:n,inView:o,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:o,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const r=m({getDataPages:n,layoutService:o,offsets:e,items:t,viewSize:h(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(r):r},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:o}=t;return e<=0&&e>=p(n,o)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,o=e*f(n);return Number.isFinite(o)?-o:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:o}=t;return-e*(f(o)*n)}}}}({chart:e,getRect:()=>n.get("rect"),getDataPages:o.getCurrent,layoutService:r,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:h}),p=()=>{const e=f.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const o=f.getOffsets({pixelOffset:e,items:t});return n.set("offsets",o),o},y=({items:e})=>{const t=r.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?f.getUpperBound({items:e}):0;if("number"==typeof n)return f.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:o,end:i}=n,a=1===t&&i?i-e.inView:o;return f.convert.itemToPixelOffset({itemOffset:a,items:e})},v=e=>{const[{qArea:t}]=r.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])},b=e=>{const t=Date.now(),o=p(),r=g({pixelOffset:e,items:o}),a=f.getArea({itemOffset:r.start.item,items:o});if(v(a))return void((f.validate.offset({pixelOffset:e,items:o})||m.get("scrollOffset").start!==r.start.item)&&(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:o})),m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:o})),m.set("scrollOffset",{start:r.start.item,end:r.end.item})));m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:o}));const s=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:o})),m.set("scrollOffset",{start:r.start.item,end:r.end.item}))};i(a,{onProcessing:s,onDataPage:s})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const o=e.component(t);if(!o)return Promise.resolve();n.set("rect","function"==typeof l?l():o.rect),n.set("itemWidths","function"==typeof s?s():s);const r=p();n.set("itemSize",f.getItemSize({items:r}));const a=y({items:r}),u=g({pixelOffset:a,items:r});m.preventSet("viewRange",f.getViewRange({pixelOffset:u.start.pixel,items:r}));const c=f.getArea({itemOffset:u.start.item,items:r});return new Promise(e=>{i(c,{onDataPage:()=>{n.set("scaleRange",f.getScaleRange({offsets:u.start,items:r})),m.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;b(t)},scrollToRelative(e){const t=n.get("items"),o=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});b(o)}}}({chart:e,componentKey:n,state:b,dataStore:S,pageData:C,layoutService:i,dockService:s,itemWidths:u,getRect:f,axisKey:p,renderer:g,areaBuffer:x,viewState:d,rtl:m}),T=function({layoutService:e,dataStore:t}){return function(n){const o=a(n,`${e.refs.dataPages}`);o.length=0,o.push(t.getCurrent())}}({layoutService:i,dataStore:S}),w=function({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r}){return{gestures:[Uc({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r})],native:{type:"native",events:{wheel:$c({chart:e,actions:t,componentKey:n,scroller:r})}}}}({chart:e,actions:t,componentKey:n,dockService:s,rtl:m,scroller:q});return{interactions:w,query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>S.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>T(e)}}}({chart:t,actions:g,componentKey:_d.COMPONENT.BAR,enigmaModel:l,layoutService:L,dockService:A,trendLineModel:j,itemWidths:jd,viewState:o,rtl:N,options:{axisKey:_d.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const W=function({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:o,isGroupedByDimension:i}=e.meta,r=e.getLayout(),a="K"===r.qHyperCube.qMode,s=Yr.dimensionless(r),l=Gs.getMeasureRefLines(r),u=Gs.getDimensionRefLines(r,s),c=Gs.getMeasureRefLineLabels(r),d=Gs.getDimensionRefLineLabels(r,s);let m={},h={};const f=t=>{if(o){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:o,qMax:i}=n;return Gs.isOutOfRange({value:t,qMin:o,qMax:i})}return!1},p=t=>{if(!h[t])return!1;if(!n&&i){const n={valueInfo:h[t]},o="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(o);return Gs.isOutOfDataPages({label:n,dataPages:i})}return!0},g=()=>!(!u||!u.length)&&!u.every(t=>{const n=Gs.getInputValue({refLineLayout:t,layoutService:e});return f(n)||p(n)}),y={isKMode:a,canBeContinuous:o,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:m,query:{getRefLines:e=>Gs.getRefLines(r,e),getRefLineLabels:e=>Gs.getRefLineLabels(r,e)},update:()=>{h=y.dimensionRefLineInfo,g()&&(m=Gs.getDimensionValuesInfo({layout:r,canBeContinuous:o,discreteModel:t,layoutService:e}),y.dimensionValuesInfo=m,u.forEach(t=>{const n=Gs.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(h[n]?(h[n].innerValues=m[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,m[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,m[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||m[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||m[n].isMaxOrderOk):h[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return y.update(),y}({layoutService:L,discreteModel:$}),K=function(e){const t={layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:_d.SCALE.MAIN.MINOR,MAJOR:_d.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:_d.COMPONENT.BAR,BAR_AXIS:_d.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:_d.COLLECTION.MAIN}}};return t}(L),G=S({picassoInstance:e,plugins:d||[],pluginArgs:K});k.setContext({discrete:$,layoutService:L}),p({alternativeService:F,discrete:$,continuous:Pr,legendLayoutService:D,layoutService:L,viewModel:E,dockService:A,themeService:P,styleService:H,continuousDataModel:R,reducedDataModel:z,colorService:B,trendLineModel:j,refLineModel:W,pluginService:G,customTooltipModel:_,tooltipService:U,selectionService:C,logicalSize:O,disclaimerService:I,customTooltipService:V})},[C,h,n,s]),f}({picasso:s,chart:l,environment:t,viewState:n,viewCache:o}),m=function({env:e,services:t}){const n=F(),o=B(),i=K(),r=function({enable:e=!0}={}){const t=B(),n=()=>Date.now().toString()+Math.random(),[o,i]=L(n()),r={properties:void 0};return E(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const o=()=>{t.getEffectiveProperties().then(e=>{const t=ne(!0,{},e);if(!r.properties)return void(r.properties=t);const o=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const o=ne(!0,{},e),i=ne(!0,{},t);return n.exclude=!Nf(o.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete o.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!Nf(o,i),n}(r.properties,t);r.properties=t,o.exclude&&!o.properties&&i(n())})};return t.on("changed",o),o(),()=>{t.removeListener("changed",o)}},[e]),o}({enable:!1===t?.layoutService?.meta?.isSnapshot}),[a,s]=U(async()=>{if(!e||!t)return Promise.resolve();const{layoutService:r}=t,{isSnapshot:a,isStacked:s,isContinuous:l}=r.meta,u=[];return a||u.push(o.getEffectiveProperties()),Promise.all(u).then(async e=>{const t=e[0]||void 0;if(t?.qHyperCubeDef){const e=r.getLayout(),a=ne(!0,{},t);if(Lf({properties:t,layout:e,isStacked:s,isContinuous:l,model:o,layoutService:r}))return i.pending(),kl(e)?o.setProperties(t).then(()=>{n.clearUndoBuffer()}):void await wl(o,a,t);i.restore()}return{properties:t}})},[e,t,r]);if(s&&!s.isHandled)throw s;return a}({env:e,services:u});!function({picasso:e,chart:t,services:n,environment:o,viewState:r,viewCache:a,bootstrapped:s}){const{width:l,height:u}=V(),c=B(),d=j(),m=I(),[h,f]=L(),[p,g]=L(),[y,v]=L(),[b,M]=L(),S=F();function x(s={}){const{alternativeService:l,selectionService:u,refLineModel:f,discrete:p,reducedDataModel:g,continuousDataModel:y,trendLineModel:v,pluginService:b,colorService:M,viewModel:x,dockService:C,themeService:q,customTooltipModel:T,layoutService:w,logicalSize:k,styleService:N,disclaimerService:L,tooltipService:D}=n,O=u.custom.getActions(),E=e.data("q")(h.prepPicassoDataSet()),A={picasso:e,ds:E,rtl:"rtl"===m?.direction,model:c,app:S,chart:t,actions:O,localeInfo:o.localeInfo,logicalSize:k,flags:o.flags,translator:o.translator,selections:d,isLocked:u.getIsSelectionLocked,viewCache:a,viewState:r,alternativeService:l,layoutService:w,dockService:C,viewModel:x,colorService:M,selectionService:u,themeService:q,trendLineModel:v,discrete:p,continuousDataModel:y,reducedDataModel:g.model(),customTooltipModel:T,debouncer:i,refLineModel:f,pluginService:b,styleService:N,disclaimerService:L,tooltipService:D,...s};return qf(w.getLayout(),A,o)}function C(){if(!t.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:o,viewModel:i}=n;a.set("isPreRender",!0);const r=x(p);h.extractDataPages(),t.layoutComponents({settings:r,data:y}),a.set("isPreRender",!1),h.insertDataPages(),i.animations.hasSlicedHats=r.components.filter(e=>"box-sliced-hat"===e.type).length>0;const s=[];return 1!==r.components.length&&o.meta.isDiscrete&&s.push(e.command.initialize()),Promise.all(s)}const[[q,T]=[]]=U(()=>{if(!(e&&t&&n&&o&&r&&a&&s))return Promise.resolve();const{alternativeService:i,layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:m,reducedDataModel:h,continuousDataModel:f,trendLineModel:p,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:S,disclaimerService:x,customTooltipService:C,tooltipService:q}=n;if(!u?.custom?.getActions())return Promise.resolve();const{properties:T}=s,w=T?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);w&&(S.useCustomTooltip=!1);const k=()=>{M(Date.now()),b.animations.isPartialUpdating=!0},N=()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),k()};r.onChanged("scrollOffset",N),r.onChanged("legendScrollOffset",k),r.intercept("zoom",m.event.onZoomIntercept({viewCache:a})),r.onChanged("zoom",m.event.onZoomChange({layoutService:l,continuousDataModel:f},k)),u.setLayout(l.getLayout());const L=[];l.meta.isContinuous&&(f.update(l.getLayout()),L.push(f.initialFetch())),p.command.update(),L.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),C.setProperties(T),q.expando.set("properties",T),x.initialize(),L.push(Promise.resolve({properties:s.properties}));const D=()=>[v.initialize(),y.initialize(),i.initialize({properties:T}),Sm({reducedDataModel:h,layoutService:l,continuousDataModel:f,trendLineModel:p})];return Promise.all(L).then(e=>Promise.all(D()).then(t=>[e,t.pop()]))},[s]);E(()=>{if(!n?.colorService?.getMain()||!T)return;const{layoutService:e,selectionService:t,reducedDataModel:i,continuousDataModel:r,trendLineModel:s,legendLayoutService:l,colorService:u,viewModel:c}=n;a.set("minorMinMax",T);const d=()=>!e.meta.isContinuous&&(i.model().mode.isReduced||e.meta.isStacked)&&l,m=e.getHyperCube(),h=e.meta.isContinuous?r.getInitialCube():i.model().cube,{field:p}=u.getMain().getSettings(),y=d(),v=y?l.getHyperCube():void 0;t.setBrushAliases({colorField:p,useLegendCube:y,legendAlias:`legendCube/${p}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:o,layoutService:i,viewModel:r,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:r.fields.majorNumeric,from:i.meta.isStackedByDimension?r.fields.majorStack:r.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:o,virtualFields:c}}),prepPicassoData(i){const r=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:o,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:o,virtualFields:c}},...i];return n&&r.push({type:"q",key:"legendCube",data:n,config:{localeInfo:o,virtualFields:c}}),a.query.hasTrendLines()&&r.push({key:"trend",data:a.query.getData()}),r},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:m,miniCube:h,legendCube:v,localeInfo:o.localeInfo,layoutService:e,viewModel:c,trendLineModel:s}),M=q[q.length-1];g({localeInfo:o.localeInfo,...M}),f(b)},[T]),E(()=>{if(!n||!p||!h)return;const e=n.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[p]),E(()=>{n?.colorService?.getMain()&&t.update&&h&&y&&C().then(()=>{const{layoutService:e,discrete:o,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([o.query.getCurrentDataPage()])}t.update(),vl.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),E(()=>{if(!(l&&u&&h&&t?.update&&n?.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:r}=n;i.update({width:l,height:u}),r.setTheme(o.theme),C().then(()=>{t.update&&t.update()})},[l,u]),E(()=>{if(!t?.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}({picasso:s,chart:l,services:u,environment:t,viewState:n,viewCache:o,bootstrapped:m}),Tf({environment:t,services:u,chart:l,viewState:n,bootstrapped:m})}}});const Y={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function X(e){return Y[e]||e}function J(e){return function(t,n,o){let i,r,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(r)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(r));const n=X(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(o),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(r),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=X(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,r={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),u&&c()},off(){u=!1,d()},on(){u=!0,0===l.length&&c()},destroy(){d(),a&&a.destroy(),a=null,r=null,i=null}}}}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q,ee;var te=function(){if(ee)return Q;ee=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},r=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var o,i=e.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!r)return!1;for(o in n);return void 0===o||e.call(n,o)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(o)return o(t,n).value}return t[n]};return Q=function e(){var t,n,o,l,u,c,d=arguments[0],m=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<h;++m)if(null!=(t=arguments[m]))for(n in t)o=s(d,n),d!==(l=s(t,n))&&(f&&l&&(r(l)||(u=i(l)))?(u?(u=!1,c=o&&i(o)?o:[]):c=o&&r(o)?o:{},a(d,{name:n,newValue:e(f,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Q}(),ne=Z(te),oe={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:ie}=oe;function re({layoutService:e,largeDataService:t}){const{maxNumPoints:n=ie}=t?.meta||{},{qHyperCube:o}=e.getLayout();return o.qSize.qcy*o.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:ae}=oe,se=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=ae}=t?.meta||{},{qHyperCube:o}=e.getLayout();return o.qDimensionInfo.length>1&&!re({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:le}=oe,{MAX_NUM_POINTS:ue,DEFAULT_NUM_POINTS:ce,DEFAULT_NUM_LINES:de}=oe,{DEFAULT_NUM_POINTS:me}=oe,he=({layoutService:e,largeDataService:t})=>{if(!re({layoutService:e,largeDataService:t})){const{maxNumPoints:e=me}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:o=de,maxNumPoints:i=ce,hasInjectedData:r=!1}=t?.meta||{};if(se({layoutService:e,largeDataService:t})*n[0]<=i)return n[0];const a=Math.max(1,Math.min(o,n[1])),s=i/a,l=Math.floor(n[0]<=s?s:s/4),u=2*a*(a+1);return r&&(a>de||i>ce)?Math.min(l,Math.ceil(ue/u)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=le}=t?.meta||{},{measureCount:o=1}=e?.meta||{},i=4+2*(o-1);return Math.floor(n/(o*i))})({layoutService:e,largeDataService:t})};function fe({model:e,layoutService:t,largeDataService:n,definitionPath:o="/qHyperCubeDef"}){return{shouldFetchReduced:()=>re({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>he({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>se({layoutService:t,largeDataService:n}),fetch:(i,r)=>(({start:e,end:t,model:n,layoutService:o,largeDataService:i,definitionPath:r})=>{const a={qStart:e,qEnd:t,qNbrPoints:he({layoutService:o,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:se({layoutService:o,largeDataService:i})};return n.getHyperCubeContinuousData(r,a,!1)})({start:i,end:r,model:e,layoutService:t,largeDataService:n,definitionPath:o})}}function pe(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function ge({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let o=n+e,i=o+t;return 1===t&&0===e&&(o=n-.5,i=n+.5),{zoom:{min:o,max:i}}}(n,t.get("continuousMin"))}}}function ye(){const e=()=>{},t=[],n={};return e.set=(e,o)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=o},e.forEach=e=>{t.forEach((t,o)=>e(n[t],o))},e.has=e=>e in n,e}function ve(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const o=[],i=ye(),r=ye();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(r.has(l)||r.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&o.push(s)}return i.forEach((e,t)=>o.splice(t,0,e)),r.forEach(e=>o.push(e)),o}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const o=[];let i,r;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(r||(r=s)),s[0].qNum>=e&&s[0].qNum<=t&&o.push(s)}return i&&o.unshift(i),r&&o.push(r),o}({start:e,end:t,matrix:n})}function be(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function Me(e,t,n){const o={qDataPages:(n.qDataPages||[]).map(n=>{const o=ve(e,t,n.qMatrix),i=be(n.qArea,o);return{...n,qArea:i,qMatrix:o}})};return n.qAxisData&&n.qAxisData.qAxis&&(o.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,o)=>((o.qStart>=e&&o.qStart<=t||o.qEnd>=e&&o.qEnd<=t||o.qStart<e&&o.qEnd>t)&&n.push(o),n),[])}))}}(e,t,n.qAxisData)),o}const Se=2**.5,xe=1/Se,Ce=xe**44;function qe(e){return e.qIsOtherCell}function Te({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(qe)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(qe)||t++}),t}(n)}const we={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var ke={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const o=t[e],i=t[e+1];o.data={},i||1===o.end?i?(o.data.start=o.value,o.data.end=i.value,o.end=i.position):(o.data.start=o.value,o.data.end=o.value):(o.data.start=o.value,o.data.end=n,o.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const o=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],o.data.start]},x:0,y:0,width:o.start*this.rect.width,height:this.rect.height})}return n}};function Ne(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Le(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function De(e,t){const{localProps:{size:n},props:{anchor:o}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:o}){const i=e.label.padding,r=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>o.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,o)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=o;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},h=s(`${l[0]}…`).width,f=Math.max(0,m.width-u.width),p=Math.max(0,m.height-u.height),g=r*f,y=a*p;return{show:m.width>=Math.min(h,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),r=function({localProps:{size:e},style:t,scale:n,props:o}){const[i,r]=n.domain(),a=Math.max(0,Math.min(1,o.guideLine.major.justify));return{resolve:(n,o)=>{const s=a*o.width,l=Ne(o.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=r,x1:l,y1:0,x2:l,y2:Ne(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const o=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:o,height:t.height}}(e,n,o);return{rect:t,label:i.resolve(e,t),guideLine:r.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const o=e[n-1],i=t[n-1].label;if(o&&o.start===o.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!Le(n.segment,i.segment)}}(e,a),a}function Oe(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:o=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),r=Ne(o.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:r,y1:Ne(i,n.minorGuideLine.strokeWidth),x2:r,y2:Ne(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Ee(e){return e.filter(e=>e.show).map(e=>ne({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Ae={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),o=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const o=Ne(1,t.line.strokeWidth);return{show:n.line.show,x1:Ne(0,t.line.strokeWidth),y1:o,x2:Ne(e.width,t.line.strokeWidth),y2:o,style:t.line}}(this),this.state.major=De(n,this),this.state.minor=Oe(o,this)},render(){return[...Ee([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>ne({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...Ee(this.state.major.map(e=>e.guideLine)),...Ee(this.state.minor.map(e=>e.guideLine))];var e}};function Ie(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pe(e){var t;return 1===e.length&&(t=e,e=function(e,n){return Ie(t(e),n)}),{left:function(t,n,o,i){for(null==o&&(o=0),null==i&&(i=t.length);o<i;){var r=o+i>>>1;e(t[r],n)<0?o=r+1:i=r}return o},right:function(t,n,o,i){for(null==o&&(o=0),null==i&&(i=t.length);o<i;){var r=o+i>>>1;e(t[r],n)>0?i=r:o=r+1}return o}}}var Re=Pe(Ie).right,ze=Math.sqrt(50),Be=Math.sqrt(10),Fe=Math.sqrt(2);function He(e,t,n){var o=(t-e)/Math.max(0,n),i=Math.floor(Math.log(o)/Math.LN10),r=o/Math.pow(10,i);return i>=0?(r>=ze?10:r>=Be?5:r>=Fe?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(r>=ze?10:r>=Be?5:r>=Fe?2:1)}function je(e,t,n){var o=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(o)/Math.LN10)),r=o/i;return r>=ze?i*=10:r>=Be?i*=5:r>=Fe&&(i*=2),t<e?-i:i}function _e(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Ve="$";function Ue(){}function $e(e,t){var n=new Ue;if(e instanceof Ue)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var o,i=-1,r=e.length;if(null==t)for(;++i<r;)n.set(i,e[i]);else for(;++i<r;)n.set(t(o=e[i],i,e),o)}else if(e)for(var a in e)n.set(a,e[a]);return n}function We(){}Ue.prototype=$e.prototype={constructor:Ue,has:function(e){return Ve+e in this},get:function(e){return this[Ve+e]},set:function(e,t){return this[Ve+e]=t,this},remove:function(e){var t=Ve+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ve&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ve&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ve&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ve&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ve&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ve)return!1;return!0},each:function(e){for(var t in this)t[0]===Ve&&e(this[t],t.slice(1),this)}};var Ke=$e.prototype;We.prototype={constructor:We,has:Ke.has,add:function(e){return this[Ve+(e+="")]=e,this},remove:Ke.remove,clear:Ke.clear,values:Ke.keys,size:Ke.size,empty:Ke.empty,each:Ke.each};var Ge=Array.prototype,Ye=Ge.map,Xe=Ge.slice;function Je(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ze(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Qe(){}var et=.7,tt=1/et,nt="\\s*([+-]?\\d+)\\s*",ot="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rt=/^#([0-9a-f]{3,8})$/,at=new RegExp("^rgb\\("+[nt,nt,nt]+"\\)$"),st=new RegExp("^rgb\\("+[it,it,it]+"\\)$"),lt=new RegExp("^rgba\\("+[nt,nt,nt,ot]+"\\)$"),ut=new RegExp("^rgba\\("+[it,it,it,ot]+"\\)$"),ct=new RegExp("^hsl\\("+[ot,it,it]+"\\)$"),dt=new RegExp("^hsla\\("+[ot,it,it,ot]+"\\)$"),mt={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 ht(){return this.rgb().formatHex()}function ft(){return this.rgb().formatRgb()}function pt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=rt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?gt(t):3===n?new bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?yt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?yt(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=at.exec(e))?new bt(t[1],t[2],t[3],1):(t=st.exec(e))?new bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=lt.exec(e))?yt(t[1],t[2],t[3],t[4]):(t=ut.exec(e))?yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ct.exec(e))?Ct(t[1],t[2]/100,t[3]/100,1):(t=dt.exec(e))?Ct(t[1],t[2]/100,t[3]/100,t[4]):mt.hasOwnProperty(e)?gt(mt[e]):"transparent"===e?new bt(NaN,NaN,NaN,0):null}function gt(e){return new bt(e>>16&255,e>>8&255,255&e,1)}function yt(e,t,n,o){return o<=0&&(e=t=n=NaN),new bt(e,t,n,o)}function vt(e,t,n,o){return 1===arguments.length?((i=e)instanceof Qe||(i=pt(i)),i?new bt((i=i.rgb()).r,i.g,i.b,i.opacity):new bt):new bt(e,t,n,null==o?1:o);var i}function bt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Mt(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)}function St(){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 xt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ct(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tt(e,t,n,o)}function qt(e){if(e instanceof Tt)return new Tt(e.h,e.s,e.l,e.opacity);if(e instanceof Qe||(e=pt(e)),!e)return new Tt;if(e instanceof Tt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(a=t===r?(n-o)/s+6*(n<o):n===r?(o-t)/s+2:(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Tt(a,s,l,e.opacity)}function Tt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function wt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function kt(e){return function(){return e}}function Nt(e){return 1===(e=+e)?Lt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):kt(isNaN(t)?n:t)}}function Lt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kt(isNaN(e)?t:e)}Je(Qe,pt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ht,formatHex:ht,formatHsl:function(){return qt(this).formatHsl()},formatRgb:ft,toString:ft}),Je(bt,vt,Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new bt(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:Mt,formatHex:Mt,formatRgb:St,toString:St})),Je(Tt,function(e,t,n,o){return 1===arguments.length?qt(e):new Tt(e,t,n,null==o?1:o)},Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new Tt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new Tt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new bt(wt(e>=240?e-240:e+120,i,o),wt(e,i,o),wt(e<120?e+240:e-120,i,o),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 Dt=function e(t){var n=Nt(t);function o(e,t){var o=n((e=vt(e)).r,(t=vt(t)).r),i=n(e.g,t.g),r=n(e.b,t.b),a=Lt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=i(t),e.b=r(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function Ot(e,t){t||(t=[]);var n,o=e?Math.min(t.length,e.length):0,i=t.slice();return function(r){for(n=0;n<o;++n)i[n]=e[n]*(1-r)+t[n]*r;return i}}function Et(e,t){var n,o=t?t.length:0,i=e?Math.min(o,e.length):0,r=new Array(i),a=new Array(o);for(n=0;n<i;++n)r[n]=Ft(e[n],t[n]);for(;n<o;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=r[n](e);return a}}function At(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function It(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pt(e,t){var n,o={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?o[n]=Ft(e[n],t[n]):i[n]=t[n];return function(e){for(n in o)i[n]=o[n](e);return i}}var Rt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zt=new RegExp(Rt.source,"g");function Bt(e,t){var n,o,i,r=Rt.lastIndex=zt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Rt.exec(e))&&(o=zt.exec(t));)(i=o.index)>r&&(i=t.slice(r,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:It(n,o)})),r=zt.lastIndex;return r<t.length&&(i=t.slice(r),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 n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}function Ft(e,t){var n,o,i=typeof t;return null==t||"boolean"===i?kt(t):("number"===i?It:"string"===i?(n=pt(t))?(t=n,Dt):Bt:t instanceof pt?Dt:t instanceof Date?At:(o=t,!ArrayBuffer.isView(o)||o instanceof DataView?Array.isArray(t)?Et:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pt:It:Ot))(e,t)}function Ht(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jt(e){return+e}var _t=[0,1];function Vt(e){return e}function Ut(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function $t(e){var t,n=e[0],o=e[e.length-1];return n>o&&(t=n,n=o,o=t),function(e){return Math.max(n,Math.min(o,e))}}function Wt(e,t,n){var o=e[0],i=e[1],r=t[0],a=t[1];return i<o?(o=Ut(i,o),r=n(a,r)):(o=Ut(o,i),r=n(r,a)),function(e){return r(o(e))}}function Kt(e,t,n){var o=Math.min(e.length,t.length)-1,i=new Array(o),r=new Array(o),a=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<o;)i[a]=Ut(e[a],e[a+1]),r[a]=n(t[a],t[a+1]);return function(t){var n=Re(e,t,1,o)-1;return r[n](i[n](t))}}function Gt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yt(e,t){return function(){var e,t,n,o,i,r,a=_t,s=_t,l=Ft,u=Vt;function c(){return o=Math.min(a.length,s.length)>2?Kt:Wt,i=r=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=o(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((r||(r=o(s,a.map(e),It)))(n)))},d.domain=function(e){return arguments.length?(a=Ye.call(e,jt),u===Vt||(u=$t(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Xe.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Xe.call(e),l=Ht,c()},d.clamp=function(e){return arguments.length?(u=e?$t(a):Vt,d):u!==Vt},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,o){return e=n,t=o,c()}}()(e,t)}function Xt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,o=e.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+e.slice(n+1)]}function Jt(e){return(e=Xt(Math.abs(e)))?e[1]:NaN}var Zt,Qt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function en(e){if(!(t=Qt.exec(e)))throw new Error("invalid format: "+e);var t;return new tn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function nn(e,t){var n=Xt(e,t);if(!n)return e+"";var o=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+o:o.length>i+1?o.slice(0,i+1)+"."+o.slice(i+1):o+new Array(i-o.length+2).join("0")}en.prototype=tn.prototype,tn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var on={"%":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.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):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 nn(100*e,t)},r:nn,s:function(e,t){var n=Xt(e,t);if(!n)return e+"";var o=n[0],i=n[1],r=i-(Zt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=o.length;return r===a?o:r>a?o+new Array(r-a+1).join("0"):r>0?o.slice(0,r)+"."+o.slice(r):"0."+new Array(1-r).join("0")+Xt(e,Math.max(0,t+r-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function rn(e){return e}var an,sn,ln,un=Array.prototype.map,cn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dn(e){var t=void 0===e.grouping||void 0===e.thousands?rn:function(e,t){return function(n,o){for(var i=n.length,r=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>o&&(s=Math.max(1,o-l)),r.push(n.substring(i-=s,i+s)),!((l+=s+1)>o));)s=e[a=(a+1)%e.length];return r.reverse().join(t)}}(un.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",r=void 0===e.numerals?rn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(un.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function u(e){var u=(e=en(e)).fill,c=e.align,d=e.sign,m=e.symbol,h=e.zero,f=e.width,p=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(p=!0,v="g"):on[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===u&&"="===c)&&(h=!0,u="0",c="=");var b="$"===m?n:"#"===m&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M="$"===m?o:/[%p]/.test(v)?a:"",S=on[v],x=/[defgprs%]/.test(v);function C(e){var n,o,a,m=b,C=M;if("c"===v)C=S(e)+C,e="";else{var q=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:S(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,o=1,i=-1;o<n;++o)switch(e[o]){case".":i=t=o;break;case"0":0===i&&(i=o),t=o;break;default:if(!+e[o])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),q&&0===+e&&"+"!==d&&(q=!1),m=(q?"("===d?d:s:"-"===d||"("===d?"":d)+m,C=("s"===v?cn[8+Zt/3]:"")+C+(q&&"("===d?")":""),x)for(n=-1,o=e.length;++n<o;)if(48>(a=e.charCodeAt(n))||a>57){C=(46===a?i+e.slice(n+1):e.slice(n))+C,e=e.slice(0,n);break}}p&&!h&&(e=t(e,1/0));var T=m.length+e.length+C.length,w=T<f?new Array(f-T+1).join(u):"";switch(p&&h&&(e=t(w+e,w.length?f-C.length:1/0),w=""),c){case"<":e=m+e+C+w;break;case"=":e=m+w+e+C;break;case"^":e=w.slice(0,T=w.length>>1)+m+e+C+w.slice(T);break;default:e=w+m+e+C}return r(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:u,formatPrefix:function(e,t){var n=u(((e=en(e)).type="f",e)),o=3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3))),i=Math.pow(10,-o),r=cn[8+o/3];return function(e){return n(i*e)+r}}}}function mn(e,t,n,o){var i,r=je(e,t,n);switch((o=en(null==o?",f":o)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=o.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3)))-Jt(Math.abs(e)))}(r,a))||(o.precision=i),ln(o,a);case"":case"e":case"g":case"p":case"r":null!=o.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jt(t)-Jt(e))+1}(r,Math.max(Math.abs(e),Math.abs(t))))||(o.precision=i-("e"===o.type));break;case"f":case"%":null!=o.precision||isNaN(i=function(e){return Math.max(0,-Jt(Math.abs(e)))}(r))||(o.precision=i-2*("%"===o.type))}return sn(o)}function hn(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var o,i,r,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((o=t<e)&&(i=e,e=t,t=i),0===(a=He(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),r=new Array(i=Math.ceil(t-e+1));++s<i;)r[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),r=new Array(i=Math.ceil(e-t+1));++s<i;)r[s]=(e-s)/a;return o&&r.reverse(),r}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var o=t();return mn(o[0],o[o.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var o,i=t(),r=0,a=i.length-1,s=i[r],l=i[a];return l<s&&(o=s,s=l,l=o,o=r,r=a,a=o),(o=He(s,l,n))>0?o=He(s=Math.floor(s/o)*o,l=Math.ceil(l/o)*o,n):o<0&&(o=He(s=Math.ceil(s*o)/o,l=Math.floor(l*o)/o,n)),o>0?(i[r]=Math.floor(s/o)*o,i[a]=Math.ceil(l/o)*o,t(i)):o<0&&(i[r]=Math.ceil(s*o)/o,i[a]=Math.floor(l*o)/o,t(i)),e},e}function fn(){var e=Yt(Vt,Vt);return e.copy=function(){return Gt(e,fn())},_e.apply(e,arguments),hn(e)}an=dn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),sn=an.format,ln=an.formatPrefix;var pn=new Date,gn=new Date;function yn(e,t,n,o){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,o,r){var a,s=[];if(n=i.ceil(n),r=null==r?1:Math.floor(r),!(n<o&&r>0))return s;do{s.push(a=new Date(+n)),t(n,r),e(n)}while(a<n&&n<o);return s},i.filter=function(n){return yn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,o){if(e>=e)if(o<0)for(;++o<=0;)for(;t(e,-1),!n(e););else for(;--o>=0;)for(;t(e,1),!n(e););})},n&&(i.count=function(t,o){return pn.setTime(+t),gn.setTime(+o),e(pn),e(gn),Math.floor(n(pn,gn))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(o?function(t){return o(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var vn=yn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});vn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?yn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):vn:null},vn.range;var bn=6e4,Mn=36e5,Sn=864e5,xn=6048e5,Cn=yn(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()});Cn.range;var qn=yn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/Sn},function(e){return e.getDate()-1});function Tn(e){return yn(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-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/xn})}qn.range;var wn=Tn(0),kn=Tn(1),Nn=Tn(2),Ln=Tn(3),Dn=Tn(4),On=Tn(5),En=Tn(6);wn.range,kn.range,Nn.range,Ln.range,Dn.range,On.range,En.range;var An=yn(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()});An.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},An.range;var In=yn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*bn)},function(e,t){return(t-e)/bn},function(e){return e.getUTCMinutes()});In.range;var Pn=yn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Mn)},function(e,t){return(t-e)/Mn},function(e){return e.getUTCHours()});Pn.range;var Rn=yn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Sn},function(e){return e.getUTCDate()-1});function zn(e){return yn(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)/xn})}Rn.range;var Bn=zn(0),Fn=zn(1),Hn=zn(2),jn=zn(3),_n=zn(4),Vn=zn(5),Un=zn(6);Bn.range,Fn.range,Hn.range,jn.range,_n.range,Vn.range,Un.range;var $n=yn(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()});$n.range;var Wn=yn(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 Kn(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 Gn(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 Yn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Wn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Wn.range;var Xn,Jn,Zn={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,eo=/^%/,to=/[\\^$*+?|[\]().{}]/g;function no(e,t,n){var o=e<0?"-":"",i=(o?-e:e)+"",r=i.length;return o+(r<n?new Array(n-r+1).join(t)+i:i)}function oo(e){return e.replace(to,"\\$&")}function io(e){return new RegExp("^(?:"+e.map(oo).join("|")+")","i")}function ro(e){for(var t={},n=-1,o=e.length;++n<o;)t[e[n].toLowerCase()]=n;return t}function ao(e,t,n){var o=Qn.exec(t.slice(n,n+1));return o?(e.w=+o[0],n+o[0].length):-1}function so(e,t,n){var o=Qn.exec(t.slice(n,n+1));return o?(e.u=+o[0],n+o[0].length):-1}function lo(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.U=+o[0],n+o[0].length):-1}function uo(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.V=+o[0],n+o[0].length):-1}function co(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.W=+o[0],n+o[0].length):-1}function mo(e,t,n){var o=Qn.exec(t.slice(n,n+4));return o?(e.y=+o[0],n+o[0].length):-1}function ho(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function fo(e,t,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function po(e,t,n){var o=Qn.exec(t.slice(n,n+1));return o?(e.q=3*o[0]-3,n+o[0].length):-1}function go(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.m=o[0]-1,n+o[0].length):-1}function yo(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.d=+o[0],n+o[0].length):-1}function vo(e,t,n){var o=Qn.exec(t.slice(n,n+3));return o?(e.m=0,e.d=+o[0],n+o[0].length):-1}function bo(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.H=+o[0],n+o[0].length):-1}function Mo(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.M=+o[0],n+o[0].length):-1}function So(e,t,n){var o=Qn.exec(t.slice(n,n+2));return o?(e.S=+o[0],n+o[0].length):-1}function xo(e,t,n){var o=Qn.exec(t.slice(n,n+3));return o?(e.L=+o[0],n+o[0].length):-1}function Co(e,t,n){var o=Qn.exec(t.slice(n,n+6));return o?(e.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function qo(e,t,n){var o=eo.exec(t.slice(n,n+1));return o?n+o[0].length:-1}function To(e,t,n){var o=Qn.exec(t.slice(n));return o?(e.Q=+o[0],n+o[0].length):-1}function wo(e,t,n){var o=Qn.exec(t.slice(n));return o?(e.s=+o[0],n+o[0].length):-1}function ko(e,t){return no(e.getDate(),t,2)}function No(e,t){return no(e.getHours(),t,2)}function Lo(e,t){return no(e.getHours()%12||12,t,2)}function Do(e,t){return no(1+qn.count(An(e),e),t,3)}function Oo(e,t){return no(e.getMilliseconds(),t,3)}function Eo(e,t){return Oo(e,t)+"000"}function Ao(e,t){return no(e.getMonth()+1,t,2)}function Io(e,t){return no(e.getMinutes(),t,2)}function Po(e,t){return no(e.getSeconds(),t,2)}function Ro(e){var t=e.getDay();return 0===t?7:t}function zo(e,t){return no(wn.count(An(e)-1,e),t,2)}function Bo(e){var t=e.getDay();return t>=4||0===t?Dn(e):Dn.ceil(e)}function Fo(e,t){return e=Bo(e),no(Dn.count(An(e),e)+(4===An(e).getDay()),t,2)}function Ho(e){return e.getDay()}function jo(e,t){return no(kn.count(An(e)-1,e),t,2)}function _o(e,t){return no(e.getFullYear()%100,t,2)}function Vo(e,t){return no((e=Bo(e)).getFullYear()%100,t,2)}function Uo(e,t){return no(e.getFullYear()%1e4,t,4)}function $o(e,t){var n=e.getDay();return no((e=n>=4||0===n?Dn(e):Dn.ceil(e)).getFullYear()%1e4,t,4)}function Wo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+no(t/60|0,"0",2)+no(t%60,"0",2)}function Ko(e,t){return no(e.getUTCDate(),t,2)}function Go(e,t){return no(e.getUTCHours(),t,2)}function Yo(e,t){return no(e.getUTCHours()%12||12,t,2)}function Xo(e,t){return no(1+Rn.count(Wn(e),e),t,3)}function Jo(e,t){return no(e.getUTCMilliseconds(),t,3)}function Zo(e,t){return Jo(e,t)+"000"}function Qo(e,t){return no(e.getUTCMonth()+1,t,2)}function ei(e,t){return no(e.getUTCMinutes(),t,2)}function ti(e,t){return no(e.getUTCSeconds(),t,2)}function ni(e){var t=e.getUTCDay();return 0===t?7:t}function oi(e,t){return no(Bn.count(Wn(e)-1,e),t,2)}function ii(e){var t=e.getUTCDay();return t>=4||0===t?_n(e):_n.ceil(e)}function ri(e,t){return e=ii(e),no(_n.count(Wn(e),e)+(4===Wn(e).getUTCDay()),t,2)}function ai(e){return e.getUTCDay()}function si(e,t){return no(Fn.count(Wn(e)-1,e),t,2)}function li(e,t){return no(e.getUTCFullYear()%100,t,2)}function ui(e,t){return no((e=ii(e)).getUTCFullYear()%100,t,2)}function ci(e,t){return no(e.getUTCFullYear()%1e4,t,4)}function di(e,t){var n=e.getUTCDay();return no((e=n>=4||0===n?_n(e):_n.ceil(e)).getUTCFullYear()%1e4,t,4)}function mi(){return"+0000"}function hi(){return"%"}function fi(e){return+e}function pi(e){return Math.floor(+e/1e3)}!function(e){Xn=function(e){var t=e.dateTime,n=e.date,o=e.time,i=e.periods,r=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=io(i),c=ro(i),d=io(r),m=ro(r),h=io(a),f=ro(a),p=io(s),g=ro(s),y=io(l),v=ro(l),b={a:function(e){return a[e.getDay()]},A:function(e){return r[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:ko,e:ko,f:Eo,g:Vo,G:$o,H:No,I:Lo,j:Do,L:Oo,m:Ao,M:Io,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:fi,s:pi,S:Po,u:Ro,U:zo,V:Fo,w:Ho,W:jo,x:null,X:null,y:_o,Y:Uo,Z:Wo,"%":hi},M={a:function(e){return a[e.getUTCDay()]},A:function(e){return r[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ko,e:Ko,f:Zo,g:ui,G:di,H:Go,I:Yo,j:Xo,L:Jo,m:Qo,M:ei,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:fi,s:pi,S:ti,u:ni,U:oi,V:ri,w:ai,W:si,x:null,X:null,y:li,Y:ci,Z:mi,"%":hi},S={a:function(e,t,n){var o=h.exec(t.slice(n));return o?(e.w=f[o[0].toLowerCase()],n+o[0].length):-1},A:function(e,t,n){var o=d.exec(t.slice(n));return o?(e.w=m[o[0].toLowerCase()],n+o[0].length):-1},b:function(e,t,n){var o=y.exec(t.slice(n));return o?(e.m=v[o[0].toLowerCase()],n+o[0].length):-1},B:function(e,t,n){var o=p.exec(t.slice(n));return o?(e.m=g[o[0].toLowerCase()],n+o[0].length):-1},c:function(e,n,o){return q(e,t,n,o)},d:yo,e:yo,f:Co,g:ho,G:mo,H:bo,I:bo,j:vo,L:xo,m:go,M:Mo,p:function(e,t,n){var o=u.exec(t.slice(n));return o?(e.p=c[o[0].toLowerCase()],n+o[0].length):-1},q:po,Q:To,s:wo,S:So,u:so,U:lo,V:uo,w:ao,W:co,x:function(e,t,o){return q(e,n,t,o)},X:function(e,t,n){return q(e,o,t,n)},y:ho,Y:mo,Z:fo,"%":qo};function x(e,t){return function(n){var o,i,r,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Zn[o=e.charAt(++s)])?o=e.charAt(++s):i="e"===o?" ":"0",(r=t[o])&&(o=r(n,i)),a.push(o),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var o,i,r=Yn(1900,void 0,1);if(q(r,e,n+="",0)!=n.length)return null;if("Q"in r)return new Date(r.Q);if("s"in r)return new Date(1e3*r.s+("L"in r?r.L:0));if(t&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"V"in r){if(r.V<1||r.V>53)return null;"w"in r||(r.w=1),"Z"in r?(i=(o=Gn(Yn(r.y,0,1))).getUTCDay(),o=i>4||0===i?Fn.ceil(o):Fn(o),o=Rn.offset(o,7*(r.V-1)),r.y=o.getUTCFullYear(),r.m=o.getUTCMonth(),r.d=o.getUTCDate()+(r.w+6)%7):(i=(o=Kn(Yn(r.y,0,1))).getDay(),o=i>4||0===i?kn.ceil(o):kn(o),o=qn.offset(o,7*(r.V-1)),r.y=o.getFullYear(),r.m=o.getMonth(),r.d=o.getDate()+(r.w+6)%7)}else("W"in r||"U"in r)&&("w"in r||(r.w="u"in r?r.u%7:"W"in r?1:0),i="Z"in r?Gn(Yn(r.y,0,1)).getUTCDay():Kn(Yn(r.y,0,1)).getDay(),r.m=0,r.d="W"in r?(r.w+6)%7+7*r.W-(i+5)%7:r.w+7*r.U-(i+6)%7);return"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Gn(r)):Kn(r)}}function q(e,t,n,o){for(var i,r,a=0,s=t.length,l=n.length;a<s;){if(o>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(r=S[i in Zn?t.charAt(a++):i])||(o=r(e,n,o))<0)return-1}else if(i!=n.charCodeAt(o++))return-1}return o}return b.x=x(n,b),b.X=x(o,b),b.c=x(t,b),M.x=x(n,M),M.X=x(o,M),M.c=x(t,M),{format:function(e){var t=x(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+="",M);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}(e),Xn.format,Xn.parse,Jn=Xn.utcFormat,Xn.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"]});var gi=1e3,yi=6e4,vi=36e5,bi=864e5,Mi=2592e6,Si=31536e6;function xi(e){return new Date(e)}function Ci(e){return e instanceof Date?+e:+new Date(+e)}function qi(e,t,n,o,i,r,a,s,l){var u=Yt(Vt,Vt),c=u.invert,d=u.domain,m=l(".%L"),h=l(":%S"),f=l("%I:%M"),p=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),M=[[a,1,gi],[a,5,5e3],[a,15,15e3],[a,30,3e4],[r,1,yi],[r,5,3e5],[r,15,9e5],[r,30,18e5],[i,1,vi],[i,3,108e5],[i,6,216e5],[i,12,432e5],[o,1,bi],[o,2,1728e5],[n,1,6048e5],[t,1,Mi],[t,3,7776e6],[e,1,Si]];function S(s){return(a(s)<s?m:r(s)<s?h:i(s)<s?f:o(s)<s?p:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function x(t,n,o,i){if(null==t&&(t=10),"number"==typeof t){var r=Math.abs(o-n)/t,a=Pe(function(e){return e[2]}).right(M,r);a===M.length?(i=je(n/Si,o/Si,t),t=e):a?(i=(a=M[r/M[a-1][2]<M[a][2]/r?a-1:a])[1],t=a[0]):(i=Math.max(je(n,o,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(Ye.call(e,Ci)):d().map(xi)},u.ticks=function(e,t){var n,o=d(),i=o[0],r=o[o.length-1],a=r<i;return a&&(n=i,i=r,r=n),n=(n=x(e,i,r,t))?n.range(i,r+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?S:l(t)},u.nice=function(e,t){var n=d();return(e=x(e,n[0],n[n.length-1],t))?d(function(e,t){var n,o=0,i=(e=e.slice()).length-1,r=e[o],a=e[i];return a<r&&(n=o,o=i,i=n,n=r,r=a,a=n),e[o]=t.floor(r),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return Gt(u,qi(e,t,n,o,i,r,a,s,l))},u}function Ti(){return _e.apply(qi(Wn,$n,Bn,Rn,Pn,In,Cn,vn,Jn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function wi(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function ki(e){return e.qTags.indexOf("$qualified")>-1}function Ni({qAxis:e}){const t=[],n=[];for(let o=0;o<e.length;o++){const i=o+1,r=e[o],a=e[i];wi(r,a)?(ki(a)?(t.push(i),n.push(o)):(t.push(o),n.push(i)),o++):(t.push(o),n.push(o))}return{qualified:t,nonQualified:n}}function Li({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let o,i=NaN,r=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,o=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){r="auto",s=!0;break}if(e&&e.queries.inner(n)){r=e.index;const o=t[l+2];o&&o.queries.minor(n)&&(a=o.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(r)&&"auto"!==r){r=i,i=NaN;const e=t[o+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",r="auto");return{outer:i,inner:r,minor:a,isDayOrShorter:s}}}}function Di({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:o}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map(e=>Math.abs(o(e.qStart)-o(e.qEnd)))):0,i.maxRange),rangeAndWidth(){const n=o.clamp();return o.clamp(!1),i.rangeAndWidth=e.map(e=>({range:Math.abs(o(e.qStart)-o(e.qEnd)),width:t(`${e.qText}`).width+16})),o.clamp(n),i.rangeAndWidth}}}function Oi({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Ei({qualified:e,nonQualified:t,qAxis:n,measureText:o,reqAutoFitWidth:i,scale:r},{attributesFactory:a=Di,queryFactory:s=Oi}={attributesFactory:Di,queryFactory:Oi}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:o,scale:r});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 Ai({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:o=0,scale:i},{metaFactory:r=Ei,mapper:a=Ni,resolver:s=Li}={metaFactory:Ei,mapper:Ni,resolver:Li}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=r({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:o,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const o=n.key({distance:t});if(n.get(o))return n.get(o);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 n.set(o,i),i}}}function Ii(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Pi=Ii(0).getTime();function Ri(e){return(e.getTime()-Pi)/86400/1e3}const zi=new Date,Bi=new Date;function Fi(e,t,n,o){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,o,r)=>{const a=[];if(n=i.ceil(n),r=null==r?1:Math.floor(r),!(n<o&&r>0))return a;let s;do{a.push(s=new Date(+n)),t(n,r),e(n)}while(s<n&&n<o);return a},i.filter=n=>Fi(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,o)=>{if(e>=e)if(o<0)for(;++o<=0;)for(;t(e,-1),!n(e););else for(;--o>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,o)=>(zi.setTime(+t),Bi.setTime(+o),e(zi),e(Bi),Math.floor(n(zi,Bi))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(o?t=>o(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Hi=1e3,ji=6e4,_i=36e5,Vi=864e5,Ui=6048e5,$i=Fi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCSeconds());$i.range;const Wi=Fi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getMinutes());Wi.range;const Ki=Fi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCMinutes());Ki.range;const Gi=Fi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi-e.getMinutes()*ji)},(e,t)=>{e.setTime(+e+t*_i)},(e,t)=>(t-e)/_i,e=>e.getHours());Gi.range;const Yi=Fi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_i)},(e,t)=>(t-e)/_i,e=>e.getUTCHours());Yi.range;const Xi=Fi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/Vi,e=>e.getDate()-1);Xi.range;const Ji=Fi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vi,e=>e.getUTCDate()-1);Ji.range;const Zi=Fi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vi,e=>Math.floor(e/Vi));function Qi(e){return Fi(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/Ui)}Zi.range;const er=Qi(0),tr=Qi(1),nr=Qi(2),or=Qi(3),ir=Qi(4),rr=Qi(5),ar=Qi(6);function sr(e){return Fi(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Ui)}er.range,tr.range,nr.range,or.range,ir.range,rr.range,ar.range;const lr=sr(0),ur=sr(1),cr=sr(2),dr=sr(3),mr=sr(4),hr=sr(5),fr=sr(6);lr.range,ur.range,cr.range,dr.range,mr.range,hr.range,fr.range;const pr=Fi(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());pr.range;const gr=Fi(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());gr.range;const yr=Fi(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());yr.every=e=>isFinite(e=Math.floor(e))&&e>0?Fi(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,yr.range;const vr=Fi(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());vr.every=e=>isFinite(e=Math.floor(e))&&e>0?Fi(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,vr.range;const br=1,Mr=2,Sr=3,xr=4,Cr=5,qr=6;function Tr({timeScale:e,labels:t,distance:n,isDayOrShorter:o,cache:i,timeOnly:r,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,o,i,r){function a(e){return vr.filter(t=>(t.getUTCFullYear()-r.getUTCFullYear())%e===0)}const s=$i.count(e,t),l=Ki.count(e,t),u=Yi.count(e,t),c=Ji.count(e,t),d=lr.count(e,t),m=gr.count(e,t),h=vr.count(e,t),f=n/o.second.width-1,p=n/o.minute.width-1,g=n/o.date.width-1,y=n/o.year.width-1,v={type:"year",desc:"year",count:h,interval:vr.every(1),formatter:o.year.formatter,offset:e=>vr.offset(e,-1),floor:vr.floor};if(s<=f)v.type=br,v.desc="second",v.count=s,v.interval=$i.every(1),v.formatter=o.second.formatter,v.offset=e=>$i.offset(e,-1),v.floor=$i.floor;else if(s/2<=f)v.type=br,v.desc="every other second",v.count=s/2,v.interval=$i.every(2),v.formatter=o.second.formatter,v.offset=e=>$i.offset(e,-2),v.floor=$i.floor;else if(s/5<=f)v.type=br,v.desc="every 5 second",v.count=s/5,v.interval=$i.every(5),v.formatter=o.second.formatter,v.offset=e=>$i.offset(e,-5),v.floor=$i.floor;else if(s/15<=f)v.type=br,v.desc="every 15 second",v.count=s/15,v.interval=$i.every(15),v.formatter=o.second.formatter,v.offset=e=>$i.offset(e,-15),v.floor=$i.floor;else if(s/30<=f)v.type=br,v.desc="every 30 second",v.count=s/30,v.interval=$i.every(30),v.formatter=o.second.formatter,v.offset=e=>$i.offset(e,-30),v.floor=$i.floor;else if(l<=p)v.type=Mr,v.desc="minute",v.count=l,v.interval=Ki.every(1),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-1),v.floor=Ki.floor;else if(l/2<=p)v.type=Mr,v.desc="every 2 minute",v.count=l/2,v.interval=Ki.every(2),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-2),v.floor=Ki.floor;else if(l/5<=p)v.type=Mr,v.desc="every 5 minute",v.count=l/5,v.interval=Ki.every(5),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-5),v.floor=Ki.floor;else if(l/10<=p)v.type=Mr,v.desc="every 10 minute",v.count=l/10,v.interval=Ki.every(10),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-10),v.floor=Ki.floor;else if(l/15<=p)v.type=Mr,v.desc="every 15 minute",v.count=l/15,v.interval=Ki.every(15),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-15),v.floor=Ki.floor;else if(l/30<=p)v.type=Mr,v.desc="every 30 minute",v.count=l/30,v.interval=Ki.every(30),v.formatter=o.minute.formatter,v.offset=e=>Ki.offset(e,-30),v.floor=Ki.floor;else if(u<=p)v.type=Sr,v.desc="hour",v.count=u,v.interval=Yi.every(1),v.formatter=o.minute.formatter,v.offset=e=>Yi.offset(e,-1),v.floor=Yi.floor;else if(u/2<=p)v.type=Sr,v.desc="every 2 hour",v.count=u/2,v.interval=Yi.every(2),v.formatter=o.minute.formatter,v.offset=e=>Yi.offset(e,-2),v.floor=Yi.floor;else if(u/3<=p)v.type=Sr,v.desc="every 3 hour",v.count=u/3,v.interval=Yi.every(3),v.formatter=o.minute.formatter,v.offset=e=>Yi.offset(e,-3),v.floor=Yi.floor;else if(u/6<=p)v.type=Sr,v.desc="every 6 hour",v.count=u/6,v.interval=Yi.every(6),v.formatter=o.minute.formatter,v.offset=e=>Yi.offset(e,-6),v.floor=Yi.floor;else if(u/12<=p||i)v.type=Sr,v.desc="every 12 hour",v.count=u/12,v.interval=Yi.every(12),v.formatter=o.minute.formatter,v.offset=e=>Yi.offset(e,-12),v.floor=Yi.floor;else if(c<=g)v.type=xr,v.desc="day",v.count=c,v.interval=Ji.every(1),v.formatter=o.date.formatter,v.offset=e=>Ji.offset(e,-1),v.floor=Ji.floor;else if(c/2<=g)v.type=xr,v.desc="every 2 day",v.count=c/2,v.interval=Ji.every(2),v.formatter=o.date.formatter,v.offset=e=>Ji.offset(e,-2),v.floor=Ji.floor;else if(c/3<=g)v.type=xr,v.desc="every 3 day",v.count=c/3,v.interval=Ji.every(3),v.formatter=o.date.formatter,v.offset=e=>Ji.offset(e,-3),v.floor=Ji.floor;else if(d<=g)v.type=xr,v.desc="week",v.count=d,v.interval=lr.every(1),v.formatter=o.date.formatter,v.offset=e=>lr.offset(e,-1),v.floor=Ji.floor;else if(d/2<=g)v.type=xr,v.desc="every 2 week",v.count=d/2,v.interval=lr.every(2),v.formatter=o.date.formatter,v.offset=e=>lr.offset(e,-2),v.floor=Ji.floor;else if(m<=g)v.type=Cr,v.desc="month",v.count=m,v.interval=gr.every(1),v.formatter=o.date.formatter,v.offset=e=>gr.offset(e,-1),v.floor=Ji.floor;else if(m/3<=g)v.type=Cr,v.desc="quarter",v.count=m/3,v.interval=gr.every(3),v.formatter=o.date.formatter,v.offset=e=>gr.offset(e,-3),v.floor=Ji.floor;else if(m/6<=g)v.type=Cr,v.desc="half year",v.count=m/6,v.interval=gr.every(6),v.formatter=o.date.formatter,v.offset=e=>gr.offset(e,-6),v.floor=Ji.floor;else if(h<=y)v.type=qr,v.desc="year",v.count=h,v.interval=vr.every(1),v.formatter=o.year.formatter,v.offset=e=>vr.offset(e,-1),v.floor=vr.floor;else if(h/2<=y)v.type=qr,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=o.year.formatter,v.offset=e=>vr.offset(e,-2),v.floor=vr.floor;else if(h/5<=y)v.type=qr,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=o.year.formatter,v.offset=e=>vr.offset(e,-5),v.floor=vr.floor;else if(h/10<=y)v.type=qr,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=o.year.formatter,v.offset=e=>vr.offset(e,-10),v.floor=vr.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=qr,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=o.year.formatter,v.offset=t=>vr.offset(t,-e),v.floor=vr.floor}return v}(s,l,n,t.all(),o,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,n)=>{const o=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+o),formatter:c.formatter}});let h=[];if(!r&&c.type<=Sr){const n=t.getFormat("date"),o=e.ticks(Ji.every(1));o.length&&s.getUTCDate()!==o[0].getUTCDate()&&o.unshift(Ji.offset(o[0],-1)),h=(o.length?o:[Ji.floor(s)]).map((e,t,o)=>{const i=o[t+1]?o[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}})}return{inner:m,outer:h}}const wr=86400,kr=1440,Nr={};function Lr(e,t,n,o){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:o}}function Dr(e,t,n){const{generator:o,anchor:i,clamp:r,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(r);const[l,u]=e.domain(),c=Ti().domain([Ii(l),Ii(u)]);c.clamp(r),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof o?o:{type:o};let m;m="d3"===d.type?(e,i)=>Tr({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Ii(o.initialMin)}):e=>function(e,t,n,o,i,r=!1){if(Nr[[t,n,o,o,r]])return Nr[[t,n,o,o,r]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Ii(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=o-n,m=t/(i-o),h=m/1440,f=m/wr,p=366*m,g=3*m*30,y=a.second.width/f,v=a.minute.width/h,b=a.date.width/g,M=a.year.width/p;let S,x,C,q=0,T=0,w=null,k=null,N=null,L=null,D=null,O=null;const E={outer:[],inner:[]};for(y<1?(w=1,T=1/wr):y<2?(w=2,T=1/wr*2):y<5?(w=5,T=1/wr*5):y<10?(w=10,T=1/wr*10):y<30?(w=30,T=1/wr*30):v<1?(k=1,T=1/kr):v<2?(k=2,T=1/kr*2):v<5?(k=5,T=1/kr*5):v<10?(k=10,T=.006944444444444445):v<30?(k=30,T=.020833333333333336):v<60?(N=1,T=1/24):v<120?(N=2,T=2/24):v<360?(N=6,T=.25):v<720?(N=12,T=.5):b<1/90?(T=1,L=1):b<2/90?(T=2,L=2):b<7/90?(T=7,L=7):b<31/90?(D=1,T=31):b<1?(D=3,T=90):M<1?(O=1,T=366):M<2?(O=2,T=732):M<5?(O=5,T=1826.25):(O=10,T=3652.5),x=Math.floor((d+n%1)/T);q<i;){C=x+1,S=O?Lr("year",[l+x*O,0,1],[l+C*O,0,1],a.year.formatter):D?Lr("month",[l,u+x*D,1],[l,u+C*D,1],a.date.formatter):L?Lr("day",[l,u,c+x*L],[l,u,c+C*L],a.date.formatter):N?Lr("hour",[l,u,c,0+x*N],[l,u,c,0+C*N],a.minute.formatter):k?Lr("minute",[l,u,c,0,0+x*k],[l,u,c,0,0+C*k],a.minute.formatter):Lr("second",[l,u,c,0,0,0+x*w],[l,u,c,0,0,0+C*w],a.second.formatter),q=Ri(S.start),E.inner.push(S);const e=Math.floor(q);if(!(r||O||D||L)){const t={type:"day",start:Ii(e),end:Ii(e+1),formatter:a.date.formatter,qStart:e};E.outer[E.outer.length-1]&&E.outer[E.outer.length-1].qStart===t.qStart||E.outer.push(t)}x++}return E.min=o,E.max=i,Nr[[t,n,o,o,r]]=E,E}(n,e,d.min,l,u,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let o;o="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const r=e.clamp();n&&e.clamp(!1);const a=e(o),s=e(t.qStart),l=e(t.qEnd);return e.clamp(r),{value:o,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>m(t,n)[a].map(t=>{let n;return n="start"===i?Ri(t.start):"end"===i?Ri(t.end):(Ri(t.start)+Ri(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Ri(t.start),end:Ri(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const Or=/t+/i;const Er={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 Ar(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 Ir="continuousPan";var Pr={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:o=we,viewCache:i,viewState:r,definitionPath:a},s={}){const{engineFetcherFactory:l=fe,snapshotFetcherFactory:u=ge,cacheFetcherFactory:c=pe,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),h=u({layoutService:t,viewCache:i}),f=c({cache:d}),p=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,o;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,o=v,Math.max(1e-6,(o-n)*Ce))),g=t.meta.isSnapshot?h:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=h.getSnapshotData()),r.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:o}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",o),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=be(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return o.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e}).then(e=>Me(y,v,e)).then(e=>this.updateLayout(e)).catch(p)},fetch:(e,t)=>g.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const o=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,o=t[t.length-1][0].qNum,i=[],r=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>o&&r.push(e[t])}return[...i,...t,...r]}(e.qMatrix,t.qDataPages[n].qMatrix),i=be(e.qArea,o);return{...e,qArea:i,qMatrix:o}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),o=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,r=e.qAxis.length;t<r;t++){const r=e.qAxis[t],a=n.indexOf(r.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=o[a];for(let n=0,o=r.qTicks.length;n<o;n++){const o=r.qTicks[n];o.qStart<e?s.push(o):o.qStart>t&&l.push(o)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e)).then(e=>(o.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e)).then(n=>Me(e,t,n)).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then(n=>Me(e,t,n)),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return ne({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return ne({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Te(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=o.query.getShouldProcess()?[o.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:o}=e;function r(e,n,i){return o[e](n,i).then(e=>(o.updateLayout(e),t(),e))}const a=i((e,t)=>r("fetch",e,t),50);return({min:e,max:t},{min:o,max:i})=>!n.meta.isContinuous||e===o&&t===i?Promise.resolve(null):r("fetchFromCache",e,t).then(n=>(a(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,o=NaN;return(i,r)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),o=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<o?r:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:o=50,rtl:i=!1,targetKey:a}){const s=e.get("continuousMin"),l=e.get("continuousMax");return r((e,o)=>{const r=(e=>n.componentsFromPoint(e).filter(e=>e.key===a)[0])(e);if(r){const a=function(e,t,n){let{x:o}=e;return o-=t.element.getBoundingClientRect().left,o-=n.rect.x,Math.max(0,Math.min(1,o/n.rect.width))}(e,n,r),u=i?1-a:a,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),h=m-(o>0?xe:Se)*m,f=c+h*u,p=d-h*(1-u),g=f<s?s-f:0,y=p>l?p-l:0;t.set("zoom",{min:Math.max(f-y,s),max:Math.min(p+g,l)})}},o)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:o,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Ir,pointers:1,threshold:10,enable(o,i){return this.started===Ir||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)}},events:{[`${Ir}start`](n){n.preventDefault(),this.started=Ir;const{min:i,max:r}=o.get("zoom");this[Ir]={min:i,max:r,size:t.component(e).rect.computedInner.width,span:r-i}},[`${Ir}move`](e){e.preventDefault();const{span:t,min:n,max:r,size:a}=this[Ir],s=-e.deltaX/a;o.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(r+s*t,i.get("continuousMin")+t)})},[`${Ir}end`](e){e.preventDefault(),this.started=!1},[`${Ir}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:ke,timeAxis:Ae},picassoScales:{time:function e(t,n={}){const o=function(e,t,n){const o={};return Object.keys(t).forEach(i=>{const r=e[i],a=typeof r;"function"===a?o[i]=r(n):"object"!==a||Array.isArray(r)?o[i]="undefined"===a?t[i]:r:o[i]=ne(!0,{},t[i],r)}),o}(t,Er,n),{qAxis:i}=o,r=fn(),s={instance:null,invert:!1},{min:l,max:u}=function(e,t){let n=+e.min,o=+e.max;return Number.isNaN(n)&&Number.isNaN(o)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),o=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===o&&(n-=.5,o+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+o)?1:o}}(o,i);let c,d,m=[];const h=function(e){return Number.isNaN(+e)?NaN:r(e)};h.ticks=({distance:e,resolve:t=c.resolve}={})=>{const n=t(e),r=n[o.ticks.level];if(Number.isNaN(+r)||(m=d.transform(i[r].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(i[n.minor].qTicks,{isMinor:!0});m=m.concat(e)}return"auto"===r&&(m=d.generate(e,n.isDayOrShorter)),m},h.invert=e=>r.invert(e),h.domain=e=>Array.isArray(e)?r.domain(e):r.domain(),h.range=e=>Array.isArray(e)?r.range(e):r.range(),h.norm=e=>(Ar(s,h),s.instance(e)),h.normInvert=e=>(Ar(s,h),s.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(r.clamp(e),r.clamp()),h.min=()=>Math.min(l,u),h.max=()=>Math.max(l,u),r.range(o.invert?[1,0]:[0,1]),r.domain([l,u]),s.invert=o.invert;const f=function(e){const t={},{measureText:n,fn:o,localeInfo:i}=e.formatter,r={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&&Or.test(i.qTimestampFmt)&&(r.minute.pattern+=" tt",r.second.pattern+=" tt"),r.date.pattern=i&&i.qDateFmt?i.qDateFmt:r.date.pattern,Object.keys(r).forEach(e=>{r[e].formatter=o(r[e].pattern),r[e].width=Math.max(r[e].width,n(r[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>r[e],t.all=()=>r,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return r.date;const o=Ii(t[0].data.start),i=Ii(t[n-1].data.start);return Ji.count(o,i)/n>=1?r.date:Yi.count(o,i)/n>0?r.minute:Ki.count(o,i)/n>0?r.second:r.date},t}(o);return d=Dr(r.copy(),o,f),c=Ai({qAxis:i,measureText:o.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:o.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${o.field}`,key:()=>o.field,raw:a(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>f.getFormatFromTicks(m).formatter,h}}};const Rr=[["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}]],zr={};Rr.forEach(([e,{width:t,height:n}])=>{zr[e]={width:t,height:n}});const Br={getLayoutModes:()=>zr,getLayoutMode(e,t){let n;for(n=0;n<Rr.length;++n)if(e>=Rr[n][1].width&&t>=Rr[n][1].height)return Rr[n][0];return"SPARK"}};function Fr(e,t){return{layoutModes:Br.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}}const Hr=["$date","$timestamp","$time"],jr=["D","TS","T"],_r={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>Hr.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&jr.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(_r.hasTimeTag(t)&&_r.hasUnknownFormat(t)||_r.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&_r.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&_r.canBeContinuousDimension(t[0])},maxNumberOfLines:12},Vr=/^[A-Z][A-z0-9_]*$/i,Ur={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},$r={setValue:(e,t,n)=>{if(!t)return!1;const o=t.split("."),i=o[o.length-1];let r,a=e;for(r=0;r<o.length-1;++r)void 0===a[o[r]]&&(a[o[r]]=Number.isNaN(+o[r+1])?{}:[]),a=a[o[r]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const o=t.split(".");let i,r=e;if(void 0===r)return n;for(i=0;i<o.length;++i){if(void 0===r[o[i]])return n;r=r[o[i]]}return r},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||Vr.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Ur.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},Wr=e=>$r.getValue(e,"qHyperCube.qDimensionInfo",[]),Kr=e=>$r.getValue(e,"qHyperCube.qMeasureInfo",[]),Gr=e=>$r.getValue(e,"barGrouping.grouping"),Yr={continuous:(e,t=!1)=>!!_r.canBeContinuous(e)&&($r.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!Wr(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===Gr(e)&&(Wr(e).length>1||Kr(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&Wr(e).length>1&&1===Kr(e).length},groupedByMeasure(e){return this.grouped(e)&&1===Wr(e).length&&Kr(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==Gr(e)&&"butterfly"!==Gr(e)||this.continuous(e))&&(Wr(e).length>1||Kr(e).length>1)},stackedByDimension(e){return this.stacked(e)&&Wr(e).length>1&&1===Kr(e).length},stackedByMeasure(e){return this.stacked(e)&&1===Wr(e).length&&Kr(e).length>1},simple:e=>0===Wr(e).length||1===Wr(e).length&&1===Kr(e).length,snapshot:e=>!!$r.getValue(e,"snapshotData")};function Xr(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Jr=e=>{throw e.isHandled=!0,e};const Zr={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":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?Zr.getVerticalDock(t):n?Zr.getOppositeDock(Zr.getHorizontalDock(t)):Zr.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n};var Qr=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const ea=166/26,ta=12/11,na={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*ea)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),o=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,o=o?o.length:0;const i=t+n+o;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const o={latin:0,cjk:0};let i;void 0===t?e.forEach(e=>{i=na.getCharacterRatios(e[n]),o.latin+=i.latin,o.cjk+=i.cjk}):e.forEach(e=>{i=na.getCharacterRatios(e[t][n]),o.latin+=i.latin,o.cjk+=i.cjk});const r=Math.max(1,o.latin+o.cjk);return o.latinRatio=o.latin/r,o.cjkRatio=o.cjk/r,o},getAdjustedMaxGlyphCount(e,t,n,o="qText"){const i=na.getTotalCharacterRatios(t,n,o),r=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(na.stringWidthOverMWidth(r)+a*ta)}},oa="#la-vie-tooltip";function ia(){if(!document.querySelector(oa)){const e=document.createElement("div");e.id="la-vie-tooltip",e.setAttribute("data-qs-css",""),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 ra({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ia()},beforeUpdate(){ia()},destroyed(){!function(){const e=document.querySelector(oa);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(oa),content:({h:e,data:t,style:n})=>t[0].map(t=>e("tr",{},function(e,{h:t,style:n}){return e.map(e=>{const o={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(o.colspan=e.colspan),t("td",o,e.content)})}(t,{h:e,style:n}))),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:'"Source Sans Pro", "Arial", "sans-serif"',"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const aa=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),sa=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),la=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ua={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>aa.test(e),isRtlChar:e=>sa.test(e)||la.test(e),detectTextDirection(e){const t=e?e.length:0;let n,o;for(n=0;n<t;n++){if(o=e[n],ua.isLtrChar(o))return"ltr";if(ua.isRtlChar(o))return"rtl"}return"ltr"}},ca={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,n){const o=t.data,i=e.resources.formatter,r=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&o.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(o.fillTooltip.value):o.fillTooltip.label?o.fillTooltip.label:o.fillTooltip.value,!n.coloring.label){const e=r(o.fillTooltip.source.key).field(o.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===o._fillColor?ca.getNodeFillColor(t):o._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 n=ua.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=ua.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const o=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:o,style:{"font-weight":"bold","text-align":n?"right":"left",direction:ua.detectTextDirection(o)},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,n){const o=ua.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],r=ua.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:o}},{content:n?[t.color.value,ca.getColorSymbol(e,t)]:[ca.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:r,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,o,i=!1){const r=ua.detectTextDirection(e.label),a=o?[":",e.label]:[e.label,":"],s=ua.detectTextDirection(e.value);let l;return l=i?o?[e.value,ca.getColorSymbol(t,n)]:[ca.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":o?"right":"left",direction:r}},{content:l,style:{"text-align":o?"left":"right",direction:s,"vertical-align":"middle"}}]}};function da(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ma(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function ha(){}var fa=.7,pa=1/fa,ga="\\s*([+-]?\\d+)\\s*",ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",va="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ba=/^#([0-9a-f]{3,8})$/,Ma=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),Sa=new RegExp(`^rgb\\(${va},${va},${va}\\)$`),xa=new RegExp(`^rgba\\(${ga},${ga},${ga},${ya}\\)$`),Ca=new RegExp(`^rgba\\(${va},${va},${va},${ya}\\)$`),qa=new RegExp(`^hsl\\(${ya},${va},${va}\\)$`),Ta=new RegExp(`^hsla\\(${ya},${va},${va},${ya}\\)$`),wa={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 ka(){return this.rgb().formatHex()}function Na(){return this.rgb().formatRgb()}function La(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ba.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Da(t):3===n?new Aa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Oa(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Oa(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=Ma.exec(e))?new Aa(t[1],t[2],t[3],1):(t=Sa.exec(e))?new Aa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=xa.exec(e))?Oa(t[1],t[2],t[3],t[4]):(t=Ca.exec(e))?Oa(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=qa.exec(e))?Fa(t[1],t[2]/100,t[3]/100,1):(t=Ta.exec(e))?Fa(t[1],t[2]/100,t[3]/100,t[4]):wa.hasOwnProperty(e)?Da(wa[e]):"transparent"===e?new Aa(NaN,NaN,NaN,0):null}function Da(e){return new Aa(e>>16&255,e>>8&255,255&e,1)}function Oa(e,t,n,o){return o<=0&&(e=t=n=NaN),new Aa(e,t,n,o)}function Ea(e){return e instanceof ha||(e=La(e)),e?new Aa((e=e.rgb()).r,e.g,e.b,e.opacity):new Aa}function Aa(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Ia(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}`}function Pa(){const e=Ra(this.opacity);return`${1===e?"rgb(":"rgba("}${za(this.r)}, ${za(this.g)}, ${za(this.b)}${1===e?")":`, ${e})`}`}function Ra(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function za(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ba(e){return((e=za(e))<16?"0":"")+e.toString(16)}function Fa(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ja(e,t,n,o)}function Ha(e){if(e instanceof ja)return new ja(e.h,e.s,e.l,e.opacity);if(e instanceof ha||(e=La(e)),!e)return new ja;if(e instanceof ja)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(a=t===r?(n-o)/s+6*(n<o):n===r?(o-t)/s+2:(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new ja(a,s,l,e.opacity)}function ja(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function _a(e){return(e=(e||0)%360)<0?e+360:e}function Va(e){return Math.max(0,Math.min(1,e||0))}function Ua(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}da(ha,La,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ka,formatHex:ka,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ha(this).formatHsl()},formatRgb:Na,toString:Na}),da(Aa,function(e,t,n,o){return 1===arguments.length?Ea(e):new Aa(e,t,n,null==o?1:o)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Aa(za(this.r),za(this.g),za(this.b),Ra(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ia,formatHex:Ia,formatHex8:function(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}${Ba(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Pa,toString:Pa})),da(ja,function(e,t,n,o){return 1===arguments.length?Ha(e):new ja(e,t,n,null==o?1:o)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new ja(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Aa(Ua(e>=240?e-240:e+120,i,o),Ua(e,i,o),Ua(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new ja(_a(this.h),Va(this.s),Va(this.l),Ra(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ra(this.opacity);return`${1===e?"hsl(":"hsla("}${_a(this.h)}, ${100*Va(this.s)}%, ${100*Va(this.l)}%${1===e?")":`, ${e})`}`}}));const $a=Math.PI/180,Wa=180/Math.PI,Ka=.96422,Ga=.82521,Ya=4/29,Xa=6/29,Ja=3*Xa*Xa,Za=Xa*Xa*Xa;function Qa(e){if(e instanceof es)return new es(e.l,e.a,e.b,e.opacity);if(e instanceof as)return ss(e);e instanceof Aa||(e=Ea(e));var t,n,o=is(e.r),i=is(e.g),r=is(e.b),a=ts((.2225045*o+.7168786*i+.0606169*r)/1);return o===i&&i===r?t=n=a:(t=ts((.4360747*o+.3850649*i+.1430804*r)/Ka),n=ts((.0139322*o+.0971045*i+.7141733*r)/Ga)),new es(116*a-16,500*(t-a),200*(a-n),e.opacity)}function es(e,t,n,o){this.l=+e,this.a=+t,this.b=+n,this.opacity=+o}function ts(e){return e>Za?Math.pow(e,1/3):e/Ja+Ya}function ns(e){return e>Xa?e*e*e:Ja*(e-Ya)}function os(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function is(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rs(e,t,n,o){return 1===arguments.length?function(e){if(e instanceof as)return new as(e.h,e.c,e.l,e.opacity);if(e instanceof es||(e=Qa(e)),0===e.a&&0===e.b)return new as(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Wa;return new as(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new as(e,t,n,null==o?1:o)}function as(e,t,n,o){this.h=+e,this.c=+t,this.l=+n,this.opacity=+o}function ss(e){if(isNaN(e.h))return new es(e.l,0,0,e.opacity);var t=e.h*$a;return new es(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}da(es,function(e,t,n,o){return 1===arguments.length?Qa(e):new es(e,t,n,null==o?1:o)},ma(ha,{brighter(e){return new es(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new es(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Aa(os(3.1338561*(t=Ka*ns(t))-1.6168667*(e=1*ns(e))-.4906146*(n=Ga*ns(n))),os(-.9787684*t+1.9161415*e+.033454*n),os(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),da(as,rs,ma(ha,{brighter(e){return new as(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new as(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return ss(this).rgb()}}));var ls={isDark:function(e){return rs(e).l<70}};function us(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}const cs={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"}}},ds=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var ms={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:o}=this.settings.settings,[i,r]=t(),a=Math.abs(i)<1e-15,s=Math.abs(r-1)<1e-15,l=(e=>{const t=cs[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:ds(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:ds(t.shadow.endOffset)}}})(n),u="horizontal"===n&&o,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 hs({viewState:e,viewCache:t,layoutService:n,dockService:o,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:o.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),o=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-o)/(i-o),(n.max-o)/(i-o)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let fs;function ps(){fs=fs||document.createElement("canvas").getContext("2d")}const gs={measureTextWidth(e){ps();const{width:t}=fs.measureText(e);return t},lineWrap(e,t,n,o){let i,r;ps();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof o&&a.length>=o)return a.slice(0,o);for(n&&(fs.font=n),r=0;r<a.length;r++){for(d=a[r]||"",m=d.split(/\s+/),[h]=m,c="",i=1;i<m.length;i++)if(l=`${h} ${m[i]}`,u=gs.measureTextWidth(l),u>t&&("number"!=typeof o||o>s.length)?(s.push(h),h=m[i]):h=l,"number"==typeof o&&s.length>=o){c=m.slice(i+1).join(" ");break}"number"!=typeof o||s.length<o?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${c}`}return s},wordWrap(e,t,n,o,i){if(ps(),!e||!e.length)return[];n&&(fs.font=n);let r=[];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||gs.measureTextWidth(u)<=t?r.push(u):(s=gs.splitWord(u,t,void 0,o-r.length),s.length<=1?r.push(s[0]):(l=s.pop(),r=r.concat(s),a[c+1]?gs.measureTextWidth(`${l} ${a[c+1]}`)>t&&r.length+a.length-c<=o?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return r.forEach((e,t,n)=>{n[t]=e?e.trim():e}),r.length>o?(r=r.splice(0,o),r[r.length-1]=gs.truncate(r[r.length-1],t,n,i).text):(u=r[r.length-1],u&&u.length>1&&gs.measureTextWidth(u)>t&&(r[r.length-1]=gs.truncate(u,t,n,i).text)),r},truncate(e,t,n,o="…"){ps();let i,r,a,s,l=e;const u=gs.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(fs.font=n),e&&t){if(gs.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(r=l.substring(0,i-1),a=r.trim()+o,gs.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,n,o){let i;ps();let r,a=e,s="",l=[];if(gs.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/o);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),r=e.substring(i-1,i)," "===r?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(gs.measureTextWidth(a)<=t));i--);return(!i&&!a||gs.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(gs.measureTextWidth(s)>t?(s=gs.explodeWord(s,t,n-1,o),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,o)=>(ps(),e&&t?(n&&(fs.font=n),gs.explodeWord(e,t,o,Math.max(1,gs.measureTextWidth("i")))):[]),wrapText(e,t,n,o,i){let r;return Number.isNaN(t)?[e]:(r=o>1?gs.lineWrap(e,t,n,o):[e],r=gs.wordWrap(r,t,n,o,i),r)},getFontHeight:e=>(ps(),e&&(fs.font=e),1.5*gs.measureTextWidth("m")),tokenize(e,t,n,o,i,r,a=1){ps(),t&&(fs.font=t);const s=gs.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(r<s)return[];const m=r?Math.max(1,Math.floor(r/l)):o||1;return Array.isArray(o)?(o.forEach(e=>{c+=Number.isNaN(e)||e<=0?0:e}),o.forEach(e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)})):u=[Number.isNaN(o)||o<=0?m:Math.min(m,o)],Array.isArray(e)?e.forEach((e,n)=>{d.length<m&&(d=d.concat(gs.wrapText(e,i,t,u[n])))}):d=gs.wrapText(e,i,t,u[0],n),d}},ys={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:o,rendHeight:i,flipXY:r,symbol:a}){let s="x",l="y",u=o,c=i,d=t<.5?90:-90;return r&&(s="y",l="x",u=i,c=o,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},vs=ne.bind(null,!0),bs={},{isArray:Ms}=Array;function Ss(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function xs(e){return void 0===e}function Cs(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function qs(e,t){const n=t.substring(1).split("/").slice(0,-1);let o;return n.forEach((t,i)=>{if(i===n.length)return;o=+t;const r=isNaN(o)?{}:[];e[o||t]=xs(e[o||t])?r:e[t],e=e[o||t]}),e}function Ts(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function ws(e,t,n){let o=!0;if(Ss(e)&&Ss(t))return Ts(e,n)===Ts(t,n)&&(Object.keys(e).forEach(i=>{ws(e[i],t[i],n)||(o=!1)}),o);if(Ms(e)&&Ms(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o+=1)if(!ws(e[o],t[o],n))return!1;return!0}return e===t}bs.compare=ws,bs.generate=function(e,t,n){n=n||"";let o=[];return Object.keys(t).forEach(i=>{const r=function(e){return e?vs({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;ws(r,a)||Cs(t,i)||(xs(a)?o.push({op:"add",path:s,value:r}):Ss(r)&&Ss(a)?o=o.concat(bs.generate(a,r,s)):Ms(r)&&Ms(a)?o=o.concat(function(e,t,n){let o=[];const i=e.slice();let r=-1;function a(e,t,n){if(e[n]&&xs(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,o=e.length;n<o;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ws(t,i))return o;if(!xs(t[0])&&xs(t[0].qInfo)||0===t.length)return o.push({op:"replace",path:n,value:t}),o;for(let e=i.length-1;e>=0;e-=1)r=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===r?(o.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):o=o.concat(bs.generate(i[e],t[r],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)r=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===r?(o.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):r!==e&&(o.push({op:"move",path:`${n}/${e}`,from:`${n}/${r}`}),i.splice(e,0,i.splice(r,1)[0]));return o}(a,r,s)):o.push({op:"replace",path:`${n}/${i}`,value:r}))}),Object.keys(e).forEach(i=>{xs(t[i])&&!Cs(e,i)&&o.push({op:"remove",path:`${n}/${i}`})}),o},bs.apply=function(e,t){t.forEach(t=>{let n=qs(e,t.path),o=t.path.split("/").splice(-1)[0],i=o&&isNaN(+o)?n[o]:n[+o]||n;const r=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Ms(n))"-"===o&&(o=n.length),n.splice(+o,"add"===t.op?0:1,t.value);else if(Ms(i)&&Ms(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Ss(i)&&Ss(t.value))a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Cs(a,e)&&delete a[e]}),vs(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[o]=t.value}else if("move"===t.op){const i=qs(e,t.from);Ms(n)?n.splice(+o,0,i.splice(+r,1)[0]):(n[o]=i[r],delete i[r])}else"remove"===t.op&&(Ms(n)?n.splice(+o,1):delete n[o]);var a})},bs.clone=function(e){return vs({},e)},bs.createPatch=function(e,t,n){const o={op:e.toLowerCase(),path:n};return"move"===o.op?o.from=t:void 0!==t&&(o.value=t),o},bs.updateObject=function(e,t){Object.keys(e).length?bs.apply(e,bs.generate(e,t)):vs(e,t)};const ks=Math.log(10);function Ns(e){return 10**e}const Ls={pow10:Ns,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/ks,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),o=e/Ns(n);return t=o<=1?1:o<=2?2:o<=5?5:10,t*Ns(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/ks);const o=e/Ns(t);return o<1?(n=5,t--):n=o<2?1:o<5?2:5,n*Ns(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return Ns(Math.floor(Math.log(Math.abs(e))/ks))},getFraction(e){if(0===e)return 0;return e/Ns(Math.floor(Math.log(Math.abs(e))/ks))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),o=e/Ns(n);return t=Math.ceil(o),7!==t&&9!==t||t++,o>1&&o<=1.5?t=1.5:o>2&&o<=2.5&&(t=2.5),t*Ns(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)},Ds=[[2,4,6],[2,4],[3]],Os=[,[,,[[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 Es(e,t,n){const o=e?e.length:0;let i,r=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<o;i++)r=Math.min(r,e[i]/e[i-1]);void 0!==n&&(r=Math.min(r,n/e[o-1])),e.splice(0,0,r)}function As(e,t,n){let o;const i=e?e.length:0;for(o=0;o<i;o++)Es(e[o],t,n)}!function(){let e,t;for(As(Ds,1,10),e=0;e<Os.length;e++)if(Os[e])for(t=0;t<Os[e].length;t++)Array.isArray(Os[e][t])&&As(Os[e][t])}();const Is={isInside(e,t,n,o){if(!o)return!0;const i=e.position-e.radius,r=e.position+e.radius;return i>=t&&r<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,o=e.position<t.position?t:e;return o.position-o.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const o=Is.findSegmentPositionMeetMin(e,t);return Is.findSegmentPositionMeetMax({center:o,max:o+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const o=Is.findSegmentPositionMeetMax(e,n);return Is.findSegmentPositionMeetMin({center:o,min:o-e.radius},t)},layoutPositionFromMin(e,t,n,o=0){const i=e.length-1;let r,a,s=t;for(let t=0;t<i;t++)r=e[t],a=e[t+1],r.position=Is.findSegmentPositionMeetMaxThenMin(r,s,(r.center+a.center-o)/2),s=r.position+r.radius+o/2;a.position=Is.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,o=0){const i=e.length-1;let r,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(r=i;r>0&&(a=e[r],s=e[r-1],u=Math.max(0,Is.getGap(s,a)-o),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));r--);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,r=0;r<=i;r++)a=e[r],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,o=0){const i=e.length-1;if(!(i<0)){if(0===i){const o=e[0];return void(o.position=Is.findSegmentPositionMeetMaxThenMin(o,t,n))}Is.layoutPositionFromMin(e,t,n,o),Is.adjustPositionFromMax(e,t,n,o)}}},Ps=(e,t,n,o=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-o):i*(2-o)/2:"start"===t?0:"end"===t?i*o:i*o/2},Rs=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,zs=e=>e.filter(Rs),Bs=(e,t)=>zs($r.getValue(e,t,[])),Fs=e=>Rs(e)&&(!1!==e.showValue||!1!==e.showLabel),Hs=e=>e.filter(Fs),js=(e,t)=>Hs($r.getValue(e,t,[])),_s=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,Vs=(e,t,n)=>{const{dimensionRefLineInfo:o}=t;if(o[e])return o[e][n]},Us=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:o,qHeight:i}=n;return void 0!==o&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<o},$s=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:o,qHeight:i}=n;return void 0!==o&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=o+i},Ws=({value:e,qMin:t})=>"NaN"!==t&&e<t,Ks=({value:e,qMax:t})=>"NaN"!==t&&e>t,Gs={isRefLineVisible:Rs,getVisibleRefLines:zs,getRefLines:Bs,getMeasureRefLines:e=>Bs(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Bs(e,"refLine.dimRefLines"),isRefLineLabelVisible:Fs,getVisibleRefLineLabels:Hs,getRefLineLabels:js,getMeasureRefLineLabels:e=>js(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:js(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:o,align:i,invert:r=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=Ps(s,i,r,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!o)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=o;let u;return l=Ps(s,i,r,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:o,minOrder:i})=>{const r=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:o});for(let o=0;o<n.length;o++){const{id:a,order:s}=n[o],l=e([t,a]);if(void 0!==l)return l-r*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:r,minOrder:a})),(void 0===u?s(n):u)+l}return l=Ps(s,i,r),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:o})=>{const{isGroupedByDimension:i}=o.meta,r={},a=$r.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():$r.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return r;const u=s?"qData.0.qSubNodes":"qMatrix",c=$r.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,o=t[d];r[o]||(r[o]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],o=c[t][1],i=t+m,a=n[d];r[a]?(r[a].minOrder=Math.min(r[a].minOrder,i),r[a].maxOrder=Math.max(r[a].maxOrder,i),r[a].innerValues[r[a].innerValues.length]={id:o.qElemNumber,order:i}):r[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:o.qElemNumber,order:i}],dataNode:c[t]},0===t?0===i&&(r[a].isMinOrderOk=!0):a!==e&&(r[a].isMinOrderOk=!0,r[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,o=t[d];r[o]||(r[o]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})(),r},getInputValue:_s,extractInfoFromInputValue:Vs,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const o=_s({refLineLayout:e,layoutService:n});return Vs(o,t,"id")},isDiscreteMinOutOfBounds:Us,isDiscreteMaxOutOfBounds:$s,isContinuousMinOutOfBounds:Ws,isContinuousMaxOutOfBounds:Ks,isOutOfRange:({value:e,qMin:t,qMax:n})=>Ws({value:e,qMin:t})||Ks({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&$s({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&Us({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},Ys=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function Xs(e){return e.showValue?`… ${e.valueString}`:"…"}function Js(e,t,n=70){for(let o=0;o<e.length;o++){const i=e[o],r=Ys({label:i,labelStyle:t});i.lines=gs.tokenize(i.title,r,Xs(i),3,n),i.maxNumLines=i.lines.length}}function Zs({title:e,font:t,ellipsis:n,maxNumLines:o=5,maxWidth:i=200}){const r=gs.tokenize(e,t,n,o,i),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n${r[e]}`}return s}function Qs({oobs:e,font:t,ellipsis:n,maxNumLines:o=5,maxWidth:i=200}){const r=e.map(e=>Zs({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:o,maxWidth:i})),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n\n${r[e]}`}return s}function el(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const tl=3,nl=2;function ol({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const o=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${o}]`,"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 il=({label:e,dataPages:t,qMin:n,qMax:o})=>{if(void 0!==n&&void 0!==o){const{inputValue:t}=e;if(Gs.isContinuousMaxOutOfBounds({value:t,qMax:o}))return 1;if(Gs.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Gs.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Gs.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},rl={hasEngineFormat:ol,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:o,orientation:i,rtl:r,isContinuous:a,isDimension:s}){const l=Gs.getInvert({orientation:i,rtl:r,isContinuous:a}),u="S"===o.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=o.getHyperCubeValue(u),{canBeContinuous:d}=o.meta;let m,h;if(s&&d){const e=o.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,h=e.qMax}for(let i=0;i<e.length;i++){const r=e[i],{value:s,align:u,valueInfo:d}=r,f=il({label:r,dataPages:c,qMin:m,qMax:h});r.scaledValue=1===f?l?-.1:1.1:-1===f?l?1.1:-.1:Gs.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:o,isContinuous:a}),r.center=r.scaledValue*n}},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:n,canBeContinuous:o,localeInfo:i}){let r;if(n)for(let n=0;n<e.length;n++){const o=e[n],{value:a,inputValue:s,inputValueLabel:l}=o;r=ol({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,o.valueString=`${ua.lrm}(${r})${ua.lrm}`,o.title=rl.getTitle(o)}else if(o)for(let t=0;t<e.length;t++){const n=e[t],{valueText:o,inputValue:a,inputValueLabel:s}=n;r=ol({inputValue:a,inputValueLabel:s,localeInfo:i})?s:o,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=rl.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];r=n.valueText,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=rl.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const o=e[n];o.totalWidth=t(o.title,o).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map(n=>t(n,e).width)),getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,o=0){const i=e.length-1;if(i<0)return;let r,a;if([r]=e,r.cMin=t,0!==i){for(let t=0;t<i;t++)r=e[t],a=e[t+1],r.cMax=(r.center+a.center-o)/2,a.cMin=r.cMax+o;a.cMax=n}else r.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const o=t-1,i=e.filter(e=>e.maxNumLines===t),r=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-r;e--)i[e].maxNumLines=o},reduceTotalMaxNumLines(e,t,n){const o=Math.floor(n/t);let i=3;do{const t=rl.getTotalNumLines(e)-o;if(t<=0)return;rl.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let o=0;o<e.length;o++){const i=e[o];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,o){for(let i=0;i<e.length;i++){const r=e[i];r.width=Math.min(t,rl.measureLabelMaxLineWidth(r,o)),r.height=r.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const o=e[n],{center:i}=o,r=o[t],a=r/2;o.segment={center:i,range:r,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:o,upperLimit:i,gap:r,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:h,isContinuous:f,isDimension:p}){const g=e.map(e=>e),y=n;rl.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:c,rtl:m,isContinuous:f,isDimension:p}),el(e,"center"),rl.addLabelsNeighborInfo(e,o,i,r),Js(e,a,s),rl.reduceTotalMaxNumLines(g,l,i-(g.length-1)*r),"vertical"===c&&(rl.reduceMaxNumLines(e,l,.05*r),function(e,t,n=70){for(let o=0;o<e.length;o++){const i=e[o],r=Ys({label:i,labelStyle:t});i.lines.length>i.maxNumLines&&(i.lines=gs.tokenize(i.title,r,Xs(i),i.maxNumLines,n))}}(e,a,s)),rl.addLabelsSize(e,s,l,d),rl.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:o,area:i,lineHeight:r=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=o,{minorCenter:c}=i,{fontSize:d,fontFamily:m,fontStyle:h,fontWeight:f,textDecoration:p,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,o=t.length,i=t.map((t,i)=>{const g={type:"text",text:t,title:Zs({title:e.title,font:a,ellipsis:Xs(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||m,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||f,textDecoration:e.textDecoration||p,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return g[l]=c,g[s]=e.segment.position,g.y+=(i-(o-1)/2)*r,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:o,label:i,lineHeight:r,background:a}){const{lines:s}=i,{borderRadius:l=tl,padding:u={}}=a,{top:c=nl,bottom:d=nl,left:m=nl,right:h=nl}=u,f=s.length,p={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(m+h),height:i.height+(c+d),value:i.value,dock:o};return p[n]=e,p[t]=i.segment.position,p.x-=i.width/2+m,p.y-=f*r/2+c,p}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:r,background:g})),y=y.concat(i)}),y}};function al(e,t,n){let o;const i=typeof t;if("string"===i||"object"===i)o=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;o=e&&e[0]?e[0].formatter():null}return o}function sl(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:o,bottom:i,maxLabelWidth:r}=t;let a=1;return rl.getMaxTextWidth(e)>r&&(Js(e,t,r),a=Math.max(...e.map(e=>e.lines.length))),a*n+o+i}(t,n):function(e,t){const{left:n,right:o,maxLabelWidth:i}=t;return Math.min(i,rl.getMaxTextWidth(e))+n+o}(t,n)}function ll(e,t){return t?e.domain():[0,1]}function ul(e,t,n,o="value"){let i=e.filter(e=>e[o]>=t);i=i.filter(e=>e[o]<=n);const r=e.filter(e=>e[o]<t),a=e.filter(e=>e[o]>n);return{filteredLabels:i,minOobs:r,maxOobs:a,numMinOobs:r.length,numMaxOobs:a.length}}function cl(e){let t,n=0;for(let o=1;o<10;o++)t=e(o),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function dl(e,t){return e>9?t[1]:t[0]}function ml({alignment:e,dockValue:t,oobs:n,style:o,rect:i,symbol:r,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:h,minorDimension:f,dock:p}=s,g=i[f],y=ys.createOob({oob:ys.getDefaultSettings({size:o.size,fill:o.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:r});y.dock=p;const v=`c${m}`,b=`c${h}`,M={type:"circle",r:l,stroke:"transparent",fill:o.text.background.fill,strokeWidth:0,dock:p};M[b]=g/2,M[v]=a;const S={type:"text",text:c>9?"9+":c,title:Qs({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:o.text.fontSize,fontFamily:o.text.fontFamily,fill:o.text.fill,baseline:"central",anchor:"middle",dock:p};return S[h]=g/2,S[m]=a,[y,M,S]}const hl=e=>{const t=Ys({labelStyle:e}),n=gs.getFontHeight(t)*(e.lineHeightMultiplicator||1),o=e.gap||12,i=e.maxWidth||75,r=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:o,maxLabelWidth:i,top:r,bottom:a,left:s,right:l}},fl=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 pl={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:o,localeInfo:i}=this.settings,r=!!o||n.meta.canBeContinuous,a=fl(this.settings.labels),s=al(this.chart,this.settings.formatter,e);rl.addLabelTitles({labels:a,formatter:s,isContinuous:o,canBeContinuous:r,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:o,layoutService:i})=>{if(n){const[o,i]=ll(t,n);return ul(e,o,i)}if(o){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:o}=t;if("NaN"!==n&&"NaN"!==o)return ul(e,n,o,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:o,canBeContinuous:r,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:o,fontFamily:i,fontWeight:r}=n||{};return this.renderer.measureText({text:e,fontWeight:r||t.label.fontWeight,fontSize:o||t.label.fontSize,fontFamily:i||t.label.fontFamily})},c&&c.length){const e=hl(t.label),{dock:n}=this.settings.layout;return rl.measureLabelsWidth(c,this.measureText),d=sl(n,c,e),d}const m=cl(this.measureText),h=l?dl(l,m):0,f=u?dl(u,m):0;return d=Math.max(h,f),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:o,theme:i,isContinuous:r,isDimension:a,localeInfo:s}=this.settings,l=!!r||o.meta.canBeContinuous,u=fl(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,h=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),f=function(e,t,n){const o=e[t.minorDimension];return{minorSize:o,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(o-n.right-n.left)/2+n.left:(o-n.top-n.bottom)/2+n.top}}(this.rect,h,m),{orientation:p,majorDimension:g}=h,{majorSize:y}=f,v=hl(n.label),{font:b,lineHeight:M,gap:S,maxLabelWidth:x}=v,C=al(this.chart,this.settings.formatter,e),q=y;rl.addLabelTitles({labels:u,formatter:C,isContinuous:r,canBeContinuous:l,localeInfo:s}),rl.calculateLabelPositions({labels:u,scale:e,size:q,layoutService:o,orientation:p,rtl:d,isContinuous:r,isDimension:a});const[T,w]=ll(e,r),{filteredLabels:k,lowerOobs:N,upperOobs:L,lowerCircleSize:D,upperCircleSize:O,lowerOobSpace:E,upperOobSpace:A}=function({labels:e,minValue:t,maxValue:n,orientation:o,rtl:i,isContinuous:r,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=ul(e,t,n,u),h="scaledValue"!==u&&Gs.getInvert({orientation:o,rtl:i,isContinuous:r}),f=function(e,t,n){return n?t:e}(d,c,h),p=function(e,t,n){return n?e:t}(d,c,h),g=f.length,y=p.length,v=cl(l),b=dl(g,v),M=dl(y,v),S=function(e,t,n,o,i){return("vertical"===o?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,o,s),x=function(e,t,n,o,i){return("vertical"===o?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,M,o,s);return{filteredLabels:m,lowerOobs:f,upperOobs:p,lowerCircleSize:b,upperCircleSize:M,lowerOobSpace:S,upperOobSpace:x}}({labels:u,minValue:T,maxValue:w,orientation:p,rtl:d,isContinuous:r,style:n,padding:m,measureText:this.measureText,prop:r?"value":"scaledValue"}),I=E,P=y-A;el(N),el(L);const R=ml({alignment:0,dockValue:0,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+D/2,areaProps:h,radius:D/2,font:b}),z=ml({alignment:1,dockValue:1,oobs:L,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+O/2),areaProps:h,radius:O/2,font:b});rl.addLabelsInfo({labels:k,scale:e,majorSize:y,lowerLimit:I,upperLimit:P,labelStyle:v,lineHeight:M,gap:S,maxLabelWidth:x,majorDimension:g,orientation:p,measureText:this.measureText,rtl:d,layoutService:o,isContinuous:r,isDimension:a}),Is.layout(k.map(e=>e.segment),I,P,n.label.gap);const B=k.filter(e=>Is.isInside(e.segment,I,P,r));return rl.createLabels({labels:B,style:n.label,maxLabelWidth:x,areaProps:h,area:f,lineHeight:M,font:b,theme:i}).concat([...R,...z])}};var gl={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function yl(e){const{qHyperCube:t,...n}=e,{qAxisData:o,qDataPages:i,qStackedDataPages:r,qTreeDataPages:l,...u}=t,c=ne(!0,{},{...n,qHyperCube:{...u}}),{dataRelatedPropertiesPaths:d}=gl;function m(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==a(e,t)&&s(e,t,void 0));const o=t.substring(0,n),i=t.substring(n+2),r=i.startsWith(".")?i.substring(1):i;a(e,o,[]).forEach(e=>{r&&m(e,r)})}return d.forEach(e=>{m(c,e)}),c}var vl={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:o}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(o){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:o,dock:i}){return({currentNodes:r,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&r.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==i&&"right"!==i||r.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||r.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?r.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||o?r.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):r.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=o,e.y-=i):e.transform=`translate(${-o}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x;0===t.y-n.y&&0===o||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=o):(e.x-=o,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=o,e.x2-=o);else{const t="x"===e.major.p?o/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:o/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x;0===t.y-n.y&&0===o||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=o,e.cy-=i;break;case"rect":e.x-=o,e.y-=i;break;case"path":e.transform=`translate(${-o}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y;0===o&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=o,e.y-=i):(e.cx-=o,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const o=t.x-n.x,i=t.y-n.y,r=t.width-n.width,a=t.height-n.height;let s=-o,l=-i;e.forEach(e=>{switch(e.dock){case"right":o>0&&(s=t.width);break;case"left":r<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=yl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=yl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:bl,extractInfoFromInputValue:Ml,resolveValue:Sl}=Gs;var xl={resolveValue:Sl,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const o=bl({refLineLayout:e,layoutService:n});return Ml(o,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const o=bl({refLineLayout:e,layoutService:n});return Ml(o,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:o}=t,{canBeContinuous:i}=n.meta,r=bl({refLineLayout:e,layoutService:n});return o[r]&&i?o[r].qText:r},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const o=bl({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[o]}};function Cl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:o,dockService:i,animationsEnabled:r,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:h}){const f=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!f.length)return!1;const p={key:c,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:r,trackBy:vl.lines.trackBy,compensateForLayoutChanges:vl.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return f.forEach(r=>{p.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:o,colorModel:i,dockService:r,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{const m={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||o.meta.isContinuous?(m.scale=s,m.value=t.refLineExpr.value):(m.valueInfo=xl.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:o}),m.value=()=>{const e=Gs.getScaledPosition({scale:a.scale(s),value:xl.resolveValue({refLineLayout:t,refLineModel:n,layoutService:o}),valueInfo:m.valueInfo,size:a.component(c)?.rect["horizontal"===r.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:o,isContinuous:d});return Number.isNaN(e)?void 0:e}),m})({isDimension:e,refLineLayout:r,refLineModel:t,layoutService:n,colorModel:o,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),p}function ql({isDimension:e,refLineModel:t={},layoutService:n,colorModel:o,animationsEnabled:i,dock:r,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:h}){const f=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!f.length)return[];const p=[],g=!e||n.meta.isContinuous,y=f.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:o,scale:i,theme:r,isContinuous:a})=>{const s=o.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:u}=e,{fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f}=u||{},p={align:l,text:e.label,fill:e.coloredBackground?r.getContrastingColorTo(s):s,fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(p.background={fill:s}),a?(p.scale=i,p.value=e.refLineExpr.value):(p.value=()=>xl.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueText=()=>xl.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueInfo=()=>xl.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),p})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:o,scale:a,theme:u,isContinuous:g}));return p.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:o,labels:i,scale:r,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:r,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:o.referenceLine.label.name.fontFamily,fontSize:o.referenceLine.label.name.fontSize,fontStyle:o.referenceLine.label.name.fontStyle,fontWeight:o.referenceLine.label.name.fontWeight,textDecoration:o.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:o.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:o.referenceLine.outOfBounds.fontFamily,fontSize:o.referenceLine.outOfBounds.fontSize,fill:o.referenceLine.outOfBounds.color,background:{fill:o.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:vl.refLineLabels.trackBy,compensateForLayoutChanges:vl.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:r,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:g,localeInfo:c})),p}const Tl={combineBounds(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach(e=>{e&&(t=Math.min(t,e.x,e.x+e.width),n=Math.max(n,e.x,e.x+e.width),o=Math.min(o,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))}),{x:t,y:o,width:n-t,height:i-o}}},wl=(e,t,n)=>{if(!e)return Promise.resolve();let o=bs.generate(t,n);return ne(!0,t,n),o&&o.length?(o=o.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(o,!0)):Promise.resolve()},kl=e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1));function Nl(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(e?.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const Ll={ref:null,refFn:e=>{const t=e.qHyperCubeDef.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id);return`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0.qExpression`},change(e){const t=e.qHyperCubeDef?.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id),n=$r.getValue(e,`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0`),o=$r.getValue(e,"color");n&&(n.id="colorByExpression",o&&(o.colorExpression=n.qExpression))}};function Dl({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const o=l(n);return o.setAlpha(e?.alpha>=0?e.alpha:1),o.isInvalid()?void 0:o.getRGBA()}function Ol({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:o}=e,i=""===e.measureValue?void 0:+e.measureValue;if(Ls.isNumber(i))return i;const{dimensionCount:r,measureCount:a}=n.meta;if(2===r)return 0;const s=e.measureIndex?+e.measureIndex:0;return Ls.isNumber(s)&&!(s>=a||0===r)&&1===r?t[o]?.dataNode[s+1]?.qNum:void 0}const El={index:-1,color:"#595959"};function Al({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,rtl:s,majorScale:u,minorScale:c,mainComponentKey:d,data:m,key:h}){if(!Array.isArray(m)||0===m.length)return!1;const f={resolveUIColor:o.getMain().getPaletteColor},p=i.getTheme(),g="horizontal"===a.meta.major.orientation,y=!(!g||!s),{canBeContinuous:v,isContinuous:b,isButterfly:M}=r.meta,S=r.getLayout(),x=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=l(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const o=n?.bgColor?.color;return Dl({color:o,colorModel:t})}({layout:S,colorModel:f})??p.getStyle("object","","backgroundColor"),C=Gs.getDimensionValuesInfo({layout:S,canBeContinuous:v,discreteModel:n,layoutService:r}),q=b?m:m.filter(e=>!!C[e.dimensionValue]),T={};q.map(e=>e.dimensionValue).forEach(e=>{C[e]&&(T[e]?(T[e].innerValues=C[e].innerValues,T[e].minOrder=Math.min(T[e].minOrder,C[e].minOrder),T[e].maxOrder=Math.max(T[e].maxOrder,C[e].maxOrder),T[e].isMinOrderOk=T[e].isMinOrderOk||C[e].isMinOrderOk,T[e].isMaxOrderOk=T[e].isMaxOrderOk||C[e].isMaxOrderOk):T[e]={id:C[e].id,dataNode:C[e].dataNode,qText:C[e].qText,innerValues:C[e].innerValues,minOrder:C[e].minOrder,maxOrder:C[e].maxOrder,isMinOrderOk:C[e].isMinOrderOk,isMaxOrderOk:C[e].isMaxOrderOk},T[e].numInnerValues=(T[e].maxOrder||0)-(T[e].minOrder||0)+1)}),q.forEach(e=>{const t=Ol({point:e,dimensionValueInfo:T,layoutService:r});if(e.validMeasureValue=M&&1===e.measureIndex?-t:t,r?.meta?.isStacked){const t=T[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),o=t[e.measureIndex+1]?.qNum;if("number"==typeof o&&0!==o){const t=Math.sign(o);e.validMeasureValue=n.reduce((e,n)=>{const o=n.qNum;return"number"==typeof o&&Math.sign(o)===t?e+o:e},0)}}}const n=Dl({colorModel:f,color:e.style?.label?.color||El}),o=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=o?n:void 0,e.labelColor=o?i.getTheme().getContrastingColorTo(n):n,e.hasBackground=o,e.maxLabelWidth=100});const w={scale:u,fn:({datum:t})=>{const n=e.scale(u),o=t.value.dimensionValue;if(b)return n("string"==typeof o?""===o?void 0:+o:o);if(void 0===T[o])return;return Gs.getScaledPosition({scale:n,value:T[o].id,valueInfo:T[o],size:e.component(d)?.rect[g?"width":"height"],align:"center",invert:y,layoutService:r,isContinuous:b})}},k={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:h,type:"point",data:q,settings:{x:g?w:k,y:g?k:w,strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Dl({colorModel:f,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Dl({colorModel:f,color:e.value.style?.fill}):x,size:({datum:e})=>`${e.value.style?.dataPointSize??10}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:vl.points.compensateForLayoutChanges}}}const Il=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Pl=!0,Rl=!1,zl={index:0,color:"none"},Bl={index:-1,color:"#595959"},Fl={index:-1,color:"#595959"},Hl=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},jl=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},_l=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},Vl=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>_r.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!_r.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Il(n.layout),convertFunctions:{get:(e,t,n,o)=>void 0===o.measureValue?1:0,set(e,t,n,o,i){0===e?(i.measureValue=0,delete i.measureIndex):(i.measureIndex=0,delete i.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Il(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Il(n.layout),invalid:(e,t,n)=>{return e.measureIndex<0||e.measureIndex>=(o=n.layout,o?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0);var o}}}),Ul=()=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:zl},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Bl},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Fl},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:3,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:10,min:3,max:30,step:1}}),$l=({translator:e,pluginOptions:t})=>{const n={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),_l(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach(_l),_r.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Hl(e);break;case"line":t=e,t.points?.forEach(Hl)}var t}):e.plugins.forEach(e=>{switch(e.type){case"point":jl(e);break;case"line":t=e,t.points?.forEach(jl)}var t}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:Vl({translator:e})},styleSection:{component:"items",items:Ul()}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:Vl({translator:e})},styleSection:{component:"items",items:Ul(),show:(e,t,n)=>{const o=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return o?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Bl},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return n};var Wl=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,o=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=o.length):(n=arguments[1],t=arguments[2]),t&&o?(o.length>n&&(o=o.substr(0,n)),new e(o,t)):null}},Kl=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,o){let i,r;if(t.length===n)return r=this._value,this.setValue(o),r;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,o)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return Wl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Wl.newInstanceIfNeeded(e,t,this._value);const o=n.getLongestMatch(e,t+1);return o||Wl.newInstanceIfNeeded(e,t,this._value)}},Gl=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new Kl);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Gl;let o,i,r;for(o in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[o]&&e.hasOwnProperty(o)&&(t[e[o]]=o);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(r=t[i].toLowerCase().substr(1),n.put(r,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const Yl={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Xl={OPTIONS:Yl,DEFAULT:Yl.MINI_CHART};function Jl({layoutService:e,discrete:t}){return({h:n,rect:o,orientation:i,minThumbSize:r})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=o[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<r){const e=(r-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=r}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Zl({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),o=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-o)/(i-o),(n.max-o)/(i-o)]}(t,n):function(e){return e.get("viewRange")}(t)}const Ql=e=>({miniChart:e===Xl.OPTIONS.MINI_CHART.value,bar:e===Xl.OPTIONS.BAR.value,none:e===Xl.OPTIONS.NONE.value});function eu({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Ql(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Ql(Xl.DEFAULT.value);const o=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Ql(!n&&(o||!o&&i)?Xl.OPTIONS.NONE.value:Xl.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Xl.OPTIONS.MINI_CHART.value,n.bar=t.value===Xl.OPTIONS.BAR.value,n.none=t.value===Xl.OPTIONS.NONE.value),n}function tu({layoutService:e,dockService:t,discrete:n,continuousDataModel:o,viewState:i,viewCache:r,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=eu({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?o.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Zl({layoutService:e,viewState:i,viewCache:r})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const f=a.getStyles();return f.color&&(h.style={standard:{thumb:{"border-color":f.color,opacity:.4},before:{background:f.color,opacity:.1},after:{background:f.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(h.settings.injections=()=>[Jl({layoutService:e,discrete:n})]),h}function nu({componentKey:e,chart:t,viewState:n,viewCache:o,layoutService:i,dockService:r,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===r.meta.major.orientation,h=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,f=m?d.rect.computedInner.width:d.rect.computedInner.height,p=m&&a?f-h:h,g=Math.max(0,Math.min(p/f,1)),[y,v]=Zl({layoutService:i,viewState:n,viewCache:o}),b=g<y,M=g>v,S=!b&&!M;return{pixel:p,relative:g,thumb:S?p-y*f:0,beforeThumb:b,afterThumb:M,onThumb:S}}}function ou({componentKey:e,chart:t,viewState:n,viewCache:o,layoutService:i,dockService:r}){return()=>{const a=t.component(e),{orientation:s}=r.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=Zl({layoutService:i,viewState:n,viewCache:o});return{size:c,thumbSize:(m-d)*c}}}function iu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=nu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),c=ou({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(o,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(r.meta.isContinuous){const e=o.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),r=i.get("continuousMax"),s=n+(r-n)*a.relative;o.set("zoom",{min:Math.min(s-t/2,r-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const ru="data-scrollbar-handle";function au({e:e}){return(e.srcEvent||e).srcElement.getAttribute(ru)||""}const su="scrollbarResize";function lu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:s}){const l=nu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:s});return{type:"Pan",key:`event:${su}`,options:{event:su,threshold:0,enable(e,t){return!(!r.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[su]=this[su]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&au({e:t})&&(this[su].panningEvent=t.srcEvent),!!this[su].panningEvent))}},events:{[`${su}start`](n){n.preventDefault(),this[su]=this[su]||{},this[su].panningEvent&&t.component(e).emit("dragStart",this[su].panningEvent)},[`${su}move`](n){if(n.preventDefault(),this[su]=this[su]||{},!this[su].panningEvent)return;const r=o.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=au({e:this[su].panningEvent});let m="start"===d?Math.min(c,r.max):r.min,h="end"===d?Math.max(c,r.min):r.max;m===h&&(m-="start"===d?u:0,h+="end"===d?u:0),o.set("zoom",{min:m,max:h}),t.component(e).emit("render")},[`${su}end`](n){n.preventDefault(),this[su]=this[su]||{},delete this[su].panningEvent,t.component(e).emit("dragEnd")},[`${su}cancel`](n){n.preventDefault(),this[su]=this[su]||{},delete this[su].panningEvent,t.component(e).emit("dragEnd")}}}}const uu="scrollbarPan";function cu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=nu({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),c=ou({componentKey:e,chart:t,viewState:o,viewCache:i,layoutService:r,dockService:a});return{type:"Pan",key:`event:${uu}`,options:{event:uu,threshold:0,enable(o,i){return this[uu]=this[uu]||{},!(i&&!this[uu].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e))}},events:{[`${uu}start`](n){n.preventDefault();const a=u(n);if(this[uu]=this[uu]||{},this[uu].isPanning=!0,t.component(e).emit("lockState"),r.meta.isContinuous){const e=o.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),r=i.get("continuousMax"),s=n+(r-n)*a.relative;s<e.min?o.set("zoom",{min:Math.min(s,r-t),max:Math.max(s+t,n+t)}):s>e.max&&o.set("zoom",{min:Math.min(s-t,r-t),max:Math.max(s,n+t)}),this[uu].relative=a.relative,this[uu].zoom=o.get("zoom"),this[uu].zoom.span=this[uu].zoom.max-this[uu].zoom.min,this[uu].zoom.fullSpan=r-n}else if(a.onThumb)this[uu].offset=a.thumb;else{const e=c();this[uu].offset=a.beforeThumb?0:e.thumbSize}},[`${uu}move`](n){n.preventDefault();const a=u(n);if(this[uu]=this[uu]||{},r.meta.isContinuous){const e=a.relative-this[uu].relative,{fullSpan:t,span:n,min:r,max:s}=this[uu].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");o.set("zoom",{min:Math.min(r+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[uu].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${uu}end`](n){n.preventDefault(),this[uu]=this[uu]||{},this[uu].isPanning=!1,t.component(e).emit("unlockState")},[`${uu}cancel`](n){n.preventDefault(),this[uu]=this[uu]||{},this[uu].isPanning=!1,t.component(e).emit("unlockState")}}}}function du({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){return[iu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}),lu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,rtl:l}),cu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l})]}function mu({componentKey:e,chart:t,actions:n,layoutService:o}){const i=(i,r)=>{if(!o.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,r)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function hu({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l}){return{gestures:[...du({componentKey:e,chart:t,actions:n,viewState:o,viewCache:i,layoutService:r,dockService:a,discrete:s,rtl:l})],native:mu({componentKey:e,chart:t,actions:n,layoutService:r})}}const fu={background:"rgba(0, 0, 0, 0.1)"},pu={top:-1,bottom:-1,width:6},gu={width:2,background:"#595959"};var yu={before:fu,after:fu,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:pu,endHandle:pu,startHandleBorder:gu,endHandleBorder:gu};const vu={background:"rgba(0, 0, 0, 0.1)"},bu={top:-1,bottom:-1,width:6},Mu={width:2,background:"#595959"};var Su={before:vu,after:vu,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:bu,endHandle:bu,startHandleBorder:Mu,endHandleBorder:Mu};const xu={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Cu={pointerEvents:"initial"},qu={pointerEvents:"none"};const Tu="ew-resize",wu="default";function ku(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,o=n?e.computedInner.width:e.computedInner.height,i=t.range(),r=n&&t.rtl;return{size:o,start:(r?1-i[1]:i[0])*o,end:(r?1-i[0]:i[1])*o}}function Nu(){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?Tu:wu}function Lu(e,t,n){const{min:o}=this.settings.settings.size.thumb;if(n-t<o){const i=(o-(n-t))/2,r=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+r,end:n+i+r}}return{size:e,start:t,end:n}}function Du(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Ou(){const{size:e,start:t,end:n}=ku.call(this);this.renderer.render(this.elements(this.h,Lu.call(this,e,t,n)))}function Eu(){const{state:e,settings:t,style:n}=this,o=t.settings.style;return e.style[o]||(e.style[o]=function({id:e,style:t}){const n="slim"===e?Su:yu;return{container:{...xu},before:{...xu,...n.before,...t.before},after:{...xu,...n.after,...t.after},thumb:{...xu,...n.thumb,...t.thumb},startHandle:{...xu,...Cu,...n.startHandle},endHandle:{...xu,...Cu,...n.endHandle},startHandleBorder:{...xu,...qu,...n.startHandleBorder},endHandleBorder:{...xu,...qu,...n.endHandleBorder}}}({id:t.settings.style,style:n[o]})),e.style[o]}var Au={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(){Ou.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||!Du.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=au({e:e});t&&(this.state.hover[t]=!0),Nu.call(this),Ou.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Nu.call(this),Ou.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=au({e:e});t&&(this.state.drag[t]=!0),Nu.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Nu.call(this),Ou.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:o}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*o))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:o}=ku.call(this);return this.elements(e,Lu.call(this,t,n,o))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:o}){const{settings:i}=this.settings,r=i.injections().map(t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min}));return function({h:e,size:t,start:n,end:o,properties:i,startHandleActive:r,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},m={[i.start]:o},h={left:-3},f={left:1},p={right:-3,left:"auto"},g={left:3},y=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?p:h},class:"scrollbar--start-handle",[ru]:"start"},r?e("div",{style:{...s.startHandleBorder,...u?g:f}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?h:p},class:"scrollbar--end-handle",[ru]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?f:g}}):void 0);b.push(n)}const M=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-o},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,M,v,...c])}({h:e,size:t,start:n,end:o,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:Eu.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:r})}};const Iu={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:o,rendHeight:i,flipXY:r,symbol:a}){let s="x",l="y",u=o,c=i,d=t<.5?90:-90;return r&&(s="y",l="x",u=i,c=o,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function Pu({i:e,width:t,height:n,resolved:o,keys:i,flipXY:r,calcKey:a="box"}){let s,l=null,u=null;void 0!==o.major.settings.binStart?(l=o.major.items[e].binStart,u=o.major.items[e].binEnd,s=o.major.settings.binStart.scale):(s=o.major.settings.major.scale,l=s?o.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=ne({},{major:l,majorEnd:u},o.minor.items[e]);i.forEach(t=>{d[t]=o[t].items[e]});const m=r?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:o,maxMajorWidth:i}){const r=e>=0?1:-1;let a=Math.min(r*e*t,Number.isNaN(Number(o))?i:o/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*r}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),f=(c-h)/2,p=f+d.major+h/2;return{item:d,boxCenter:p,boxWidth:h,boxPadding:f,rendWidth:t,rendHeight:n}}function Ru({keys:e,data:t,defaultSettings:n,style:o,settings:i,width:r,height:a,resolver:s}){const l=ne(!0,{},n||{},o||{}),u={major:"horizontal"===i.orientation?a:r,minor:"horizontal"===i.orientation?r: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:ne(!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:ne(!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 h;const f={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!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 n=0,o=e.length;n<o;n++)h=e[n],f[h]=s.resolve({data:t,defaults:l[h],settings:i[h],scaled:u});return f}const zu=["oob"];const Bu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,o="horizontal"===this.settings.settings.orientation,{data:i,style:r,resolver:a,symbol:s}=this,l=Ru({keys:zu,data:i,defaultSettings:{oob:Iu.getDefaultSettings()},style:r,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:o,keys:i,symbol:r,dockValue:a,_calcItemRenderingOpts:s=Pu}){const l=[],{items:u}=o.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:h,rendHeight:f}=s({i:c,width:e,height:t,resolved:o,keys:i,flipXY:n,calcKey:"oob"}),p=u[c].data,g=[];if(d.oob.show){g.push(Iu.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:h,rendHeight:f,flipXY:n,symbol:r}));const e={type:"container",data:p,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:o,resolved:l,keys:zu,symbol:s,dockValue:n});return d}},Fu={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Hu=["hat"];function ju(e,t=!0){let n="";for(let t=0;t<e.length;t++){const o=e[t];n+=0===t?`M${o.x} ${o.y}`:`L${o.x} ${o.y}`,n+=" "}return t&&(n+="Z"),n}function _u({item:e,boxWidth:t,boxPadding:n,rendWidth:o,rendHeight:i,flipXY:r}){let a="x",s="y",l=o,u=i,c=e.hat.alignment||0;r&&(a="y",s="x",l=i,u=o,c=1-c);const d=(n+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 h=ne({},e.hat,{type:"path",d:ju(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[h,ne({},e.hat,{type:"path",d:ju(m)})]}const Vu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:o,style:i,resolver:r}=this,a=Ru({keys:Hu,data:o,defaultSettings:Fu,style:i,settings:this.settings.settings,width:e,height:t,resolver:r}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:o,keys:i,_calcItemRenderingOpts:r=Pu}){const a=[],{items:s}=o.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h}=r({i:l,width:e,height:t,resolved:o,keys:i,flipXY:n,calcKey:"hat"}),f=s[l].data,p=[];u.hat.show&&p.push(..._u({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h,flipXY:n}));const g={type:"container",data:f,collider:{type:"bounds"},children:p};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:Hu});return u}};var Uu={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function $u(e,t,n,o){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map(t=>{const r=i([t.data.value,o?n-1:0]),a=i([t.data.value,o?0:n-1])+e.bandwidth();return{position:(r+a)/2,label:t.label,data:t.data,start:r,end:a}}),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(o){const i=e.pxScale(o);return i===e?this:$u(i,t,n)},i}function Wu(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},o={}){const i=t(e,n,o),r=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return r.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),$u(i,a,l,e.invert)})}const Ku=()=>({version:"1.39.13",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}),Gu={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 Yu(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const Xu={getImageSize(e,t){let n;function o(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,o()}const r={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=r[t]*(n>l?1:n/l),c=r[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},o()):(e={height:u,width:c},o()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function Ju(e,t,n){let o=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,o,i,r,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",o=t.host||"localhost",i=t.port?`:${t.port}`:"",r=t.prefix?t.prefix:"/","/"!==r[r.length-1]&&(r=`${r}/`),n+o+i+r}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(o,i),o=o.replace(/"/g,'\\"'),o=o.replace(/'/g,"\\'"),o=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(o,i));const{height:r,width:a,imageError:s}=await Xu.getImageSize(o,t);return{src:o,size:t,height:r,width:a,imageError:s}}async function Zu(e,t,n,o){const{app:i,flags:r}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const d=o.data?.customTooltipAttrExps?.value||[];let m;if(-1!==c&&d[c]&&(m=d[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return Ju(s,l,i);if("url"===u)return async function(e,t,n,o,i){let r,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&Yu(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await Xu.getImageSize(t,o);r={src:t,size:o,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await Xu.getImageSize(a,o);r={src:a,size:o,height:e,width:t,imageError:n}}return r}(i,r,s,l,m);if(r.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&m&&m.label){return async function(e,t,n,o){let i;const r=o.label,a=`qmem://${t.qFallbackTitle}/${r}`;if(Yu(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:o,width:r,imageError:a}=await Xu.getImageSize(e,n);i={src:e,size:n,height:o,width:r,imageError:a}}}catch(e){}return i}(i,n[c],l,m)}return[]}const Qu={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:o}){const i=t,r=[];for(let t=0;t<i.length;t++)r.push(Zu(e,o,n,i[t]));const a=await Promise.all(r);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},ec={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:o}){let i=t;return i=await Qu.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:o}),i},checkIfPromisesExist:({customTooltipModel:e})=>Qu.checkIfPromisesExist({customTooltipModel:e})};const tc=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,o=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,r=t;return{qInfo:{qType:Gu.CHART.CHART_PARENT_TYPE,qId:Gu.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:o,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:r}},nc=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:Gu.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const oc={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",o=Gu.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:o,height:o,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:Gu.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":o}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:o,customTooltipModel:i,rtl:r})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await oc.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const o=n,i=Gu.CHART.STATE,r=t.qStateName;o.miniChartToken.alternateState||(o.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,r),o.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const o=n;o.miniChartToken.sessionObj?.id&&await e.destroySessionObject(o.miniChartToken.sessionObj.id);const i=Gu.CHART.STATE,r=tc(t,i),a=await e.createSessionObject(r),s=nc(t);if(a.id!==Gu.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);o.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(o.miniChartToken.sessionObj&&o.miniChartToken.sessionObj.id===a.id)return o.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==o?o:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===o&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],o=void 0!==e.value?[e.value]:[];o.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),o,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(Gu.CHART.CONTAINER_ID),u={direction:r?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await oc.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(oc.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(Gu.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,o=Gu.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(o)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function ic(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function rc(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:o}=Gu.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[o]=!0,i}function ac(e){const t=rc();return e.filter(e=>t[e.id])}const sc={getNodes(e,t){const n=function(e,t){let n=0,o=0;e.center?(n+=e.center.x,o+=e.center.y):(n+=e.clientX,o+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:o-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,o=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const r=t.data?.selectionDimension??t.data;if(!r||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],o.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===r.value&&t.label===r.label});t.length>0&&(o=o.concat(t[0]))}}),o},displayTooltip(e,t,{nodes:n,opts:o={},customTooltipModel:i,extractedNodes:r=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=sc.getAttrExprData(a);r.length||n.length?ec.handlePromises({customTooltipModel:i,nodes:sc.getDataNodes(s,r.length>0?r:n),attrExps:l,opts:o}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&oc.hide({app:o.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>ec.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,o=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[o]||(n[o]=[]),n[o]},getAttrExprData(e){let t=[],n="";const o=e.qHyperCube?.qDimensionInfo||[];if(o.length>0){const i=o.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[Gu.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let o=n.qLayoutExclude;o||(n.qLayoutExclude={quarantine:{}},o=n.qLayoutExclude),o.quarantine||(o.quarantine={}),o.quarantine[Gu.CUSTOM.QUARANTINE]=[],e.forEach(e=>{o.quarantine[Gu.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=o}(ac(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[Gu.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[Gu.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=ic(e);if(!n)return;const o=void 0!==t?t:n.length-1;if(!n[o])return;const i=this.getAttrExps(e,n[o]);if(0===ac(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],r=e;r.qHyperCubeDef?r.qHyperCubeDef.qDimensions[o].qAttributeExpressions=n:r.qHyperCube.qDimensionInfo[o].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let o=[];const i=ic(e)||[];[...i,t].forEach(e=>{const t=ac(e.qAttributeExpressions||[]);t.length>0&&(o=t)});const r=rc(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!r[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(o));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=>e.tooltip?.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:ua.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=ua.detectTextDirection(e.src),o=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){o.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;o.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,o),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function lc({layout:e,app:t,picasso:n,model:o,chart:i,translator:r,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:o,chart:i,translator:r,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:sc,miniChartToken:{},embed:s}}function uc(e,t,n,o){const i=t.qHyperCube?.[n]?.[o]?.qAttrExprInfo||[],r=[],a=e.qSubNodes&&e.qSubNodes[o]?e.qSubNodes[o].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case Gu.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case Gu.CUSTOM.TITLE:case Gu.CUSTOM.DESCRIPTION:case Gu.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);r.push({source:{key:"qHyperCube",field:`${n}/${o}/qAttrExprInfo/${t}`},label:s,value:"value"})}),r):r}const cc={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,o="qDimensionInfo";return{field:`${o}/${n}`,value:t=>uc(t,e,o,n)}}};const dc={getCustomAttrExps(e,t,n){const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return o;return function(e,t,n,o){const i={[Gu.CUSTOM.TITLE]:!0,[Gu.CUSTOM.DESCRIPTION]:!0},{attrExps:r,fieldPath:a}=sc.getAttrExprData(e);return 0===t.length||0===r.length||""===a||r.forEach((e,r)=>{const s=t[r];if(e.id===Gu.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${r}`).formatter()(s.value);o.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&&o.customTooltipInfoAttrExpsArr.push({...e.id===Gu.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),o}(n,i.map(t=>ca.getMeasure(e,t)),e,o)}};function mc({nodes:e,layout:t,dataset:n}){const o=function(e,t,n){const o=[];return e.forEach(e=>{o.push(dc.getCustomAttrExps(n,e,t))}),o}(e,t,n);return o.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function hc(e){const t=Gu.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:o,qLabelExpression:i,cId:r}}function fc(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const pc={migrateProperties(e){const t=ne(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let o=fc(t);return o=function(e,t){return t.concat(e.map(e=>hc(e)))}(n,o),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(o,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,o=function(e,t,n){let o=e.length;const i=[];return t.forEach(e=>{const t=hc(e),r=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${o}`,qOp:"add",qValue:r}),o++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(fc(e),t,n);return o},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const o=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},r=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,o)&&e.getEffectiveProperties().then(t=>{if(r){const o=this.migrateProperties(t);e.setProperties(o).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const o=this.getPatches(t);e.applyPatches(o,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var gc={attrExpr:pc};const{CUSTOM:yc}=Gu;function vc({flags:e,layout:t,app:n,model:o,picasso:i,chart:r,translator:s,localeInfo:l,embed:u,options:c}){const d={properties:void 0},m=lc({layout:t,app:n,model:o,picasso:i,chart:r,translator:s,localeInfo:l,embed:u}),h="rtl"===c.direction,f=()=>{const e=!!d.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{d.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&a(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const o=mc({dataset:e,nodes:n,layout:t});return{title:o.customTooltipInfoAttrExpsArr.find(e=>e.id===yc.TITLE)?.title,description:o.customTooltipInfoAttrExpsArr.find(e=>e.id===yc.DESCRIPTION)?.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>sc.checkIfPromisesExist({customTooltipModel:m}),createImageRow:({value:e,h:t})=>sc.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:o})=>{const i=sc.getDataNodes(r,o),{attrExps:a}=sc.getAttrExprData(t);return ec.handlePromises({customTooltipModel:m,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&u&&"function"==typeof o?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>oc.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>sc.getFooterRow(s.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>oc.show({app:n,properties:t,selectedNodes:e,customTooltipModel:m,rtl:h}),hasAlternateState:()=>!!m.miniChartToken?.alternateState,hide:()=>oc.hide({app:n,customTooltipModel:m}),destroy:()=>oc.destroyVisualization({customTooltipModel:m})}}}var bc=7005;const Mc=e=>e.qError?.qErrorCode!==bc,Sc=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},xc=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Cc=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},qc=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,o=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===o.length){const o=n[0];return o.qLibraryId?t.getDimension(o.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;xc(e,n)}return o}):t.getField(o.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(xc(e,t),o)),()=>o)}return Sc(e),Promise.resolve()};function Tc(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:o}}=e;t.length>1&&e.color?s(e,"color.persistent",!0):"byDimension"===o&&n.length>1?s(e,"color.mode","byMultiple"):"byExpression"===o&&0===n.length?s(e,"color.mode","primary"):0===t.length&&n.length>0&&(s(e,"color.byMeasureDef",void 0),s(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==o&&s(e,"color.mode","primary"))}const wc=(e,t)=>{Tc(t),us(e),sc.addCallbackCustomTooltip(t)},kc=e=>{Tc(e)};function Nc({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,o,i){let r;const a=i?.layout?i.layout.qHyperCube.qDimensionInfo.filter(e=>Mc(e)).length:t.qHyperCubeDef.qDimensions.length;return o.isAutoChart&&n>a-1?r="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?r="Visualizations.Descriptions.Stack":(r="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):r="Visualizations.Descriptions.Bars",e.get(r)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?qc(t,n.app).then(()=>(wc(e,t),e)):(Cc(t),wc(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter(e=>Mc(e)).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Sc(t),Tc(t),sc.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Tc(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),sc.removeCallbackCustomTooltip(t,e)},replace(e,t,n,o){sc.replaceCallbackCustomTooltip(o,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?qc(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,kc(t),e)):(Cc(t),kc(t),e),move(e,t){Sc(t),Tc(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Tc(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Lc(e){return{properties:Ku(),data:{targets:[{path:"/qHyperCubeDef",...Nc(e)}]}}}var Dc={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"en-US":"The chart is not displayed because it contains only negative values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。","zh-CN":"未显示图表,因为它仅包含负值。","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения."}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"en-US":"The data set contains negative values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值。","zh-CN":"数据集包含无法在此图表中显示的负值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};const Oc="REJECTED",Ec=()=>{},Ac=1e4,Ic={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},Pc=50,Rc=10,zc=100;var Bc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),o=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),r=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,r-e.qArea.qLeft),u=Math.min(r+o-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:r},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const o=n.qTop-Rc<=t.qTop,i=n.qLeft+n.qWidth+Rc>=t.qLeft+t.qWidth,r=n.qTop+n.qHeight+Rc>=t.qTop+t.qHeight,a=n.qLeft-Rc<=t.qLeft;return o&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||r&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var Fc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),o=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),r=Math.max(0,o-e.qArea.qTop),a=Math.min(o+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-o-(a-r),l={qArea:{qHeight:a-r,qWidth:e.qArea.qWidth,qTop:o,qLeft:i},qData:[{...e.qData[0],qUp:o,qDown:s,qSubNodes:[]}]};for(let t=r;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const o=n.qTop-Rc<=t.qTop,i=n.qTop+n.qHeight+Rc>=t.qTop+t.qHeight;return o&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var Hc={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 jc="pages";const _c="discretePan",Vc=10;function Uc({chart:e,actions:t,componentKey:n,dockService:o,rtl:i,scroller:r}){return{type:"Pan",key:"discrete:pan",options:{event:_c,pointers:1,threshold:Vc,enable(o,i){return this.started===_c||!i||!(!t.scroll.enabled()||!r.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${_c}start`](e){e.preventDefault(),this.started=_c;const t="horizontal"===o.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-Vc:Vc},[`${_c}move`](e){e.preventDefault();const t="horizontal"===o.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,r.scroll(s)},[`${_c}end`](e){e.preventDefault(),this.started=!1},[`${_c}cancel`](e){e.preventDefault(),this.started=!1}}}}function $c({chart:e,componentKey:t,actions:n,scroller:o}){return function(i){if(!n.scroll.enabled()||!o.enabled())return;const[r]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!r)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*zc;o.scroll(s)}}function Wc({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Ac/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const o=Math.min(t,Math.max(Ic.MAXIMUM,n));return{width:e,height:Math.max(Ic.MINIMUM,Math.min(n*Ic.MULTIPLIER,o))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:o,height:i}=t({width:e.qWidth,height:e.qHeight}),r=i?Math.ceil((i-e.qHeight)/2):0,a=o?Math.ceil((o-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:o?Math.min(o,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-r,n.height-i)):e.qTop,qLeft:o?Math.max(0,Math.min(e.qLeft-a,n.width-o)):e.qLeft}}}function Kc(e){let t,n;const o=i=>{t=i;const{method:r,args:a}=t.request;e[r](...a).then(e=>{if(t.canceled||n)return t.reject(Oc),t=null,void(n&&(o(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,r)=>{const a={request:e,resolve:i,reject:r,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(Oc),n=e})(a):o(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(Oc),n=null)},i}const Gc={command:{update:()=>{}}};var Yc={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const{pixel:i}=t,r=e.getDataPages()[0],a=i/o;return[a,n.inView>=n.inTotal?a+1:a+r.qArea.qWidth/n.inView]}};var Xc={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:o}){const i=void 0===o?4:o,r=Math.max(0,Math.floor(t)-i/2);return{qTop:r,qHeight:Math.min(e.meta.size.y-r,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const{pixel:i}=t,r=e.getDataPages()[0],a=o/n.inView,s=(i+r.qArea.qTop*a)/o;return[s,n.inView>=n.inTotal?s+1:s+r.qArea.qHeight/n.inView]}};function Jc(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function Zc(e,t){const n=[];for(let o=0;o<e.length;o++){const i=t(e[o]);-1===n.indexOf(i)&&n.push(i)}return n.length}function Qc(e){return Zc(e.qMatrix,e=>e[0].qElemNumber)-1}var ed={inTotal:function({layoutService:e}){const t=Jc(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:o}){const i=Jc(e),r=void 0===o?i:o,a=t/(i+1),s=Math.max(0,Math.floor((t-a-r/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+r)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:o}){const i=Jc(e),r=e.getDataPages()[0],a=o/n.inView,{pixel:s}=t,l=Qc(r),u=r.qArea.qHeight*i+l,c=(s+(r.qArea.qTop*i+r.qArea.qTop)*a)/o;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const td=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function nd(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return td(e,n);const o=((e,t)=>{const n={successful:!0,count:0};let o=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=o;t++){if(!e[t])return n.successful=!1,n;const r=e[t][0].qElemNumber;-1===i.indexOf(r)&&(i.push(r),o--)}return n.count=i.length-1,n})(t.qMatrix,n);return o.successful?o.count:td(e,n)},area(t,n,o){if(0!==t.qArea.qTop)return td(e,n);return Zc(t.qMatrix.slice(0,o.qTop+1),e=>e[0].qElemNumber)-1}}}var od={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:o}){const i=nd(t).itemOffset(e(),n),r=Math.max(0,Math.floor(n-i));return{qTop:r,qHeight:Math.min(t.meta.size.y-r,Math.max(0,Math.ceil(o+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:o,viewSize:i,upperBound:r}){const a=t.getDataPages()[0],s=i/o.inView,{item:l,pixel:u}=n,c=nd(t).area(e(),l,a.qArea),d=Qc(a),m=a.qArea.qHeight+d,h=u===r?(o.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[h,o.inView>=o.inTotal?h+1:h+m/o.inView]}};function id({chart:e,rect:t,dockService:n,itemWidths:o,axisKey:i,renderer:r,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:h}=o[n.meta.chart.mode],f="horizontal"===n.meta.major.orientation,{axisDisplayMode:p="auto",maxVisibleItems:g=10,label:y}=s,v=f?t.width:t.height,b=v/l>=m;switch(p){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:o={},isGrouped:i,itemSize:r,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=o;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>r;const h=(90-d)*(Math.PI/180);return m>Math.cos(h)*r}({chart:e,isHorizontal:f,axisKey:i,renderer:r,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}var rd="AVERAGE",ad="LINEAR",sd="POLYNOMIAL2",ld="POLYNOMIAL3",ud="POLYNOMIAL4",cd="EXPONENTIAL",dd="LOG",md="POWER";function hd({dimValue:e,value:t,qTrendLine:n}){const{qType:o,qCoeff:i}=n,r={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(o){case ld:return r.y+=i[3]*t**3,r;case ud:return r.y+=i[4]*t**4+i[3]*t**3,r;default:return r}}var fd={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:hd,polynomial3:hd,polynomial4:hd,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function pd(e,t){const n=fd[t.qType.toLowerCase()],o=Math.max(1,e/500);let i=1/0,r=-1/0;for(let a=0;a<e;a+=o){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),r=Math.max(e,r)}return{min:i,max:r}}function gd(e){return fd[e.qType.toLowerCase()]}function yd(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,o,i)=>{const r=[],a=gd(n),s=t.get("zoom"),l=n.start??s.min,u=n.end??s.max,c=(u-l)/100,d=e.meta.isButterfly&&i>0;if(c>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=o,t.measureIndex=i,t.dimValue=e,r.push(t)};let t=l;for(let n=l;n<=u;n+=c)e(n),t=n;t!==u&&e(u)}return r},calculate:(e,t)=>gd(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,o)=>{const i=[],r=e.getDataPages()[0],a=r.qData[0].qSubNodes,s=r.qArea.qTop,l=fd[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const r=a[e],u=l({dimValue:r.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=o,u.dimValue=r.qText,i.push(u)}return i},findMinMax:pd}}(e):function(e){return{generate:(t,n,o)=>{const i=[],r=e.getDataPages()[0],a=r.qMatrix,s=r.qArea.qTop,l=fd[t.qType.toLowerCase()],u=e.meta.isButterfly&&o>0;for(let e=0;e<a.length;e++){const r=a[e][0],c=e+s+1,d=l({dimValue:r.qElemNumber,value:c,qTrendLine:t});u&&(d.y=-d.y),d.layerId=n,d.measureIndex=o,d.dimValue=r.qText,i.push(d)}return i},calculate:(e,t,n)=>(0,fd[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:pd}}(e)}var vd={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},bd={color:"#f93f17",index:9};const{isDark:Md}=ls,Sd={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},xd=({layoutService:e,viewState:t,colorModel:n,chart:o,env:i,keys:{colorScale:r},isEnabled:a=()=>!1})=>{const{translator:s}=i,l=[Sd],u=[],c=[],d=yd(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map(()=>t)))});const h=m(e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=o.scale(r)(t);return Md(n)?function(e){const t=rs(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=rs(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(bd)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:h,getLineDash:e=>{const{style:t}=u[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=u[e]||{};return t?.lineThickness??2},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(vd.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach(o=>{const i=d.findMinMax(e.meta.size.y,o);t=Math.min(i.min,t),n=Math.max(i.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const o=u[e];return d.calculate(o,t,n)}},command:{update:()=>{l.length=0,u.forEach((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)})}}}};var Cd={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const qd=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Td=(e,{layoutService:t,trendLineModel:n,dockService:o,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const r=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:o,dockService:i,animationsEnabled:r})=>{const a=qd(o);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:Cd,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:r,trackBy:vl.nonUpdatingNode.trackBy,compensateForLayoutChanges:vl.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:o,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:o,dockService:i})=>{const r=qd(o),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:r},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:Cd,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:o});return[r,a]};function wd(e,t){const{getLabel:n,getType:o,getLineDash:i,getStroke:r}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:r(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:o(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function kd(e,{h:t,style:n}){return e.map(e=>{const o={style:{direction:"string"==typeof e.content?ua.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(o.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:ua.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",o,i)})}function Nd(e,t){return({h:n,data:o,style:i})=>{const r=o[0].title,a=o.filter(e=>e.title===r),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:ua.detectTextDirection(t)},t);return e("tr",{},n)}(n,r),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},kd(e.row,{h:n,style:i})))}),o.length>2){const i=o.length-2;l.push(...function(e,t,n,o){const i=t?t.get("Object.ChartTooltip.NMore",o):`+${o} more`,r=ua.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:r},colspan:3},i))]}(n,e,t,i))}return l}}function Ld(e,{trendLineModel:t,translator:n},o={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=o,r=ra({key:e.tooltip,rtl:i});return ne(!0,r,{settings:{extract:wd(e,t),content:Nd(n,i),placement:"pointer",direction:o.rtl?"rtl":"ltr"}})}function Dd(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function Od(e,{chart:t,viewState:n,trendLineModel:o,layoutService:i,rtl:r}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Dd(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=o.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(o,a)=>{const l=Dd(o,t),u=t.shapesAt({cx:(c=l).x,cy:c.y,r:3},s);var c;if(u.length){const o=function(e,t,n,o){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=o?1-i:i;const{min:r,max:a}=n.get("zoom");return r+(a-r)*i}(l,a,n,r),s=t.scale(e.majorInnerScale),c=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(o);u.forEach(e=>{e.data.dimValue.value=o,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,o).y})}return u}}return n=>{const o=t.component(e.tooltip);if(o&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,o);return e.length?(o.emit("show",n,{nodes:e}),!0):(o.emit("hide"),!1)}return!1}}const Ed=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},Ad=e=>{Ed(e),e.qMultiDimMode="Sum",e.qXColIx=0};function Id(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:o=!1}=e;return{show:(e,t,{layout:n})=>!Yr.dimensionless(n)&&!Yr.groupedByDimension(n)&&(o||!Yr.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:vd.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(vd.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:vd.ADD_BUTTON,add:Ad,globalChange:e=>{const t=a(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),o=(e=>!a(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=o}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:vd.TYPE,options:[{value:rd,translation:vd.TYPES.AVERAGE},{value:ad,translation:vd.TYPES.LINEAR},{value:sd,translation:vd.TYPES.POLYNOMIAL2},{value:ld,translation:vd.TYPES.POLYNOMIAL3},{value:ud,translation:vd.TYPES.POLYNOMIAL4},{value:cd,translation:vd.TYPES.EXPONENTIAL},{value:dd,translation:vd.TYPES.LOG},{value:md,translation:vd.TYPES.POWER}],defaultValue:rd},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:bd,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:vd.STYLE.DASHED,type:"boolean",defaultValue:!0,change:Ed}}}}var Pd,Rd;var zd=function(){if(Rd)return Pd;Rd=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},Pd=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,o,i,r,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(o=this._events[t],e.isUndefined(o))return!1;if(e.isFunction(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),a=1;a<i;a++)r[a-1]=arguments[a];o.apply(this,r)}else if(e.isObject(o)){for(i=arguments.length,r=new Array(i-1),a=1;a<i;a++)r[a-1]=arguments[a];for(i=(s=o.slice()).length,a=0;a<i;a++)s[a].apply(this,r)}return!0},t.prototype.addListener=function(n,o){var i;if(!e.isFunction(o))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(o.listener)?o.listener:o),this._events[n]?e.isObject(this._events[n])?this._events[n].push(o):this._events[n]=[this._events[n],o]:this._events[n]=o,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var o=!1;function i(){this.removeListener(t,i),o||(o=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var o,i,r,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(o=this._events[t]).length,i=-1,o===n||e.isFunction(o.listener)&&o.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(o)){for(a=r;a-- >0;)if(o[a]===n||o[a].listener&&o[a].listener===n){i=a;break}if(i<0)return this;1===o.length?(o.length=0,delete this._events[t]):o.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,o;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[t],e.isFunction(o))this.removeListener(t,o);else if(Array.isArray(o))for(;o.length;)this.removeListener(t,o[o.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},Pd}(),Bd=Z(zd);const Fd={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 Hd=e=>(Object.keys(Bd.prototype).forEach(t=>{e[t]=Bd.prototype[t]}),Bd.init(e),e);var jd={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}},_d={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",BASE_TOOLTIP_NEW:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const Vd=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==bc),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==bc);return 1===(t?.length??0)&&2===(n?.length??0)},Ud=e=>({layout:e})=>{const t=_r.canBeContinuous(e),n=Yr.continuous(e),o=Yr.dimensionless(e),i=Vd({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:_r.isTime(n,e),isDimensionless:o,isSimple:Yr.simple(e),isGrouped:!i&&Yr.grouped(e),isGroupedByMeasure:!i&&Yr.groupedByMeasure(e),isGroupedByDimension:!i&&Yr.groupedByDimension(e),isStacked:!i&&Yr.stacked(e),isStackedByDimension:!i&&Yr.stackedByDimension(e),isStackedByMeasure:!i&&Yr.stackedByMeasure(e),isSnapshot:Yr.snapshot(e),isButterfly:i}};function $d({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:o,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&o({componentName:"continuousRangeBrush",brushName:!1})}function Wd({chart:e,actions:t,selections:n}){const o=e.scale(_d.SCALE.MAIN.MAJOR);return h({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:o,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:$d},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}const Kd=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const o=e.qDimensionInfo[n];if(!(o.qLocked||o.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function Gd({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function Yd({app:e,model:t,translator:n,picasso:o,localeInfo:i,theme:r,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,m={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=u.model().mode,g=c||p||d,y=!c&&(p||d)&&l?l.getHyperCube():void 0,v=y?"legendCube":void 0;return m.main=f({app:e,model:t,translator:n,picasso:o,layoutService:s,config:{localeInfo:i,auto:Gd,key:_d.SCALE.MAIN.COLOR},createConfig:()=>({hc:g?y||s.getHyperCube():u.model().cube,source:g?v:"miniCube",theme:r})}),h.push(m.main.initialize()),c&&(m.mini=f({app:e,model:t,translator:n,picasso:o,layoutService:s,config:{localeInfo:i,auto:Gd,key:_d.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:r})}),h.push(m.mini.initialize())),Promise.all(h)},getMain:()=>m.main,getMini:()=>m.mini}}function Xd({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:o,isDimensionless:i}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:o?`${t.data.label}, ${t.data.stack.label}`:i?void 0:t.data.label}function Jd({chart:e,actions:t,translator:n,rtl:o,viewState:i,viewModel:r,layoutService:a,dockService:s,colorService:l,themeService:u,trendLineModel:c,custom:d}){const{isTwoDimensional:m,isStacked:h,isGroupedByDimension:f,isGroupedByMeasure:g,isStackedByDimension:y,isStackedByMeasure:v}=a.meta,{fontFamily:b}=u.getStyles(),M=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:o,BAR_OOB_MAX:i,GROUP_AXIS:r}=_d.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,u="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:c,collectedBounds:d})=>{const[m]=t,{triggerer:h}=l;if(h===o||h===i)return{key:m.key,bounds:m.bounds};if(u&&(h===n||h===r)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===o||e.key===i)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===o||e.key===i)&&e.data.value===m.data.value),r=e.findShapes("path").find(e=>s&&h===n?e.key===i&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:e.key===i&&e.data.value===m.data.value);if(t)return a?{key:r?r.key:_d.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!u&&!c.some(e=>e.bounds.height+e.bounds.width!==0)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===o||e.key===i)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===o||e.key===i)&&e.data.value===m.data.value);if(t)return{key:t.key,bounds:t.bounds}}return!1},"collectible"]}({layoutService:a,dockService:s}),S=Od({majorInnerScale:_d.SCALE.MAIN.MAJOR_INNER,tooltip:_d.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:_d.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:i,trendLineModel:c,layoutService:a,rtl:o}),x=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);e.findShapes("container").filter(e=>e.key===_d.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>v?e.data?.value===n.data.value:e.data?.stack.value===n.data.value).forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return p({chart:e,translator:n,config:{rtl:o,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:b},main:{key:_d.COMPONENT.BASE_TOOLTIP_NEW,suppress:({event:e})=>S(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:_d.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>g?t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===_d.COMPONENT.BAR_AXIS||t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:y?e.stack.value:e.value},{key:`${_d.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX||t.triggerer===_d.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${_d.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===_d.COMPONENT.BAR_OOB_MIN||t.triggerer===_d.COMPONENT.BAR_OOB_MAX||t.triggerer===_d.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[_d.COMPONENT.BAR],collect:{from:"single"},placement:M},{keys:[_d.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>f?[e.value,e.group.value]:e.value,after:x},placement:M},{keys:[_d.COMPONENT.BAR_OOB_MIN,_d.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>g?[e.value,e.measureIndex.value]:f?[e.value,e.group.value]:e.value,after:x},placement:M},{keys:[_d.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:M}],layout:{grouping:m,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:o,formatter:i,create:s,util:l})=>{const[u]=n,{title:c,description:m,measures:h}=d.isEnabled()?d.getAttributes({dataset:o,nodes:[u]}):{},f=[];c&&f.push(s.text({value:c,style:{bold:!0}})),m&&f.push(s.text({value:m}));const p=d.hideBasic();if(p&&!h.length&&(c||m)||f.push(s.text({value:Xd({layoutService:a,node:u}),style:{bold:!0}})),!p){const t=void 0!==u.data.fill?.value?e.scale(_d.SCALE.MAIN.COLOR)(u.data.fill.value):void 0;f.push(s.color({nodes:n,property:_d.SCALE.MAIN.COLOR,fillColor:t})),f.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:o,util:i,node:r}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(_d.FORMATTER.MINOR),{segment:a}=r.data,l=s&&t?t(a.value):a.label;return o.measure({label:i.dataset.title(r.data.source.key,e.fields.minor[s?0:r.data.measureIndex.value]),value:!0===r.data.null?.value||"NaN"===l?"-":l})}const{data:l}=r,{end:u}=l,{key:c,field:d}=u.source;return o.measure({label:i.dataset.title(c,d),value:u.label})}({viewModel:r,layoutService:a,formatter:i,create:s,util:l,node:e})))}h&&f.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),f.push(s.raw({value:d.chart.createLimitationRow()}))):f.push(s.raw({value:d.chart.createContainer({h:t})})));const{customTooltipImages:g}=u.data;return d.isEnabled()&&g&&f.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t})}))),f.filter(Boolean)},sections:({nodes:t,formatter:o,meta:i,create:r,sections:a})=>{if(!h||i.triggerer!==_d.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===_d.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const u=o(_d.FORMATTER.MINOR),c=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:u?u(e):e}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:u?u(e):e}))}a.unshift(r.section({content:[r.text({value:l.data.label,style:{bold:!0}}),...c]}),r.divider())},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:_d.COMPONENT.LEGEND_CAT_TOOLTIP,component:_d.COMPONENT.LEGEND_COLOR_CAT}}}})}const Zd={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:o}=n[t];return o},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:o=0,qSelected:i=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+o+i:t}};function Qd({layoutService:e}){return g({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const o=e.getLayout().qHyperCube.qDimensionInfo[1];return Zd.getDimensionSize(o)>_r.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function em(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function tm(e){return e.some(em)}function nm(e,t){let n=NaN,o=NaN;return e.forEach(e=>{tm(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),o=Number.isNaN(o)?e.qNum:Math.max(e.qNum,o))})}),{min:n,max:o}}function om(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const o=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==o&&"minMax"!==o||(t=+e.getLayoutValue("measureAxis.min")),"max"!==o&&"minMax"!==o||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function im(e,t){let n=NaN,o=NaN;return e.forEach(e=>{if(!tm(e)){let i=0,r=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?r+=e.qNum:i+=e.qNum)}),n=Number.isNaN(n)?i:Math.min(i,n),o=Number.isNaN(o)?r:Math.max(r,o)}}),{min:n,max:o}}function rm(e,t){const n={};e.forEach(e=>{if(!tm(e)){const o=e[0].qElemNumber;n[o]=n[o]?n[o]:{min:0,max:0,cId:o},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[o].max+=e.qNum:n[o].min+=e.qNum)})}});let o=NaN,i=NaN;return Object.keys(n).forEach(e=>{o=Number.isNaN(o)?n[e].min:Math.min(n[e].min,o),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)}),{min:o,max:i}}function am(e){return"number"==typeof e&&!Number.isNaN(e)}function sm(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,am(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,am(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>am(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>am(e.qMax)).map(e=>e.qMax))}}const{isNumber:lm}=Ls;function um(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function cm(e){return!Number.isNaN(+e.qNum)}function dm(e){return e.qNum}function mm(e){return!Number.isNaN(+e.qNum)}function hm(e){return e.qNum}function fm(e,t){return e.push(...t),e}const{getValueWithOffset:pm,isNumber:gm}=Ls,ym=5,vm=.2;function bm(e,t){return Math.abs(e/t)<ym||0===t}function Mm({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:o=im,stackedByDimensionExtractor:i=rm,straightExtractor:r=nm,measureInfoExtractor:s=sm,explicitExtractor:l=om}=n,{meta:u}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:o,count:i}){let r,a;if(Array.isArray(n)?({min:r,max:a}=this.extractFromStacked(n)):({min:r,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();r=Number.isFinite(e)?Math.min(r,e):r,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(o),u=this.extractExplicit(),c=[0,r,a].filter(e=>gm(e));let d=Math.min(...c),m=Math.max(...c);d=bm(s,d)?Math.min(d,s):d,m=bm(l,m)?Math.max(m,l):m;const h=[u.explicitMin,u.explicitMax,d,m].filter(e=>gm(e));return r=Number.isNaN(u.explicitMin)?Math.min(...h):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...h):u.explicitMax,r===a&&(Number.isNaN(u.explicitMin)?r=pm(r,-vm):Number.isNaN(u.explicitMax)&&(a=pm(a,vm))),{min:r,max:a,implicitMin:d,implicitMax:m,otherMin:s,otherMax:l,hasOtherMin:s<r,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:o,isExplicitMax:i}=l(e);return{hasExplicitMinMax:o||i,hasExplicitMin:o,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.filter(e=>lm(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...n[0].qSubNodes.filter(e=>lm(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0};var n},extractFromStraight(t,n){const a=t.length?t[0].qMatrix:[];return u.isStackedByMeasure?o(a,n):u.isStackedByDimension?i(a,n):e.getHyperCubeValue("qHasOtherValues")?r(a,n):s(e)},extractOthers:e=>u.isStackedByDimension?function(e){const t=um(a(e,"0.qData.0.qSubNodes",[]),em,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):u.isGroupedByDimension?function(e){const t=a(e,"0.qMatrix",[]).filter(tm).reduce(fm,[]).filter(mm).map(hm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=um(a(e,"0.qMatrix",[]),tm,[]).filter(cm).map(dm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Sm(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:o,getHyperCubeValue:i}=t,r=e=>!e.length&&o.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!o.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(o.isContinuous){const e=o.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const u=o.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(r(e))return a(l);let t=[];return l&&(t=o.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}})}}}(e),n=Mm(e);return t.resolve().then(e=>n.extract(e))}const xm="lasso",Cm=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:o},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:o,options:{event:xm,enable(e,n){if(this.started===xm||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==xm&&(i.actions.select.emit("start",xm),this.chart.component(e).emit("lassoStart",t),this.started=xm)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",xm),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const qm=({targets:e,requireFailure:t,recognizeWith:n,components:o,eventName:i="tap"},r)=>{let a;const s=r.customTooltipModel?r.customTooltipModel.utils:void 0,l=s?r.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!r.actions.select.enabled()&&!r.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let o,i;return e.center?(({x:o}=e.center),({y:i}=e.center)):(o=e.clientX,i=e.clientY),{x:o-n.left,y:i-n.top}}(t,this.chart),u=r.hitRadius?r.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=r.shapesAt?r.shapesAt(c):this.chart.shapesAt(c,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),m=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&m&&m.show;if(!r.isLocked(a)&&!r.tooltipOnly&&r.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1,r.actions.select.emit("start",i,e)),d.length&&o){this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof o?o(t,d):o;this.chart.brushFromShapes(d,{components:e}),r.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:r.largeDataService,chart:this.chart})}}if(m&&r.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=r;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:r,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else h&&m.emit("hide")}}}};const Tm=({key:e,requireFailure:t,recognizeWith:n,eventName:o="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${o}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${o}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const wm=({eventName:e,key:t,fillTargets:n=[],requireFailure:o,recognizeWith:i},r,a)=>({key:`event:${t}`,type:"Pan",requireFailure:o,recognizeWith:i,options:{event:e,enable(o,i){if(this.started===e||!i)return!0;if(!r.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),r.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof r.updateOnMove&&r.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),r.actions.select.emit("end",e),this.started=!1,"function"==typeof r.updateOnEnd&&r.updateOnEnd()}}});function km(e,t){const n=function(e){const{key:t,targets:n,fillTargets:o,targetSelector:i,targetFillSelector:r,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:n.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:o,selector:i,fillSelector:r,fill:"rgba(82,204,82,0.2)"}}}}(e),o=wm(e,t,"range");return{interactions:[e.onEdited?Tm(e,t):null,o].filter(Boolean),components:[n]}}const Nm={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},Lm="inner-time-axis",Dm="outer-time-axis";const Om={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const o=t?0:e.qDimensionInfo.length-1;n=Zd.getMaxGlyphCount(e,o)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?a(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Om.getAxisData(e,t),o=!e.qDimensionInfo.length,i=o||t?void 0:e.qDimensionInfo.length-1,r=Om.getMajorAxisMaxGlyphCount(e,t),a=o?"qFallbackTitle":"qText";return na.getAdjustedMaxGlyphCount(r,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Om.getAxisData(e),n=Zd.getMaxGlyphCount(e,0);return na.getAdjustedMaxGlyphCount(n,t,0)}};var Em=3,Am=13;function Im(e,t,n,o){const{meta:i}=t.layoutService,r=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?r.push(...function(e,t,n,o){const{meta:i}=t.layoutService,{axis:r,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,m=Nm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:Nm.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:vl.lines.trackBy,compensateForLayoutChanges:vl.lines.compensateForLayoutChanges}},f=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",o=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:r.line.major.color},minorGuideLine:{stroke:r.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:o},guideLine:{major:{justify:o},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:vl.axes.trackBy({isTime:!0}),compensateForLayoutChanges:vl.axes.compensateForLayoutChanges({isTime:!0})}};c.push(ne(!0,{},d,{key:Lm,scale:_d.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:ne(!0,{},a,{line:{stroke:r.line.major.color},majorGuideLine:{stroke:r.line.minor.color},minorGuideLine:{stroke:r.line.major.color}})})),c.push(ne(!0,{},d,{key:Dm,scale:_d.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:_d.SCALE.MAIN.MAJOR,layout:{dock:`@${Dm}`,minimumLayoutMode:m}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:_d.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Lm}`,minimumLayoutMode:m}}),c.push(f)}return c.push(ne(!0,{},h,{key:"inner-time-grid",x:{scale:_d.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(ne(!0,{},h,{key:"outer-time-grid",x:{scale:_d.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,renderer:Nl(t.flags),scale:_d.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:r.line.major.color},line:{show:!o},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:vl.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:vl.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:_d.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:m}}),c.push(f)),c.push(ne(!0,{},h,{key:"continuous-grid",x:{scale:_d.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,o)):r.push(...function(e,t,n,o){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,r=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,m=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:Nl(t.flags),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:Nm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...m},line:{show:!o,stroke:r.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:vl.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:vl.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(ne(!0,{},h,{key:"group-axis",scale:_d.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:Om.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&h.settings.line.show}}}));const f=Om.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(ne(!0,{},h,{key:_d.COMPONENT.BAR_AXIS,scale:_d.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:f,maxLengthPx:d,tiltThreshold:f>Em&&f<Am?1:void 0},line:{show:!(u&&l)&&h.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,o));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&r.push({type:"axis",key:"y-axis",renderer:Nl(t.flags),formatter:_d.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:Nm.measureAxis.minimumLayoutMode},scale:_d.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:vl.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:vl.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),r}var Pm={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function Rm({layoutService:e,discrete:t}){const{isContinuous:n,isGrouped:o}=e.meta;if(n)return 1;const i=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(i?.style?.width){const{style:e}=i;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=Pm.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),o=e.width+n;return o>1?e.width-(o-1):e.width}:e.width}return o?.9:.7}const zm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Bm(e,t,n={}){return({data:o})=>{const i=e.chart.component(t).rect;if(!o.items.length||!i)return 2;const{min:r,max:a}=e.viewState.get("zoom");if(n[[r,a]])return n[[r,a]];const s=zm[Br.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-r),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=Math.min(l/u/.2,1),d=2*(1-(m=1-c))+s*m;var m;return n[[r,a]]=Math.max(2,Math.min(s,d)),n[[r,a]]}}function Fm(e,t){const{hasExplicitMax:n,explicitMax:o}=t;return!!n&&e>o&&o<=0}function Hm(e,t){const{hasExplicitMin:n,explicitMin:o}=t;return!!n&&e<o&&o>=0}function jm(e,t){const{hasExplicitMax:n,explicitMax:o}=t;return!!n&&e>o&&o>0}function _m(e,t){const{hasExplicitMin:n,explicitMin:o}=t;return!!n&&e<o&&o<0}const Vm="max",Um="min",$m={min:"Min",max:"Max"};function Wm(e,t,n){return void 0===n?Fm(e,t)||Hm(e,t):n===Vm?Fm(e,t):Hm(e,t)}function Km({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${$m[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===Vm?e.implicitMax:e.implicitMin;return!Wm(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function Gm(e,{barComponent:t,type:n,isStacked:o}){const{viewCache:i,dockService:r,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===Vm?s.implicitMax:s.implicitMin;if(!Wm(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===Vm?r.meta.minor.end:r.meta.minor.start;let d="end";o&&(d=n===Vm?"sumOfPositives":"sumOfNegatives");const m=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:Zr.getDockValue(c),oob:ne({},t.settings.box,{fill:m.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!o||0!==e.datum[d].value)&&Wm(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:vl.barOobs.compensateForLayoutChanges}}}function Ym(e){return Math.min(Math.max(0,e),1)}const Xm=(e,{chart:t,type:n,componentKey:o,collectionKey:i})=>{const{layoutService:r,dockService:a,viewCache:s}=e,{isStacked:l}=r.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!Km({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${_d.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:_d.SCALE.MAIN.MAJOR,fn:d},minor:{scale:_d.SCALE.MAIN.MINOR,start:e=>Ym(t.scale(_d.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const o=t.scale(_d.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[i]?e.datum[i].value:o[n]();return Ym(o(r))}},box:{width:Rm({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const o=t.scale(_d.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[i]?e.datum[i].value:o.max();return"max"===n?r>o.max():r<o.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function Jm(e,t){const{style:n,styleService:o,dockService:i}=t,r=o.label.getStyle(),a=r.useContrastColor&&!e.onBackground?function(e){return function(t){return ls.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):r.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function Zm(e){return{placements:e.simplifiedPlacements.map(t=>Jm(t,e)),label:e.label}}function Qm(e,t){if(t){if(function(e,t){return Fm(e,t)}(e,t))return-1;if(function(e,t){return Hm(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function eh(e,t,n,o){const i=Qm(e,o);let r="up";return"vertical"===t&&i<0?r="down":"horizontal"===t&&(r=i>=0&&!n||i<0&&n?"right":"left"),r}function th(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:o,isContinuous:i}=t.layoutService.meta;return!o||!i&&!!n.showSegmentLabels}function nh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:o,isContinuous:i}=t.layoutService.meta;return!!o&&(!!i||!1!==n.showTotalLabels)}function oh(e,t,n,o){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:o}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function ih({layout:e,component:t,minorScale:n},o,i){if(!th(e,o))return!1;const{viewModel:r,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=o,{meta:d}=l,m=s.get("minorMinMax"),h=c.getStyles(),f=o.styleService.label.getStyle();let p;!d.isStacked&&(p=d.isStacked?1:0);const g=0===p?1:0,y=d.isStacked?.5:1,v=r.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let M,S=-1;M=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>S?b(e.data.segment.value):""}:function(e){return e.data.end.label};const x={label:M,simplifiedPlacements:oh(p,g,y,d.isContinuous),style:h.label.value},C=[Zm(ne(o,x))],q=[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>eh(e.data.end.value,u.meta.minor.orientation,i,m),labels:C,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily,linkData:vl.labels.linkData}}}],T={key:"bar-labels",type:"labels",renderer:Nl(o.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:q},animations:{enabled:o.viewModel.animations.enabled,trackBy:vl.labels.trackBy,compensateForLayoutChanges:vl.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(T.beforeRender=()=>{S=function(e,t,n){const o="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),r=i&&i.rect?i.rect[o]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/r}(t,o,n)}),T}const rh={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let o;return t.isStackedByDimension?o=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(o=n.group?n.group.label:void 0),void 0!==o?`${n.label}, ${o}`:n.label},getMeasure(e,t,n,o,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const r=t.data,a=n.isStacked?o.viewModel.fields.minor[n.isStackedByDimension?0:r.measureIndex.value]:void 0,s=n.isStacked?{source:{key:r.source.key,field:a},label:!0===r.null?.value?"":n.isStackedByDimension&&i?i(r.segment.value):r.segment.label}:r.end;return ca.getMeasure(e,s)},getMeasures(e,t,n,o,i){const r=e.resources.dataset;return t.map(e=>rh.getMeasure(r,e,n,o,i)).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const o=e.resources.dataset;return mc({nodes:t,layout:n.layoutService.getLayout(),dataset:o})},extractBarTooltipData(e,t,n,o,i){const r={title:rh.getTitle(t,n),color:ca.getColor(e,t,o),measures:rh.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,o,i)};if(rh.useCustomTooltip(o)){const n=rh.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],o);r.customMeasures=n.customTooltipAttrExpsArr,r.customTitle=n.customTooltipInfoAttrExpsArr.filter(e=>e.id===Gu.CUSTOM.TITLE),r.customDescription=n.customTooltipInfoAttrExpsArr.filter(e=>e.id===Gu.CUSTOM.DESCRIPTION);let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach(e=>{e.data.customTooltipImages?.length>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)}),i.length>0&&(r.customImages=i);const a=o.layoutService.getLayout();if(a.tooltip?.chart?.object?.refId&&o.app&&o.customTooltipModel.embed&&"function"==typeof o.customTooltipModel.model?.getEffectiveProperties)if(o.app.isInModalSelection?.()){if(a?.qHyperCube?.qDimensionInfo?.length>0){oc.destroyVisualization({customTooltipModel:o.customTooltipModel});const e=o.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");r.customLimitation=e}}else{const t=oc.createContainer({ctx:e,layout:a});r.customChart=t}}return r},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData:(e,t,n)=>({title:e.data.label,measures:[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter(e=>0!==e).map(e=>({label:`${rh.getTotalStackTitle(e,t)}`,value:n?n(e):e}))}),extractTooltipData(e,t){const n=t.chart.formatter(_d.FORMATTER.MINOR),{meta:o}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],r=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map(e=>rh.extractStackTotalBarTooltipData(e,t.translator,n)):[];return{barTooltipData:i.map(i=>rh.extractBarTooltipData(e,i,o,t,n)),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:r}},extractBarNodeData(e,t,n,o,i,r,a){let s=!i&&ca.getTitleRow(t,o);const l=ca.hideColorRow(t,n),u=!r&&!l&&ca.getColorRow(e,t,o),c=t.measures.map(i=>!a&&ca.getMeasureRow(i,e,t,o,l&&i.field===n.coloring.field)).filter(e=>!rh.isSameMeasureAndColorRow(e,u,o));if(rh.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map(n=>ca.getMeasureRow(n,e,t,o,!1)),r=!(!t.customTitle[0]||i)&&ca.getTitleRow(t.customTitle[0],o),a=!(!t.customDescription[0]||i)&&ca.getDescriptionRow(t.customDescription[0],o);s=!rh.shouldIgnoreTitleRowForCtt(r,a,c,n)&&s;const l=[r,a,s,u,...c,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(sc.getFooterRow(t.customLimitation,o)),t.customImages){const n=t.customImages.map(t=>sc.getImageRow(t,e));l.push(...n)}return l.filter(Boolean)}return[s,u,...c].filter(Boolean)},extractStackTotalBarNodeData:(e,t,n)=>[!!t.measures.length&&ca.getTitleRow(t,n),...t.measures.map(o=>ca.getMeasureRow(o,e,t,n,!1))].filter(Boolean),useCustomTooltip:e=>a(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,o)=>!1===n[0]&&0===o.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some(e=>e.field===n.coloring.field),shouldIgnoreDefaultRows:(e,t)=>rh.useCustomTooltip(t)&&a(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,o){const{meta:i}=t.layoutService,r=t.layoutService.getLayout(),a=o.length;let s,l,u=[];const c=rh.shouldIgnoreDefaultRows(r,t);for(s=0;s<a;s++){l=o[s];const r=rh.shouldIgnoreTitleRow(i,s),d=c||rh.shouldIgnoreColorRow(i,s),m=c||rh.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(rh.extractBarNodeData(e,l,t,n,r,d,m)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let o=[];return n.some(e=>e.measures.length)&&n.forEach(n=>{o=o.concat(rh.extractStackTotalBarNodeData(e,n,t))}),o},extractData(e,t,n){const{barTooltipData:o,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:r}=rh.extractTooltipData(e,t),a=rh.extractStackTotalBarsData(e,n,r);a.length&&a.push(ca.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=rh.extractBarsData(e,t,n,o),u=a.concat(s),c=i+l;return c&&u.push(ca.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter(e=>{const t=e.bounds;return t.width>0&&t.height>0}),n=t.length?t:e;return Tl.combineBounds(n.map(e=>e.bounds))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:o,data:i,groupProp:r}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,m;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===o&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,m=n===o&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[r]?i[r].value:void 0,d=u(n===o&&void 0!==c?[c,e]:e),m=n===o&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const h=(d+m/2)*a[l],f={width:0,height:0};return"horizontal"===s?(f.x=h,f.y=a.height):(f.y=h,f.x=0),f},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:o,barAxisKey:i,majorScale:r,majorInnerScale:a,groupProp:s}){const l=n.filter(e=>e.children&&e.children.length);let u;return u=l.length?rh.calculateBoundsFromBars(l):rh.calculateBoundsFromScale({opts:e,barKey:o,scale:t[0].key===i?r:a,majorScale:r,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter(e=>e.data&&t.indexOf(e.key)>-1),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels(e,t,n,o){const i=e.filter(e=>t.some(t=>n(e,t,o)));return i},findBarsFromGroupLabelsInGroupedByDim(e,t,n){const o=rh.isBarMatchingLabelOnProp;return rh.findBarsMatchingLabels(e,t,o,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter(e=>t.some(t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)),findBarsFromLabelsInSingleDim(e,t){const n=rh.isBarMatchingLabel;return rh.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,o){const i=t.filter(e=>e.key===n),r=t.filter(e=>e.key!==n),a=rh.findBarsFromBarLabelsInGroupedByDim(e,i,o),s=rh.findBarsFromGroupLabelsInGroupedByDim(e,r,o);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=rh.isBarMatchingLabel;return rh.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=rh.isBarMatchingLabel;return rh.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const o=rh.isBarMatchingLabelOnProp;return rh.findBarsMatchingLabels(e,t,o,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>rh.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:o,groupProp:i,stackProp:r}){const{meta:a}=t.layoutService,s=rh.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?rh.findBarsFromLabelsInStackedByDim(s,e,r):a.isStackedByMeasure?rh.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?rh.findBarsFromLabelsInGroupedByDim(s,e,o,i):rh.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:o}=t.layoutService;if(o.isStacked){const i=rh.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return o.isStackedByDimension?rh.findStackTotalBarsFromLabelsInStackedByDim(i,e):rh.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:m}=t.layoutService;if(e.length){let h=rh.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(h=h.filter(d)),rh.isSingleBarMode(m,h))return[h[0]];if(h.length){let m=rh.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,r,a],stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:r,barOobMinKey:a,groupProp:s,stackProp:l});d&&(m=m.filter(d));const f=rh.calculateTotalBounds({opts:t,labels:e,bars:m,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),p=rh.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:o});return[{key:n,bounds:f,childrenNodes:h,data:h.map(e=>e.data),stackTotalBarNodes:p}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,groupAxisKey:r,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let m=rh.filterNodesOnKeys(e,[i,r]),h=m&&m.length?[m[0]]:[];const f=rh.filterNodesOnLabels({labels:h,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(f&&f.length)return f;const{meta:p}=t.layoutService;if(p.isStackedByMeasure){m=rh.filterNodesOnKeys(e,[a,s]),h=m&&m.length?[m[0]]:[];const r=e=>rh.filterNodesForOob(e,n,a),f=rh.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:r});if(f&&f.length)return f[0].stackTotalBarNodes=void 0,f}if(p.isStackedByDimension){m=rh.filterNodesOnKeys(e,[a,s]),h=m&&m.length?[m[0]]:[];const r=e=>rh.filterNodesForOob(e,n,a),f=rh.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:o,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:r});if(f&&f.length)return f[0].stackTotalBarNodes=void 0,f}const g=rh.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function ah(e,t={},n){let o=[];const i=ra({key:_d.COMPONENT.BASE_TOOLTIP,rtl:n});return ne(!0,i,{scale:_d.SCALE.MAIN.COLOR,settings:{filter:e=>rh.filterNodes({nodes:e,opts:t,barKey:_d.COMPONENT.BAR,stackTotalBarKey:_d.COMPONENT.STACK_TOTAL_BAR,barAxisKey:_d.COMPONENT.BAR_AXIS,groupAxisKey:_d.COMPONENT.GROUP_AXIS,barOobMaxKey:_d.COMPONENT.BAR_OOB_MAX,barOobMinKey:_d.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(o=e.node.childrenNodes?e.node.childrenNodes:[e.node],rh.extractData(e,t,n)),placement:"bounds",afterShow:()=>{const{app:e,properties:i,customTooltipModel:r}=t;e&&!e.isInModalSelection?.()&&r.useCustomTooltip&&r.embed&&oc.show({app:e,properties:i,selectedNodes:o,customTooltipModel:r,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const sh={extractData:(e,t)=>[ca.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter(e=>e.data&&e.key===t);return n.length?[n[0]]:[]}};function lh(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const o=ra({key:_d.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return ne(!0,o,{scale:_d.SCALE.MAIN.COLOR,settings:{filter:e=>sh.filterNodes(e,_d.COMPONENT.LEGEND_COLOR_CAT),extract:e=>sh.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function uh(e,{fill:t}){return{[_d.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[_d.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const ch=1,dh=3;function mh(e){return e.getLayoutValue("gridLine.auto")}function hh(e){return!mh(e)&&e.getLayoutValue("gridLine.spacing")===ch}function fh(e){return!mh(e)&&e.getLayoutValue("gridLine.spacing")===dh}const ph=e=>({enabled:e.animations.enabled,trackBy:vl.lines.trackBy,compensateForLayoutChanges:vl.lines.compensateForLayoutChanges}),gh=(e,{themeService:t,layoutService:n,dockService:o,viewModel:i})=>{if(!mh(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:r}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:Nm.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!hh(n)||((e,t)=>t%2==0),stroke:r.line.major.color},minorTicks:{show:fh(n),stroke:r.line.minor.color},animations:ph(i)};return a["horizontal"===o.meta.major.orientation?"y":"x"]=_d.SCALE.MAIN.MINOR,a};function yh(e,t){const n=[gh(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:o})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const r=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:_d.SCALE.MAIN.MINOR,line:{stroke:r.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:_d.SCALE.MAIN.MINOR,lines:a,animations:ph(o)}})(t)),n}const vh="areaPan",bh=e=>({type:"Pan",key:"panorama",options:{event:vh,pointers:1,threshold:10,enable(t,n){return this.started===vh||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===_d.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=vh;const n=e.viewState.get("zoom");this[vh]={min:n.min,max:n.max,size:e.chart.component(_d.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:o,max:i,size:r}=this[vh],a=-t.deltaX/r;e.viewState.set("zoom",{min:Math.min(o+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Mh(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:o,chart:i}=e,{rtl:r}=t,a=Pr.event.onZoom({viewCache:n,viewState:o,chart:i},{threshold:100,rtl:r,targetKey:_d.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===_d.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Sh({chart:e},t,n){const o=e.component(_d.COMPONENT.BASE_TOOLTIP);o&&o.show&&(o.emit("hide"),n?.customTooltipModel?.useCustomTooltip&&t&&t({},o,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const i=e.component(_d.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&i.emit("hide");const r=e.component(_d.COMPONENT.TREND_LINES_TOOLTIP);r&&r.show&&r.emit("hide")}function xh(e,t){const{viewCache:n,viewState:o,chart:i,trendLineModel:r,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?Pr.event.onZoom({viewCache:n,viewState:o,chart:i},{rtl:s,threshold:50,targetKey:_d.COMPONENT.BAR}):void 0,u=Od({majorInnerScale:_d.SCALE.MAIN.MAJOR_INNER,tooltip:_d.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:_d.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:o,trendLineModel:r,layoutService:a,rtl:s}),c=[_d.COMPONENT.BAR,_d.COMPONENT.BAR_AXIS,_d.COMPONENT.GROUP_AXIS,_d.COMPONENT.BAR_OOB_MAX,_d.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,m=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,o=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===_d.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),o=!0)}!o&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===_d.COMPONENT.LEGEND_COLOR_CAT),n&&(o=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),o&&t.preventDefault(),Sh(e,m,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),o=this.chart.component(_d.COMPONENT.BASE_TOOLTIP);if(o&&o.show)if(n.some(e=>c.indexOf(e.key)>-1)){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);m(t,o,{nodes:i,opts:e,customTooltipModel:n})}else o.emit("show",t)}else o.emit("hide");const i=this.chart.component(_d.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some(e=>e.key===_d.COMPONENT.LEGEND_COLOR_CAT)?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&Sh(this,m,e)},mouseleave(){Sh(this,m,e)}}}}const Ch=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...hu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[bh(e),Mh(e,t)]]});function qh(e,t){const n=[Ch(e,t),xh(e,t),hu({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&n.push(e.discrete.interactions.native),n}function Th(e,t){const{viewCache:n,viewState:o,chart:i}=e,{rtl:r}=t,a=e.layoutService.meta.isContinuous?Pr.event.onZoom({viewCache:n,viewState:o,chart:i},{rtl:r,threshold:50,targetKey:_d.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,o=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===_d.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(i,Math.sign(-t.deltaY)),o=!0)}!o&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===_d.COMPONENT.LEGEND_COLOR_CAT),n&&(o=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),o&&t.preventDefault()}}}}const wh=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...hu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[bh(e),Mh(e,t)]]});function kh(e,t){const n=e.tooltipService.getInteractions(),o=[wh(e,t,n),Th(e,t),hu({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&o.push(e.discrete.interactions.native),o}const Nh=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:vl.bars.compensateForLayoutChanges});const Lh=(e,t,{collectionKey:n})=>{if(!eu({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:o,viewModel:i},{collectionKey:r}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>o.getDimensionCardinality()>1,data:{collection:r},settings:{box:ne(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:ne(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Nh(i)}}(e,t,{collectionKey:n});const{mode:o,scales:i}=t.reducedDataModel;let r;return o.isGroupedByDimension&&!o.isReduced?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:o.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:o.isReduced||o.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:r},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Nh(t.viewModel)}},{measureText:Dh}=t.renderer("svg")();function Oh(e,t,n){const o=function(e){const t=ne(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:o,align:i,getProp:r}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:o,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=ne(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=ne(!0,{},t,{min:()=>r("continuousMin"),max:()=>r("continuousMax")})),a}(e,t.major,n);return{reducedMinor:o,reducedMajor:i}}const Eh=50,Ah=100,Ih=200;function Ph(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Eh;case 1:return Ah;case 2:return Ih;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function Rh(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function zh(e,t,n){return 0===t||0===e||t===n.length-1}function Bh(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function Fh(e,t,n,o,i){e.domain([t,n]),e.nice(10);const[r,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,o=e.length-t;return e.slice(n,o).some(e=>0===e)}(s),c=u?zh:Rh;s=s.filter(c),l&&!u&&!o&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(_d.FORMATTER.MINOR):void 0;return Bh(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:r,roundedMax:a,ticks:s}}function Hh(e,t,n,o,i,r,a,s){const l=r.formatter(_d.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Dh({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[m,h]=e.domain(),f=e.ticks(o);function p(){const e=f.map(l);return!Bh(e)&&function(e){const t=i/f.length;return Math.max(...e.map(d))<=t}(e)}for(let i=o-1;i>0&&!p();i--)e.domain([t,n]),e.nice(i),[m,h]=e.domain(),f=e.ticks(i);return{roundedMin:m,roundedMax:h,ticks:f}}const jh=(e,t)=>e.value-t.value,_h=e=>({value:e,isMinor:!1}),Vh=e=>({value:e,isMinor:!0});function Uh(e,t,n){const o=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=o}function $h({chart:e,viewCache:t,dockService:n,layoutService:o,themeService:i,viewModel:r,ds:a}){const{isButterfly:s}=o.meta,{explicitMin:l,explicitMax:u,hasExplicitMin:c,hasExplicitMax:d}=t.get("minorMinMax"),{min:h,max:f}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(h),Math.abs(f)):f,g=s?-p:h,y=m(()=>{const s=function(e,t,n){let o;return e?o=n.meta.chart.size:({rect:o}=t.component(_d.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?o.height:o.width}(t.get("isPreRender"),e,n),m=Ph(s,o),h=function(e,t,n){const o=fn().domain([e,t]);return o.nice(n),o}(g,p,m);let f,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:f,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(g,p)):(({roundedMin:f,roundedMax:y,ticks:v}=Hh(h,g,p,m,s,e,n,i)),Uh(v,l,u)&&({roundedMin:f,roundedMax:y,ticks:v}=Fh(h,g,p,c||d,e)));const b=function(e,t){const n=[];for(let o=0;o<e.length-1;o++){const i=e[o],r=(e[o+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+r*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(c,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,u,v);let M=function(e,t){return[...e.map(_h),...t.map(Vh)].sort(jh)}(v,b);if(o.meta.isButterfly){const e=r.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(M=M.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:f,roundedMax:y,ticks:M}},()=>t.get("isPreRender"));return{values:()=>y().ticks,min:()=>c?l:y().roundedMin,max:()=>d?u:y().roundedMax}}function Wh(e,{picasso:t,discrete:n,layoutService:o,dockService:i,viewModel:r,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d,ds:m},{localeInfo:h,rtl:f}){const{meta:p}=o,{fields:g}=r,y=()=>{if("custom"!==o.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},v=!("none"===o.getLayoutValue("measureAxis.show"))?(b=i.meta.minor.orientation,M=i.meta.minor.dock,"vertical"===b?"near"===M||"left"===M?0:1:"near"===M||"bottom"===M?1:0):.5;var b,M;const S={},x="vertical"===i.meta.minor.orientation&&f,C=l.getMain().getScales(),q=l.getMini().getScales();if(Object.assign(S,C,{reducedFill:q.reducedFill}),S[_d.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:o,viewModel:i,layoutService:r,themeService:a,ds:s},{rtl:l}){const u=$h({chart:e,dockService:n,viewCache:o,layoutService:r,themeService:a,viewModel:i,ds:s}),c={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:u.values},minorTicks:{count:1},min:u.min,max:u.max};return r.meta.isStacked||(c.data={source:"qHyperCube",fields:t.minor}),c}({chart:d,viewModel:r,dockService:i,viewCache:a,layoutService:o,themeService:u,ds:m},{rtl:f}),p.isGroupedByDimension)[_d.SCALE.MAIN.MAJOR_INNER,_d.SCALE.MAIN.MAJOR].forEach((e,t)=>{S[e]={invert:x,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...r.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),r.isDimensionLocked(0)||(S[_d.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)S[_d.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:x,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:o,viewCache:i,picasso:r,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=r.formatter("q-time"),d=l.getStyles(),m=e=>Dh({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),o=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),r=u().map(e=>e.qName);return[e,Number.parseFloat(o).toFixed(12),...r].toString()}};return{innerTime:{data:{field:o.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:o.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:o.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:o.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:c,viewModel:r,viewCache:a,themeService:u,layoutService:o},f);S[_d.SCALE.MAIN.MAJOR_INNER]=e,S[_d.SCALE.MAIN.MAJOR]=n}else p.isContinuous?S[_d.SCALE.MAIN.MAJOR]={type:"linear",invert:x,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:S[_d.SCALE.MAIN.MAJOR]={invert:x,data:{extract:p.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:T,reducedMajor:w}=Oh(s,{major:S[_d.SCALE.MAIN.MAJOR],minor:S[_d.SCALE.MAIN.MINOR]},{majorScaleInvert:x,maxPxStep:y,align:v,getProp:a.get});return p.isDiscrete&&(S[_d.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(S[_d.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),S[s.scales.major]=w,S[s.scales.minor]=T,S}function Kh(e,t,n){const{layoutService:o,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[qm(e,t)],components:[]}}({targets:[o.meta.isStackedByDimension&&o.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?_d.COMPONENT.STACK_TOTAL_BAR:_d.COMPONENT.BAR,_d.COMPONENT.BAR_AXIS,_d.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",_d.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const o={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return _d.COMPONENT.BAR===t[0].key?[{...o,data:["selectionDimension"]}]:[_d.COMPONENT.BAR_AXIS,_d.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...o,data:["selectionDimension","axisSelectionDimension"]}]:[o]}},{...e,isLocked:n=>n.some(e=>e.key===_d.COMPONENT.LEGEND_COLOR_CAT)?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function Gh(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},o=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[Cm(n,t)],components:[o]}}({key:"lasso",componentTargetKey:_d.COMPONENT.BAR,components:[t?{key:_d.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:_d.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function Yh(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:o,fillTargets:i,dock:r}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:o},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[wm(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:_d.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",_d.COMPONENT.BAR_AXIS,_d.COMPONENT.BAR],fillTargets:["group-axis",_d.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function Xh(e,t,n){const{selectionService:o}=e,{isUnsupportedFeature:i}=t,r=void 0===n,a=o.getIsSingleSelect(n),s=Kh(e,r,a);if(r||a)return{components:[...s.components],gestures:[...s.interactions]};const l=Gh(e),u=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:km({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",_d.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:_d.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?km({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",_d.COMPONENT.BAR]:["continuous-axis",_d.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?_d.SCALE.MAIN.MAJOR_INNER:_d.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:o}){const i=e.layoutService.meta.isTime?o.formatter():e.chart.formatter(_d.FORMATTER.MINOR),r=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||r?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=Yh(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}const{isNumber:Jh}=Ls;function Zh({layoutService:e,viewModel:t,dockService:n}){const{meta:o}=e;if(!o.isStackedByDimension||o.isContinuous)return!1;const{fields:i}=t,r=e.getLayoutValue("components",null),a=r?r.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>Jh(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>Jh(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>Jh(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>Jh(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:_d.SCALE.MAIN.MAJOR},minor:{scale:_d.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:vl.shadowBars.trackBy,compensateForLayoutChanges:vl.bars.compensateForLayoutChanges}}}const Qh={min:"Min",max:"Max"};function ef(e,t,n){const o=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?jm(e,t)||_m(e,t):n===Vm?jm(e,t):_m(e,t)}(Number(o.toFixed(13)),e,t)}function tf(e,{barComponent:t,type:n,isStacked:o}){const{viewCache:i,layoutService:r,dockService:a}=e,s=i.get("minorMinMax"),l=n===Vm;if(function(e,t){return!e[`hasOther${Qh[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${Qh[t]}`]}(s,n))return!1;if(ef(s,n,l))return!1}if(function(e,t,n){const o=n?e=>e<0:e=>e>0;return e[`hasExplicit${Qh[t]}`]&&o(e[`explicit${Qh[t]}`])}(s,n,l))return!1;let u="end";o&&(u=l?"sumOfPositives":"sumOfNegatives");const c=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(_d.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[u].value>c():e=>e.datum[u].value<c(),m=_d.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),f=h?h.filter(e=>e.key===m)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:ne({},t.settings.box,{fill:r.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:Rm({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:f?.style?.strokeWidth?Pm.BAR.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:Pm.BAR.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??Pm.BAR.STROKE.COLOR})}}}function nf(e,{collectionKey:t},n){const{meta:o}=e.layoutService,{fields:i}=e.viewModel,r=o.isStackedByDimension&&!o.isContinuous?"qValue":"qNum";function a(t,n){const i=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=$r.shouldUseFormat(i),l=o.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>{return"NaN"===e[r]?0:(t=e[r],l&&0!==t?-t:t);var t},label:e=>s?(e=>"NaN"===e[r]?"-":a(e[r]))(e):e.qText}}function s(e){if(!o.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[r]<0}}const l=o.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map((t,r)=>{const u=e.colorService.getMain().getDatumProps(r),c=e.colorService.getMini().getDatumProps(r),d=u[Object.keys(u)[0]],m=d?.field,h=m?{field:m,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,f={field:o.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,r),negative:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:o.isStacked?a(t):void 0,group:o.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:o.isStacked?{field:i.majorStack}:void 0,measureIndex:o.isGroupedByDimension||o.isStackedByDimension?void 0:r,timeStart:o.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:o.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:h,...u,...c,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${r}`},customTooltipAttrExps:0!==o.dimensionCount?cc.getNode(e.layoutService.getLayout(),o):void 0}};var p;return o.isDimensionless&&(f.value=r),void 0!==n&&(f.source=n),$r.deleteUndefinedProperties(f.props),f}),filter:o.isButterfly?e=>!e.negative.value:void 0}};return o.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:of}=Ls;function rf({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:o}=e,{fields:i}=t;if(!o.isStacked)return!1;let r;return r=o.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(o,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>of(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>of(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(o,i),{key:n,data:{extract:r}}}const af="main-collection",sf="stack-total-collection";function lf(e,{collectionKey:t}){const{layoutService:n,colorService:o,reducedDataModel:{fields:i,mode:r}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>{return"NaN"===e[s]?0:(t=e[s],n&&0!==t?-t:t);var t}}}function u(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:i.minor.map((e,t)=>{const n=r.isReduced?{}:o.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:u(e),group:{field:i.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:r.isDimensionless?e:i.major,props:a};return r.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const uf="mini-collection",cf="mini-stack-collection",df="mini-continuous-collection",mf="miniCube",hf=(e,t)=>{const n=(e=>{const t=[nf(e,{collectionKey:af})];return e.layoutService.meta.isStacked&&t.push(rf(e,{collectionKey:sf})),t})(t),o=((e,t)=>{const n=[];return eu({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(nf(t,{collectionKey:df},mf)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:o,mode:i}}=e;return{key:t,data:{extract:o.minor.map((e,t)=>{const r={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(r.timeStart={field:o.major,value:e=>e.qNum},r.timeEnd=r.timeStart),{source:"miniCube",field:o.major,props:r}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:cf})):n.push(lf(t,{collectionKey:uf}))),n})(0,t);return n.concat(o)};function ff(e,t,n,o){const i=[{position:e,onBackground:!0,justify:0,overflow:o}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function pf({layout:e,component:t},n,o){if(!nh(e,n))return!1;const{layoutService:i,chart:r,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!th(e,n),m=l.getStyles(),h=u.label.getStyle(),f=h.useContrastColor;function p(e){const t=r.formatter(_d.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:ff("outside",d,f,c.isContinuous),style:m.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:ff("opposite",d,f,c.isContinuous),style:m.label.value},v=[Zm(ne(n,g)),Zm(ne(n,y))];return{key:"stack-total-labels",type:"labels",renderer:Nl(n.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>eh(e.data.sumOfPositives.value,a.meta.minor.orientation,o),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:vl.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:vl.labels.trackBy,compensateForLayoutChanges:vl.labels.compensateForLayoutChanges}}}function gf(e,t,n){const o=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return o.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}function yf({layout:e,type:t},n){const{layoutService:o,viewCache:i,themeService:r,styleService:a}=n,{meta:s}=o,{isStacked:l}=s;if(!l&&!th(e,n)||l&&!nh(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===Vm&&0===u.max||t===Um&&0===u.min)return!1;if(!Wm(t===Vm?u.implicitMax:u.implicitMin,u,t))return!1;const c=r.getStyles(),d=a.label.getStyle();let m=e=>e.data.end.label;s.isStacked&&(m=t===Vm?function(e){if(Wm(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,o=n.chart.formatter(_d.FORMATTER.MINOR);return o?o(t):t}return""}:function(e){if(Wm(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,o=n.chart.formatter(_d.FORMATTER.MINOR);return o?o(t):t}return""});const h={label:m,simplifiedPlacements:gf("outside",0,s.isContinuous),styles:c},f={label:m,simplifiedPlacements:gf("opposite",0,s.isContinuous),styles:c},p=[Zm(ne(n,h)),Zm(ne(n,f))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${_d.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:p,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:vl.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:Nl(n.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:vl.labels.trackBy,compensateForLayoutChanges:vl.labels.compensateForLayoutChanges}}}function vf(e){return"all"===e||"title"===e}function bf(e,t,n){if(!vf(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const o=t.alternativeService.getAlternatives(),{actions:i}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:Nm[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:o.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Mf(e,t,n){if(!vf(e.measureAxis.show))return!1;const o=t.alternativeService.getAlternatives(),{actions:i}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:o.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"measure"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Sf({environment:e,rtl:t,refLineModel:n,layoutService:o,colorService:i,dockService:r,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},m=a.getStyles(),h=s.animations.enabled;return[Cl({refLineModel:n,layoutService:o,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:_d.SCALE.MAIN.MINOR,axis:"horizontal"===r.meta.major.orientation?"y":"x",key:_d.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:Nm.refLines.minimumLayoutMode}),Cl({isDimension:!0,refLineModel:n,layoutService:o,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:_d.SCALE.MAIN.MAJOR,axis:"horizontal"===r.meta.major.orientation?"x":"y",rtl:t,key:_d.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:_d.COMPONENT.BAR,minimumLayoutMode:Nm.refLines.minimumLayoutMode}),...ql({refLineModel:n,layoutService:o,colorModel:d,animationsEnabled:h,dock:r.meta.minor.opposite,scale:_d.SCALE.MAIN.MINOR,style:m,formatter:_d.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:_d.COMPONENT.MEASURE_REF_LINE_LABEL}),...ql({isDimension:!0,refLineModel:n,layoutService:o,colorModel:d,animationsEnabled:h,dock:r.meta.major.opposite,scale:_d.SCALE.MAIN.MAJOR,style:m,theme:u,localeInfo:c,rtl:t,key:_d.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function xf({dockService:e,layoutService:t,discrete:n,continuousDataModel:o,viewModel:i,flags:r}){if(!r?.isEnabled("VIZ_199_ADD_SPACE_BETWEEN"))return!1;if(!!eu({layoutService:t}).none)return!1;const{rtl:a}=e.config,s="horizontal"===e.meta.chart.orientation,l=!s,{dock:u}=e.meta.major,{show:c}=t.getLayoutValue("dimensionAxis",{}),d="none"!==c;if(l&&d&&"bottom"===u)return!1;if(s&&d){if(!a&&"right"===u)return!1;if(a&&"left"===u)return!1}const m=a?"left":"right";return{type:"space",key:_d.COMPONENT.SPACE,layout:{dock:l?"bottom":m,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?o.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:i.animations.enabled,trackBy:()=>Math.random()}}}function Cf({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,context:s,resources:l,viewCache:u}){const c=[],d=r.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return c;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=$r.generateId)})}(d);const m=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((u,d)=>{const h=`points-addon-${d}`,f=`lines-addon-${d}`;switch(u[0]?.type){case"point":c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:_d.SCALE.MAIN.MAJOR,minorScale:_d.SCALE.MAIN.MINOR,mainComponentKey:_d.COMPONENT.BAR,data:u,key:h})),m.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":c.push(function({chart:e,chartModel:t,discreteModel:n,colorService:o,layoutService:i,dockService:r,rtl:a,majorScale:s,minorScale:l,mainComponentKey:u,data:c,key:d,scales:m={}}){if(!Array.isArray(c)||0===c.length)return!1;const h={resolveUIColor:o.getMain().getPaletteColor},f="horizontal"===r.meta.major.orientation,p=!(!f||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=Gs.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),M=[];c.forEach((e,t)=>{const n=(e?.points??[]).map((n,o)=>({...n,lineId:t,style:0===o?e.style:void 0}));M.push(...n)});const S={},x=[];c.forEach(e=>x.push(...(e?.points??[]).map(e=>e.dimensionValue))),x.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const C=M[0];M.forEach(t=>{const n=Ol({point:t,dimensionValueInfo:S,layoutService:i}),o=t?.scale,r=C?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let u=n;const c=r&&o&&r!==o,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(c)u=function(e,t,n){const o=t.min(),i=t.max(),r=n.min(),a=n.max();return i===o?r:r+(e-o)/(i-o)*(a-r)}(n,m[o]||e.scale(o),m[r]||e.scale(r));else if(d)u=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);u=e.reduce((e,n)=>{const o=n.qNum;return"number"==typeof o&&Math.sign(o)===t?e+o:e},0)}}t.validMeasureValue=u});const q={scale:s,fn:({datum:t})=>{const n=e.scale(s),o=t.value.dimensionValue;return y?n("string"==typeof o?""===o?void 0:+o:o):void 0!==S[o]?Gs.getScaledPosition({scale:n,value:S[o].id,valueInfo:S[o],size:e.component(u)?.rect[f?"width":"height"],align:"center",invert:p,layoutService:i,isContinuous:y}):void 0}},T={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:M,settings:{connect:!0,coordinates:{major:f?q:T,minor:f?T:q,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"linear",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??2,stroke:({datum:e})=>Dl({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:vl.nonUpdatingNode.trackBy,compensateForLayoutChanges:vl.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:o,layoutService:r,dockService:a,rtl:s.rtl,majorScale:_d.SCALE.MAIN.MAJOR,minorScale:_d.SCALE.MAIN.MINOR,mainComponentKey:_d.COMPONENT.BAR,data:u,key:f})),u.forEach((u,d)=>{if(u?.showPoints&&u?.points){const h=`points-${d}-for-${f}`;c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:o,themeService:i,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:_d.SCALE.MAIN.MAJOR,minorScale:_d.SCALE.MAIN.MINOR,mainComponentKey:_d.COMPONENT.BAR,data:u.points,key:h})),m.push({key:h,lines:!0,labels:!0,duplicates:!0})}else u?.points&&m.push({key:f,lines:!0,labels:!1,duplicates:!0,points:u.points})})}}),c.push(function({layoutService:e,dockService:t,chartModel:n,themeService:o,configs:i,flags:r,cache:a}){const s=e.getLayoutValue("plugins"),{rtl:l}=t.config,{orientation:u}=t.meta.major,{isOneDimensional:c,isStacked:d}=e.meta,m=o.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:Nl(r),settings:{all:!0,cache:a,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:d?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<s.length;t++){const n=s[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:u,pointValue:e=>e.value?.validMeasureValue,rtl:l},style:m.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:vl.nonUpdatingNode.trackBy,compensateForLayoutChanges:vl.labels.compensateForLayoutChanges}}}({layoutService:r,dockService:a,chartModel:t,themeService:i,configs:m,flags:l.flags,cache:u})),c}const qf=(e,t,n)=>{const{layoutService:o,dockService:i,colorService:r,chart:a,actions:s,discrete:l,continuousDataModel:u,reducedDataModel:c,viewModel:d,viewState:m,viewCache:h,themeService:f,refLineModel:p,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:M,disclaimerService:S}=t,{localeInfo:x}=n,C=function(e,t){const{disclaimerService:n,themeService:o,translator:i}=e,r=n.getDisclaimer();if(!r)return!1;const{fontFamily:a}=o.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:r.alignment},settings:{isRTL:t,label:i.get(`Object.Disclaimer.${r.key}`)},style:{fontFamily:a}}}(t,v);if(S.getHasSuppressingDisclaimer())return{components:[C]};const q=Wh(e,t,{localeInfo:x,rtl:v}),T=!s?.interact?.enabled(),w=r.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:T}),k=w.components[0];if(k){const{dock:e}=k.layout;if(q.fillRange&&(["right","left"].includes(e)||v)&&(q.fillRange.invert=!0),"legend-seq"===k.type&&void 0!==d.selectionDimensionIdx&&q.fillRange&&q.fillRange.min<q.fillRange.max){const e=km({eventName:"legendRange",key:"legendRangeBrush",targets:[k.key],fillTargets:[k.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:k.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);w.components.push(...e.components),w.interactions.unshift(...e.interactions)}}else q.fillRange&&v&&(q.fillRange.invert=!0);const N=((e,{componentKey:t,collectionKey:n})=>{const{meta:o}=e.layoutService,i=e.colorService.getMain().getPaletteColor;let r,a;o.isGroupedByDimension?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:o.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let s=2;o.isContinuous?(a={start:"timeStart",end:"timeEnd"},s=Bm(e,t)):o.isStacked&&(a="stack");const l=o.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,u=e=>!0===e.datum.null?.value,c=e.layoutService.getLayoutValue("components",null),d=c?c.filter(e=>e.key===t)[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:o.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:o.isContinuous||l?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:_d.SCALE.MAIN.MAJOR,fn:r,ref:a},minor:{scale:_d.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:Rm({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:s,fill:e.colorService.getMain().getColor(),opacity:e=>u(e)?0:void 0,minHeightPx:function(e){return o.isStacked?.1:u(e)?.01:.3},strokeWidth:d?.style?.strokeWidth?Pm.BAR.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:Pm.BAR.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color?i(d?.style?.strokeColor):Pm.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:vl.bars.trackBy,compensateForLayoutChanges:vl.bars.compensateForLayoutChanges}}})(t,{componentKey:_d.COMPONENT.BAR,collectionKey:_d.COLLECTION.MAIN}),L=((e,{componentKey:t,collectionKey:n})=>{const{meta:o}=e.layoutService;if(!o.isStacked)return!1;let i=2;o.isContinuous&&(i=Bm(e,t));const r={key:t,type:"box",data:{collection:n},settings:{major:{scale:_d.SCALE.MAIN.MAJOR},minor:{scale:_d.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:Rm({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return o.isContinuous&&(r.settings.major.ref={start:"timeStart",end:"timeEnd"}),r})(t,{componentKey:_d.COMPONENT.STACK_TOTAL_BAR,collectionKey:_d.COLLECTION.STACK_TOTAL}),D=Xh(t,n,d.selectionDimensionIdx),{isStacked:O}=o.meta;let E;E=c.mode.isContinuous?_d.COLLECTION.MINI_CONTINUOUS:O?_d.COLLECTION.MINI_STACK:_d.COLLECTION.MINI;const A=O?L:N,I=yh(0,t),P=t.flags.isEnabled("VIZ_266_BARCHART_REFACTOR_TOOLTIP"),R=[...I,tf(t,{barComponent:A,type:"max",isStacked:O}),tf(t,{barComponent:A,type:"min",isStacked:O}),Gm(t,{barComponent:A,type:"max",isStacked:O}),Gm(t,{barComponent:A,type:"min",isStacked:O}),Xm(t,{chart:a,type:"max",collectionKey:O?_d.COLLECTION.STACK_TOTAL:_d.COLLECTION.MAIN}),Xm(t,{chart:a,type:"min",collectionKey:O?_d.COLLECTION.STACK_TOTAL:_d.COLLECTION.MAIN}),...Im(e,t,v,!!I[0]),N,L,Zh({layoutService:o,viewModel:d,dockService:i}),bf(e,t,v),Mf(e,t,v),...Sf({environment:n,rtl:v,refLineModel:p,layoutService:o,colorService:r,dockService:i,themeService:f,viewModel:d,chart:a}),hs({viewState:m,viewCache:h,layoutService:o,dockService:i,rtl:v}),xf({dockService:i,layoutService:o,discrete:l,continuousDataModel:u,viewModel:d,flags:t.flags}),Lh(N,t,{collectionKey:E}),tu({layoutService:o,dockService:i,discrete:l,continuousDataModel:u,viewState:m,viewCache:h,themeService:f,rtl:v,deviceType:n.deviceType}),...Td({majorScale:_d.SCALE.MAIN.MAJOR,minorScale:_d.SCALE.MAIN.MINOR,tooltipOverlay:_d.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:o,trendLineModel:M,dockService:i,animationsEnabled:d.animations.enabled}),...w.components,ih({layout:e,component:_d.COMPONENT.BAR,minorScale:q.minor},t,v),pf({layout:e,component:_d.COMPONENT.STACK_TOTAL_BAR},t,v),yf({layout:e,type:"max"},t),yf({layout:e,type:"min"},t),...D.components,!P&&ah(0,{...t,coloring:r.getMain().getSettings()},v),!P&&lh(0,{...t,coloring:r.getMain().getSettings()},v),...P?y.getComponents():[!1],!1!==e.showDisclaimer&&C,Ld({tooltip:_d.COMPONENT.TREND_LINES_TOOLTIP,formatter:_d.FORMATTER.MINOR},t,{rtl:v}),...t.flags.isEnabled("TLV_1274_PLUGINS_BAR_CHART")?Cf({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:r,themeService:f,layoutService:o,dockService:i,context:{},resources:t,viewCache:h}):[]].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(R);const z=[...w.interactions,...D.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0));return{interactions:P?kh(t,{rtl:v,hammer:{gestures:z}}):qh(t,{rtl:v,hammer:{gestures:z}}),scales:q,palettes:r.getMain().getPalettes(),components:g.extendComponents(R),strategy:Fr(0,{logicalSize:b,minCenterRatio:0}),formatters:uh(t,q),collections:hf(0,t)}};const Tf=({environment:e,services:t,chart:n,viewState:o,bootstrapped:i})=>{$(r=>{if(!e||!t||!i)return;const{layoutService:a,dockService:s,colorService:l,discrete:u,continuousDataModel:c,reducedDataModel:d}=t,{width:m,height:h}=s.meta.chart.size;if(r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:m,h:h}},a.meta.isSnapshot)return Promise.resolve();r.snapshotData.content.chartData={scrollOffset:o.get("scrollOffset"),zoom:o.get("zoom"),legendScrollOffset:Xr(n,_d.COMPONENT.LEGEND_COLOR_CAT)};const{properties:f}=i,p=f?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return p&&(r.tooltip.auto=!0),a.meta.isDiscrete?(u.command.setSnapshotData(r),d.setSnapshotData(r)):c.setSnapshotData(r),l.getMain().getSnapshotData().then(e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}}).catch(()=>{})}),W(()=>({getViewState(){if(o&&n)return{scrollOffset:o.get("scrollOffset"),zoom:o.get("zoom"),legendScrollOffset:Xr(n,_d.COMPONENT.LEGEND_COLOR_CAT)}}}),[o,n])},wf=e=>"[object Object]"===Object.prototype.toString.call(e),kf=e=>Array.isArray(e);function Nf(e,t){if(e===t)return!0;if(kf(e)){if(!kf(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Nf(e[n],t[n]))return!1;return!0}if(wf(e)){if(!wf(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++){if(!Object.hasOwn(t,n[o]))return!1;if(!Nf(e[n[o]],t[n[o]]))return!1}return!0}return e===t}const Lf=({properties:e,layout:t,isStacked:n,isContinuous:o,model:i,layoutService:r})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=ne(!0,{},e);return((e,t,n)=>{const{color:{mode:o}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===o&&t.length>1?n.color.mode="byMultiple":"byExpression"===o&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==o&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!o&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),i.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:o}=e.color||{};if("byExpression"===o){const o=t.getLayout();if("colorByExpression"===o.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:r}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:o,target:i}=n.reduce((e,n,o)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=o),void 0!==e.target||t.includes(o)||(e.target=o),e),{current:void 0,target:void 0});return{current:o,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[r].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:r}),!bs.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};function Df(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==bc).length,o=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==bc).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(o+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(o+n))))}}const Of=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Ef=(e,t,n)=>{const o=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:o,options:()=>t.getOptions(o),defaultValue:()=>t.getDefaultValue(o)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function Af(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(Of).map(e=>Of[e]),schemaIgnore:!0,defaultValue:Of[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!Yr.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==bc).length,o=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==bc).length,i="grouped"===e.barGrouping?.grouping&&o>0&&n+o>2;return Yr.continuous(t)?1:i?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(Xl.OPTIONS).map(e=>Xl.OPTIONS[e]),schemaIgnore:!0,defaultValue:Xl.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function If(e,t,n,o=!1){return o?Af(t):function(e,t,n){const o=x({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(Of).map(e=>Of[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!Yr.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:o}=n,{barGrouping:i,qHyperCubeDef:r}=o,a=r.qMeasures.length,s=r.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return Yr.continuous(o)?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Ef("axis.title",o,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:Ef("axis.label.name",o,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Ef("label.value",o,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:Ef("legend.title",o,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:Ef("legend.label",o,e)}}}:void 0}}}(e,t,n)}const Pf=e=>e.qError?.qErrorCode!==bc,Rf=(e,t)=>e?.qHyperCube[t].filter(e=>Pf(e)),zf=e=>{if(!e)return!1;const t=ne(!0,{},e);return t.qHyperCube.qMeasureInfo=Rf(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=Rf(e,"qDimensionInfo"),t&&!Yr.continuous(t)&&Yr.stacked(t)},Bf=({translator:e,flags:t,anything:n})=>{const o=n?.sense?.isUnsupportedFeature?.("continuousData"),i={items:{labels:{items:{header:{show:(e,t,n)=>Rf(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!zf(t.layout)&&Rf(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>zf(t.layout),convertFunctions:{get:(e,t,n,o)=>o.dataPoint.showLabels&&o.dataPoint.showSegmentLabels,set(e,t,n,o,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>zf(t.layout),convertFunctions:{get:(e,t,n,o)=>o.dataPoint.showLabels&&o.dataPoint.showTotalLabels,set(e,t,n,o,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>Rf(n.layout,"qDimensionInfo").length&&Rf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,o)=>"labels"===o.dimensionAxis.show||"none"===o.dimensionAxis.show,set(e,t,n,o,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>Rf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,o)=>"labels"===o.measureAxis.show||"none"===o.measureAxis.show,set(e,t,n,o,i){i.measureAxis.show=e?"labels":"all"}}}}}}},r=n?.sense?.theme,a={uses:"settings",items:{simpleStyling:If(r,t,e,!0),simpleLabels:i,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:If(r,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{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"}];return Vd({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=Rf(t.layout,"qMeasureInfo").length,o=Rf(t.layout,"qDimensionInfo").length;return o>0&&n+o>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||Vd({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||Vd({layout:n.layout})||(e.barGrouping.grouping="stacked"),Rf(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>Yr.continuous(n.layout),convertFunctions:{get(e,t,n){const o="stacked";return"butterfly"===e(t.type)?Vd({layout:n.layout})?e(t.type):o:Yr.continuous(n.layout)?o:e(t.type)},set(e,t,n){const o=Qr(n.type,n);t(n.type,e,o)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>Yr.continuous(n.layout),convertFunctions:(s="vertical",{get:(e,t,n)=>Yr.continuous(n.layout)?s:e(t.type),set(e,t,n){const o=Qr(n.type,n);t(n.type,e,o)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(Xl.OPTIONS).map(e=>Xl.OPTIONS[e]),defaultValue:Xl.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!Yr.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(zf(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&zf(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&zf(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:Ll}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!Yr.continuous(n.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const o=Rf(n.layout,"qMeasureInfo").length,i=Rf(n.layout,"qDimensionInfo").length,r=e.dimensionAxis.maxVisibleItems;return r<0||r>1e4/(i+o)},globalChange:Df,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!o}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var s;return t?.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(a.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"}]}}}),a.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},a},Ff={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){us(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:o,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:r}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&o.length>=1&&r>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Hf=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:t?.isEnabled("CLIENT_TLV_694_PLUGINS_UI")&&t?.isEnabled("TLV_1274_PLUGINS_BAR_CHART")?$l({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}]}):void 0}}),jf=({translator:e,flags:t,anything:n})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,o){if(n?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const i=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>Pf(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,t),r=Yr.continuous(o.layout);return!(i&&r)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:n?.sense?.isUnsupportedFeature?.("trendlines")?void 0:Id({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}});function _f({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:jf({translator:e,flags:t,anything:n}),sorting:Ff,addons:Hf({translator:e,flags:t}),settings:Bf({translator:e,flags:t,anything:n})}}}const Vf=e=>e.qError?.qErrorCode!==bc;function Uf({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const o=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter(e=>Vf(e)).length;return 1===o&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{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"}];return Vd({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){return t.qHyperCube.qMeasureInfo.filter(e=>Vf(e)).length+t.qHyperCube.qDimensionInfo.filter(e=>Vf(e)).length>2&&!Yr.continuous(t)&&(n=t,!(n?.qHyperCube?.qDimensionInfo?.filter(e=>Vf(e)).length>1&&n?.qHyperCube?.isHCEnabled));var n},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!Yr.continuous(t)}}},color:{uses:"color"}}}}function $f(e){const t={},n=a(e,"components"),o=a(e,"dimensionAxis.axisDisplayMode"),i=a(e,"dimensionAxis.maxVisibleItems"),r=n?n.filter(e=>"bar"===e.key)[0]:void 0,s=a(e,"tooltip");if(r&&r.style&&Object.keys(r.style).forEach(e=>{t[`chart_style_${e}`]=r.style[e]}),i&&(t.chart_dimaxis_maxVisibleItems=i),o&&(t.chart_dimaxis_axisDisplayMode=o),s){t.chart_tooltip_custom=!s.auto;const e=a(s,"chart.object.refId");!s.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const Wf=e=>!!(e&&e.qHyperCube.qSize.qcy>0),Kf={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function Gf(){const e=[];return Object.keys(Kf).forEach(t=>{e.push(Kf[t])}),e}function Yf(e){return{definition:_f(e),softDefinition:Uf(e),support:{snapshot:Wf,export:Wf,exportData:!0,sharing:Wf,viewData:!0,effects:!0,modifiers:Gf()},importProperties:(t,n,o,i)=>{const r={layout:{templateId:n.templateId}};o.mapProperties(r);const a={defaultDimension:o.getDefaultDimensionProperties(),defaultMeasure:o.getDefaultMeasureProperties()},s=G.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Nc(e),defaultPropertyValues:a,hypercubePath:i,extension:o}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),G.conditionalShow.unquarantine(l),G.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{G.conditionalShow.quarantine(e.qProperty),G.conditionalShow.quarantineAlternative(e.qProperty);return G.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(us),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(us)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:o,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:r}=n;(r||!r&&o)&&(e.scrollbar=Xl.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:$f}}}}});