@nebula.js/sn-pivot-table 7.17.0 → 7.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-pivot-table v7.17.0
2
+ * @nebula.js/sn-pivot-table v7.18.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -99,4 +99,4 @@ function kr(e,t){let n;return n=t?br(e).withConfig({displayName:t.label,shouldFo
99
99
  * LICENSE file in the root directory of this source tree.
100
100
  */var hS,mS,gS={},vS={};function yS(){if(hS)return vS;hS=1;var e=Ha;Object.defineProperty(vS,"__esModule",{value:!0}),vS.default=void 0;var t=(0,e(cv()).default)();return vS.default=t,vS}var bS,xS,SS={},wS={};function CS(){if(xS)return SS;xS=1;var e=Ha;Object.defineProperty(SS,"__esModule",{value:!0}),SS.default=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.breakpoints,a=void 0===o?["sm","md","lg"]:o,s=i.disableAlign,l=void 0!==s&&s,u=i.factor,c=void 0===u?2:u,d=i.variants,p=void 0===d?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:d,f=(0,t.default)({},e);f.typography=(0,t.default)({},f.typography);var h=f.typography,m=(0,r.convertLength)(h.htmlFontSize),g=a.map(function(e){return f.breakpoints.values[e]});return p.forEach(function(e){var i=h[e],o=parseFloat(m(i.fontSize,"rem"));if(!(o<=1)){var a=o,s=1+(a-1)/c,u=i.lineHeight;if(!(0,r.isUnitless)(u)&&!l)throw new Error((0,n.formatMuiErrorMessage)(6));(0,r.isUnitless)(u)||(u=parseFloat(m(u,"rem"))/parseFloat(o));var d=null;l||(d=function(e){return(0,r.alignProperty)({size:e,grid:(0,r.fontGrid)({pixels:4,lineHeight:u,htmlFontSize:h.htmlFontSize})})}),h[e]=(0,t.default)({},i,(0,r.responsiveProperty)({cssProperty:"fontSize",min:s,max:a,unit:"rem",breakpoints:g,transform:d}))}}),f};var t=e(Ns()),n=Sh,r=function(){if(bS)return wS;bS=1;var e=Ha;Object.defineProperty(wS,"__esModule",{value:!0}),wS.isUnitless=function(e){return String(parseFloat(e)).length===String(e).length},wS.getUnit=n,wS.toUnitless=r,wS.convertLength=function(e){return function(t,i){var o=n(t);if(o===i)return t;var a=r(t);if("px"!==o)if("em"===o)a=r(t)*r(e);else if("rem"===o)return a=r(t)*r(e),t;var s=a;if("px"!==i)if("em"===i)s=a/r(e);else{if("rem"!==i)return t;s=a/r(e)}return parseFloat(s.toFixed(5))+i}},wS.alignProperty=function(e){var t=e.size,n=e.grid,r=t-t%n,i=r+n;return t-r<i-t?r:i},wS.fontGrid=function(e){var t=e.lineHeight;return e.pixels/(t*e.htmlFontSize)},wS.responsiveProperty=function(e){var n=e.cssProperty,r=e.min,i=e.max,o=e.unit,a=void 0===o?"rem":o,s=e.breakpoints,l=void 0===s?[600,960,1280]:s,u=e.transform,c=void 0===u?null:u,d=(0,t.default)({},n,"".concat(r).concat(a)),p=(i-r)/l[l.length-1];return l.forEach(function(e){var i=r+p*e;null!==c&&(i=c(i)),d["@media (min-width:".concat(e,"px)")]=(0,t.default)({},n,"".concat(Math.round(1e4*i)/1e4).concat(a))}),d};var t=e(Wh());function n(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function r(e){return parseFloat(e)}return wS}();return SS}var ES,IS={};var DS,PS={};var RS,MS={};var LS,AS={};!function(e){var t=Ha,r=Lf;Object.defineProperty(e,"__esModule",{value:!0});var i={createTheme:!0,createMuiTheme:!0,unstable_createMuiStrictModeTheme:!0,createStyles:!0,makeStyles:!0,responsiveFontSizes:!0,styled:!0,useTheme:!0,withStyles:!0,withTheme:!0,createGenerateClassName:!0,jssPreset:!0,ServerStyleSheets:!0,StylesProvider:!0,MuiThemeProvider:!0,ThemeProvider:!0};Object.defineProperty(e,"createTheme",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"createMuiTheme",{enumerable:!0,get:function(){return a.createMuiTheme}}),Object.defineProperty(e,"unstable_createMuiStrictModeTheme",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"createStyles",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"makeStyles",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"responsiveFontSizes",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"withStyles",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"withTheme",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"createGenerateClassName",{enumerable:!0,get:function(){return g.createGenerateClassName}}),Object.defineProperty(e,"jssPreset",{enumerable:!0,get:function(){return g.jssPreset}}),Object.defineProperty(e,"ServerStyleSheets",{enumerable:!0,get:function(){return g.ServerStyleSheets}}),Object.defineProperty(e,"StylesProvider",{enumerable:!0,get:function(){return g.StylesProvider}}),Object.defineProperty(e,"MuiThemeProvider",{enumerable:!0,get:function(){return g.ThemeProvider}}),Object.defineProperty(e,"ThemeProvider",{enumerable:!0,get:function(){return g.ThemeProvider}});var o=Af;Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))});var a=r(cv()),s=t(function(){if(dv)return pv;dv=1;var e=Ha;Object.defineProperty(pv,"__esModule",{value:!0}),pv.default=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n.default.apply(void 0,[(0,t.deepmerge)({unstable_strictMode:!0},e)].concat(i))};var t=Sh,n=e(cv());return pv}()),l=t(function(){if(cS)return fv;cS=1,Object.defineProperty(fv,"__esModule",{value:!0}),fv.default=function(t){return(0,e.createStyles)(t)};var e=fS;return fv}()),u=t(function(){if(mS)return gS;mS=1;var e=Ha;Object.defineProperty(gS,"__esModule",{value:!0}),gS.default=void 0;var t=e(Ns()),n=fS,r=e(yS()),i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.makeStyles)(e,(0,t.default)({defaultTheme:r.default},i))};return gS.default=i,gS}()),c=t(CS()),d=t(function(){if(ES)return IS;ES=1;var e=Ha;Object.defineProperty(IS,"__esModule",{value:!0}),IS.default=void 0;var t=e(Ns()),n=fS,r=e(yS()),i=function(e){var i=(0,n.styled)(e);return function(e,n){return i(e,(0,t.default)({defaultTheme:r.default},n))}};return IS.default=i,IS}()),p=av();Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}}))});var f=t(function(){if(DS)return PS;DS=1;var e=Ha;Object.defineProperty(PS,"__esModule",{value:!0}),PS.default=function(){return(0,t.useTheme)()||r.default};var t=fS;e(n);var r=e(yS());return PS}()),h=t(function(){if(RS)return MS;RS=1;var e=Ha;Object.defineProperty(MS,"__esModule",{value:!0}),MS.default=void 0;var t=e(Ns()),n=fS,r=e(yS()),i=function(e,i){return(0,n.withStyles)(e,(0,t.default)({defaultTheme:r.default},i))};return MS.default=i,MS}()),m=t(function(){if(LS)return AS;LS=1;var e=Ha;Object.defineProperty(AS,"__esModule",{value:!0}),AS.default=void 0;var t=fS,n=e(yS()),r=(0,t.withThemeCreator)({defaultTheme:n.default});return AS.default=r,AS}()),g=fS}(Df),Df.alpha(tf.GREYSCALE_0,.05),Df.alpha(tf.GREEN_PALE,.5),Df.alpha(tf.BLUE_PALE,.5),Df.alpha(tf.GREEN_PALE,.5),Df.alpha(tf.BLUE_PALE,.5),Df.alpha(tf.GREEN_PALE,.5),Df.alpha(tf.BLUE_PALE,.5),Df.alpha(tf.GREEN_PALE,.5),Df.alpha(tf.BLUE_PALE,.5),Df.alpha(tf.GREEN_PALE,.5),Df.alpha(tf.BLUE_PALE,.5);const kS=(e="light")=>Ef();function OS(e){return"init"in e}function qS(e){return!!e.write}function TS(e){return"v"in e||"e"in e}function NS(e){if("e"in e)throw e.e;if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function _S(e){return"function"==typeof(null==e?void 0:e.then)}function jS(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function FS(e,t,n){var r;const i=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])i.add(t);for(const e of t.p)i.add(e);return i}const zS=()=>{const e={},t=new WeakMap,n=n=>{var r,i;null==(r=t.get(e))||r.forEach(e=>e(n)),null==(i=t.get(n))||i.forEach(e=>e())};return n.add=(n,r)=>{const i=n||e;let o=t.get(i);return o||(o=new Set,t.set(i,o)),o.add(r),()=>{o.delete(r),o.size||t.delete(i)}},n};function WS(e){return e.i||(e.i=zS()),e.r||(e.r=zS()),e.c||(e.c=zS()),e.m||(e.m=zS()),e.u||(e.u=zS()),e.f||(e.f=(()=>{const e=new Set,t=()=>e.forEach(e=>e());return t.add=t=>(e.add(t),()=>e.delete(t)),t})()),e}const $S=(e,t,...n)=>t.read(...n),VS=(e,t,...n)=>t.write(...n),HS=(e,t)=>{var n;return null==(n=t.INTERNAL_onInit)?void 0:n.call(t,e)},BS=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},GS=(e,n)=>{var r;const i=uw(e),o=i[0],a=i[6],s=i[9];if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!n)throw new Error("Atom is undefined or null");let l=o.get(n);return l||(l={d:new Map,p:new Set,n:0},o.set(n,l),null==(r=a.i)||r.call(a,n),null==s||s(e,n)),l},US=e=>{const t=uw(e),n=t[1],r=t[3],i=t[4],o=t[5],a=t[6],s=t[13],l=[],u=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&u(a.f);const t=new Set,l=t.add.bind(t);r.forEach(e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(l)}),r.clear(),o.forEach(l),o.clear(),i.forEach(l),i.clear(),t.forEach(u),r.size&&s(e)}while(r.size||o.size||i.size);if(l.length)throw new AggregateError(l)},YS=e=>{const n=uw(e),r=n[1],i=n[2],o=n[3],a=n[11],s=n[14],l=n[17],u=[],c=new WeakSet,d=new WeakSet,p=Array.from(o);for(;p.length;){const n=p[p.length-1],o=a(e,n);if(d.has(n))p.pop();else if(c.has(n)){if(i.get(n)===o.n)u.push([n,o]);else if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&i.has(n))throw new Error("[Bug] invalidated atom exists");d.add(n),p.pop()}else{c.add(n);for(const e of FS(n,o,r))c.has(e)||p.push(e)}}for(let t=u.length-1;t>=0;--t){const[n,r]=u[t];let a=!1;for(const e of r.d.keys())if(e!==n&&o.has(e)){a=!0;break}a&&(i.set(n,r.n),s(e,n),l(e,n)),i.delete(n)}},KS=new WeakSet,XS=(e,n)=>{var r,i;const o=uw(e),a=o[1],s=o[2],l=o[3],u=o[6],c=o[7],d=o[11],p=o[12],f=o[13],h=o[14],m=o[16],g=o[17],v=o[20],y=o[26],b=o[28],x=d(e,n),S=b[0];if(TS(x)){if(a.has(n)&&s.get(n)!==x.n||x.m===S)return x.m=S,x;let t=!1;for(const[n,r]of x.d)if(h(e,n).n!==r){t=!0;break}if(!t)return x.m=S,x}let w=!0;const C=new Set(x.d.keys()),E=new Map,I=()=>{for(const e of C)E.has(e)||x.d.delete(e)},D=()=>{if(a.has(n)){const t=!l.size;g(e,n),t&&(f(e),p(e))}},P=t=>{var r;if(t===n){const n=d(e,t);if(!TS(n)){if(!OS(t))throw new Error("no atom init");v(e,t,t.init)}return NS(n)}const i=h(e,t);try{return NS(i)}finally{E.set(t,i.n),x.d.set(t,i.n),_S(x.v)&&jS(n,x.v,i),a.has(n)&&(null==(r=a.get(t))||r.t.add(n)),w||D()}};let R,M;const L={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),"production"===(t.meta.env?t.meta.env.MODE:void 0)||qS(n)||console.warn("setSelf function cannot be used with read-only atom"),!M&&qS(n)&&(M=(...r)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&w&&console.warn("setSelf function cannot be called in sync"),!w)try{return m(e,n,...r)}finally{f(e),p(e)}}),M}},A=x.n,k=s.get(n)===A;try{"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&KS.delete(e);const i=c(e,n,P,L);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&KS.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,n,i),_S(i)){y(e,i,()=>null==R?void 0:R.abort());const t=()=>{I(),D()};i.then(t,t)}else I();return null==(r=u.r)||r.call(u,n),x.m=S,x}catch(e){return delete x.v,x.e=e,++x.n,x.m=S,x}finally{w=!1,x.n!==A&&k&&(s.set(n,x.n),l.add(n),null==(i=u.c)||i.call(u,n))}},JS=(e,t)=>{const n=uw(e),r=n[1],i=n[2],o=n[11],a=[t];for(;a.length;){const t=a.pop(),n=o(e,t);for(const s of FS(t,n,r)){const t=o(e,s);i.get(s)!==t.n&&(i.set(s,t.n),a.push(s))}}},ZS=(e,n,...r)=>{const i=uw(e),o=i[3],a=i[6],s=i[8],l=i[11],u=i[12],c=i[13],d=i[14],p=i[15],f=i[16],h=i[17],m=i[20],g=i[28];let v=!0;const y=t=>NS(d(e,t)),b=(r,...i)=>{var s;const d=l(e,r);try{if(r===n){if(!OS(r))throw new Error("atom not writable");"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&KS.add(e);const n=d.n,l=i[0];return m(e,r,l),h(e,r),void(n!==d.n&&(++g[0],o.add(r),p(e,r),null==(s=a.c)||s.call(a,r)))}return f(e,r,...i)}finally{v||(c(e),u(e))}};try{return s(e,n,y,b,...r)}finally{v=!1}},QS=(e,t)=>{var n;const r=uw(e),i=r[1],o=r[3],a=r[6],s=r[11],l=r[15],u=r[18],c=r[19],d=s(e,t),p=i.get(t);if(p){for(const[r,i]of d.d)if(!p.d.has(r)){const c=s(e,r);u(e,r).t.add(t),p.d.add(r),i!==c.n&&(o.add(r),l(e,r),null==(n=a.c)||n.call(a,r))}for(const n of p.d)if(!d.d.has(n)){p.d.delete(n);const r=c(e,n);null==r||r.t.delete(t)}}},ew=(e,t)=>{var n;const r=uw(e),i=r[1],o=r[4],a=r[6],s=r[10],l=r[11],u=r[12],c=r[13],d=r[14],p=r[16],f=r[18],h=l(e,t);let m=i.get(t);if(!m){d(e,t);for(const n of h.d.keys()){f(e,n).t.add(t)}if(m={l:new Set,d:new Set(h.d.keys()),t:new Set},i.set(t,m),qS(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return p(e,t,...r)}finally{n||(c(e),u(e))}};try{const i=s(e,t,r);i&&(m.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}};o.add(n)}null==(n=a.m)||n.call(a,t)}return m},tw=(e,t)=>{var n,r;const i=uw(e),o=i[1],a=i[5],s=i[6],l=i[11],u=i[19],c=l(e,t);let d=o.get(t);if(!d||d.l.size)return d;let p=!1;for(const e of d.t)if(null==(n=o.get(e))?void 0:n.d.has(t)){p=!0;break}if(p)return d;d.u&&a.add(d.u),d=void 0,o.delete(t);for(const n of c.d.keys()){const r=u(e,n);null==r||r.t.delete(t)}null==(r=s.u)||r.call(s,t)},nw=(e,t,n)=>{const r=uw(e),i=r[11],o=r[27],a=i(e,t),s="v"in a,l=a.v;if(_S(n))for(const r of a.d.keys())jS(t,n,i(e,r));a.v=n,delete a.e,s&&Object.is(l,a.v)||(++a.n,_S(l)&&o(e,l))},rw=(e,t)=>NS((0,uw(e)[14])(e,t)),iw=(e,t,...n)=>{const r=uw(e),i=r[3],o=r[12],a=r[13],s=r[16],l=i.size;try{return s(e,t,...n)}finally{i.size!==l&&(a(e),o(e))}},ow=(e,t,n)=>{const r=uw(e),i=r[12],o=r[18],a=r[19],s=o(e,t).l;return s.add(n),i(e),()=>{s.delete(n),a(e,t),i(e)}},aw=(e,t,n)=>{const r=uw(e)[25];let i=r.get(t);if(!i){i=new Set,r.set(t,i);const e=()=>r.delete(t);t.then(e,e)}i.add(n)},sw=(e,t)=>{const n=uw(e)[25].get(t);null==n||n.forEach(e=>e())},lw=new WeakMap,uw=e=>{const n=lw.get(e);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!n)throw new Error("Store must be created by buildStore to read its building blocks");return n};function cw(e){const t=uw(e),n=t[24];return n?n(t):t}function dw(...e){const t={get:e=>(0,uw(t)[21])(t,e),set:(e,...n)=>(0,uw(t)[22])(t,e,...n),sub:(e,n)=>(0,uw(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},$S,VS,HS,BS,GS,US,YS,XS,JS,ZS,QS,ew,tw,nw,rw,iw,ow,void 0,new WeakMap,aw,sw,[0]].map((t,n)=>e[n]||t);return lw.set(t,Object.freeze(n)),t}let pw,fw=0;function hw(e,n){const r="atom"+ ++fw,i={toString(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&this.debugLabel?r+":"+this.debugLabel:r}};return"function"==typeof e?i.read=e:(i.init=e,i.read=mw,i.write=gw),n&&(i.write=n),i}function mw(e){return e(this)}function gw(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function vw(){return dw()}const yw=u(void 0);function bw(e){const n=h(yw);return(null==e?void 0:e.store)||n||(pw||(pw=vw(),"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=pw),globalThis.__JOTAI_DEFAULT_STORE__!==pw&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),pw)}function xw({children:e,store:t}){const n=l(null);return t?r(yw.Provider,{value:t},e):(null===n.current&&(n.current=vw()),r(yw.Provider,{value:n.current},e))}const Sw=e=>"function"==typeof(null==e?void 0:e.then),ww=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Cw=n.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(ww(e),e)}),Ew=new WeakMap,Iw=(e,t,n)=>{const r=cw(e)[26];let i=Ew.get(t);return i||(i=new Promise((o,a)=>{let s=t;const l=e=>t=>{s===e&&o(t)},u=e=>t=>{s===e&&a(t)},c=()=>{try{const t=n();Sw(t)?(Ew.set(t,i),s=t,t.then(l(t),u(t)),r(e,t,c)):o(t)}catch(e){a(e)}};t.then(l(t),u(t)),r(e,t,c)}),Ew.set(t,i)),i};function Dw(e,t){const{delay:r,unstable_promiseStatus:i=!n.use}={},o=bw(t),[[a,s,l],u]=c(t=>{const n=o.get(e);return Object.is(t[0],n)&&t[1]===o&&t[2]===e?t:[n,o,e]},void 0,()=>[o.get(e),o,e]);let f=a;if(s===o&&l===e||(u(),f=o.get(e)),d(()=>{const t=o.sub(e,()=>{if(i)try{const t=o.get(e);Sw(t)&&ww(Iw(o,t,()=>o.get(e)))}catch(e){}if("number"==typeof r)return console.warn("[DEPRECATED] delay option is deprecated and will be removed in v3.\n\nMigration guide:\n\nCreate a custom hook like the following.\n\nfunction useAtomValueWithDelay<Value>(\n atom: Atom<Value>,\n options: { delay: number },\n): Value {\n const { delay } = options\n const store = useStore(options)\n const [value, setValue] = useState(() => store.get(atom))\n useEffect(() => {\n const unsub = store.sub(atom, () => {\n setTimeout(() => setValue(store.get(atom)), delay)\n })\n return unsub\n }, [store, atom, delay])\n return value\n}\n"),void setTimeout(u,r);u()});return u(),t},[o,e,r,i]),p(f),Sw(f)){const t=Iw(o,f,()=>o.get(e));return i&&ww(t),Cw(t)}return f}function Pw(e,n){const r=bw(n);return f((...n)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return r.set(e,...n)},[r,e])}function Rw(e,t){return[Dw(e,t),Pw(e,t)]}t.meta.env&&t.meta.env.MODE;!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},n){var r;let i,o;const a={getItem:(t,r)=>{var a,s;const l=e=>{if(i!==(e=e||"")){try{o=JSON.parse(e,null==n?void 0:n.reviver)}catch(e){return r}i=e}return o},u=null!=(s=null==(a=e())?void 0:a.getItem(t))?s:null;return(e=>"function"==typeof(null==e?void 0:e.then))(u)?u.then(l):l(u)},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n,void 0))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let s;try{s=null==(r=e())?void 0:r.subscribe}catch(e){}var l;!s&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(s=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),s&&(a.subscribe=(l=s,(e,t,n)=>l(e,e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)})))}();const Mw=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),Lw=new WeakMap,Aw=()=>{};const kw=new WeakMap;function Ow(e,t){const n=bw(t),r=qw(n);for(const[i,...o]of e)r.has(i)&&!(null==t?void 0:t.dangerouslyForceHydrate)||(r.add(i),n.set(i,...o))}const qw=e=>{let t=kw.get(e);return t||(t=new WeakSet,kw.set(e,t)),t};function Tw(){return Boolean("undefined"!=typeof process&&process.env?.NODE_ENV&&!1)}function Nw(e){const t=hw(()=>[]),n=hw(function(e){const[r,i,o]=e(t);o.has(n)&&(r.forEach(e),++i.n)});return n.effect=e,n.INTERNAL_onInit=e=>{const r=new Set;let i,o=0,a=!1,s=!1,l=!1;function u(){if(o)return;r.clear();let t=!0;const c=i=>{if(l)return e.get(i);if(i===n){const t=h(e,i);if(!TS(t)){if(!OS(i))throw new Error("no atom init");S(e,i,i.init)}return NS(t)}const o=v(e,i);try{return NS(o)}finally{C.d.set(i,o.n),d.get(i)?.t.add(n),t?r.add(i):d.has(i)&&(x(e,n),g(e),m(e))}};c.peek=e.get;const w=(r,...i)=>{const a=h(e,r);try{if(++o,r===n){if(!OS(r))throw new Error("atom not writable");const t=a.n,n=i[0];return S(e,r,n),x(e,r),void(t!==a.n&&(p.add(r),f.c?.(r),y(e,r)))}return b(e,r,...i)}finally{t||(g(e),m(e)),--o}};w.recurse=(t,...r)=>{if(l){if(Tw())throw new Error("set.recurse is not allowed in cleanup")}else try{return a=!0,x(e,n),w(t,...r)}finally{g(e),a=!1,s&&(s=!1,u())}};try{i?.();const e=n.effect(c,w);if("function"!=typeof e)return;i=()=>{if(!o)try{return t=!0,l=!0,e()}finally{t=!1,l=!1,i=void 0}}}finally{t=!1,r.forEach(t=>{C.d.set(t,h(e,t).n)}),x(e,n),g(e)}}const c=cw(e),d=c[1],p=c[3],f=WS(c[6]),h=c[11],m=c[12],g=c[13],v=c[14],y=c[15],b=c[16],x=c[17],S=c[20],w=function(e,t){let n=_w.get(e);n||(n=new Set,_w.set(e,n),t.f.add(function(){for(const e of n)n.delete(e),e()}));return n}(e,f),C=h(e,n);C.v=void 0,Object.assign(e.get(t),[r,C,d]),f.c.add(n,function(){p.delete(n)}),f.m.add(n,function(){w.add(u),i&&w.delete(i)}),f.u.add(n,function(){w.delete(u),i&&w.add(i)}),f.c.add(n,function(){a?s=!0:w.add(u)})},Tw()&&(Object.defineProperty(t,"debugLabel",{get:()=>n.debugLabel?`${n.debugLabel}:ref`:void 0,configurable:!0,enumerable:!0}),t.debugPrivate=!0),n}const _w=new WeakMap;const jw=async(e,t,n)=>{const r=e.get(n);void 0!==r&&("dimension"===r.type?await t.moveDimensionToAlternative(r.def.qDef.cId):await t.moveMeasureToAlternative(r.def.qDef.cId))},Fw=async(e,t,n)=>{const r=e.get(n);void 0!==r&&("dimension"===r.type?await t.moveDimensionFromAlternative(r.def.qDef.cId):await t.moveMeasureFromAlternative(r.def.qDef.cId))},zw=async e=>{const{type:t,handler:n,model:r,fieldInfo:i,handlerQueue:o}=e;void 0!==n&&void 0!==r&&o&&o.add(async()=>{switch(t){case"apply":for(const t of e.localChecked)await Fw(i,n,t);for(const t of e.localUnchecked)await jw(i,n,t);break;case"checked":await Fw(i,n,e.cId);break;case"unchecked":await jw(i,n,e.cId)}})},Ww=hw(),$w=hw(),Vw=hw(),Hw=hw(e=>e(Vw)?.translate??(e=>e)),Bw=hw(""),Gw=hw(e=>{const t=e(Bw).toLowerCase().trim();return({title:e})=>e.toLowerCase().trim().includes(t)}),Uw=e=>7005!==e.qError?.qErrorCode,Yw=new WeakMap,Kw={qInfo:{qType:"AlternativeLayout"},qHyperCubeDef:{qMode:"S",qDimensions:[],qMeasures:[],qInitialDataFetch:[{qTop:0,qLeft:0,qHeight:0,qWidth:0}],excludedNoOfLeftDims:-1,qCalcCond:{qv:"0"}}},Xw=function(e,n=Aw){return((e,t,n)=>{const r=Mw(()=>new WeakMap,Lw,t);return Mw(e,r,n)})(()=>{const r=new WeakMap,i=new WeakMap,o=hw(0),a=hw([]);a.INTERNAL_onInit=e=>{e.set(a,[()=>e.set(o,e=>e+1)])},"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(o.debugPrivate=!0,a.debugPrivate=!0);const s=hw(t=>{let l;t(o);try{l=t(s)}catch(e){}const u=t(e);if(!(e=>"function"==typeof(null==e?void 0:e.then))(u))return{v:u};if(u!==(null==l?void 0:l.p)&&u.then(e=>{i.set(u,e);const[n]=t(a);n()},e=>{r.set(u,e);const[n]=t(a);n()}),r.has(u))throw r.get(u);return i.has(u)?{p:u,v:i.get(u)}:l&&"v"in l?{p:u,f:n(l.v),v:l.v}:{p:u,f:n()}});return s.init=void 0,"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(s.debugPrivate=!0),hw(e=>{const t=e(s);return"f"in t?t.f:t.v},(t,n,...r)=>n(e,...r))},e,n)}(hw(async e=>{const t=e(Ww);if(t){if(Yw.has(t))return Yw.get(t);try{const e=await t.app.createSessionObject(Kw);return Yw.set(t,e),e}catch(e){return void console.error("Error creating alternative layout model:",e)}}})),Jw=hw(null),Zw=hw(),Qw=Nw((e,t)=>{const n=e(Ww),r=e(Xw);if(!n||!r)return;const i=async()=>{const e=await n.getLayout();if(e.qSelectionInfo?.qInSelections)return;const i=await n.getEffectiveProperties();await r.applyPatches([{qOp:"replace",qPath:"/qHyperCubeDef/qDimensions",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions)},{qOp:"replace",qPath:"/qHyperCubeDef/qMeasures",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures)}]);const o=await r.getLayout();t(Zw,{layout:structuredClone(e),properties:structuredClone(i),altLayout:structuredClone(o)}),t(Jw,null)};return i(),n.Invalidated?.bind(i),()=>{n.Invalidated?.unbind(i)}}),eC=hw(e=>e(Zw)?.layout),tC=hw(e=>e(Zw)?.altLayout),nC=hw(e=>e(Zw)?.properties),rC=hw(e=>{const t=e(Zw)?.layout;return t?.qHyperCube.qDimensionInfo.filter(Uw)??[]}),iC=hw(e=>{const t=e(Zw)?.layout;return t?.qHyperCube.qMeasureInfo.filter(Uw)??[]}),oC=hw(e=>{const t=e(eC),n=e(rC),r=e(iC),i=e(nC),o=new Map;return t&&i?(n.forEach((e,t)=>{o.set(e.cId,{id:e.cId,type:"dimension",def:i.qHyperCubeDef.qDimensions[t]})}),r.forEach((e,t)=>{o.set(e.cId,{id:e.cId,type:"measure",def:i.qHyperCubeDef.qMeasures[t]})}),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"dimension",def:e})}),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.forEach(e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"measure",def:e})}),o):o});class aC{#e=[];#t=!1;#n=!1;#r;#i;#o;#a;constructor({onQueueCompleted:e}){this.#r=e}#s(){this.#i=void 0,this.#o=void 0,this.#a=void 0}pause(){this.#i&&(clearTimeout(this.#a),this.#o?.(),this.#s());const{promise:e,resolve:t}=Promise.withResolvers();this.#i=e,this.#o=t,this.#a=setTimeout(()=>{this.abort("Aborting queue after being paused for too long")},6e4)}async continue(e=0){const t=this.#o;await(e=>new Promise(t=>{setTimeout(t,e)}))(e),t===this.#o&&(t?.(),clearTimeout(this.#a),this.#s())}abort(e="Queue aborted"){clearTimeout(this.#a),(this.#e.length>0||this.#t)&&console.warn(`[SequentialPromiseQueue] ${e}`),this.#n=!0,this.#e=[],this.#o?.(),this.#s()}add(e){this.#e.push(e),this.#t||this.#l()}async#l(){if(!this.#t){for(this.#t=!0,this.#n=!1;this.#e.length>0;)if(this.#i)await this.#i;else try{const e=this.#e.shift();await(e?.())}catch(e){return console.error("[SequentialPromiseQueue] Error executing action:",e),this.#e=[],void(this.#t=!1)}try{this.#n||await(this.#r?.())}catch(e){console.error("[SequentialPromiseQueue] Error executing onQueueCompleted:",e)}finally{this.#t=!1,this.#e.length>0&&this.#l()}}}}const sC=hw(null),lC=Nw((e,t)=>{const n=e(Ww),r=e($w),i=new aC({onQueueCompleted:async()=>{n&&r&&await n.applyPatches([{qPath:"/qHyperCubeDef",qOp:"replace",qValue:JSON.stringify(r.properties.qHyperCubeDef)}],!0)}});t(sC,i);const o=()=>{i.pause()},a=()=>{i.continue(500)},s=()=>{i.abort()};return n?.Invalidated?.bind(o),n?.Validated?.bind(a),n?.Cancelled?.bind(s),n?.Closing?.bind(s),()=>{i.abort(),n?.Invalidated?.unbind(o),n?.Validated?.unbind(a),n?.Cancelled?.unbind(s),n?.Closing?.unbind(s)}}),uC=hw(e=>{const t=[...e(rC),...e(iC)].map(e=>e.cId);return new Set(t)}),cC=hw(new Set),dC=hw(new Set),pC=hw(e=>{const t=e(cC),n=e(dC);return e(uC).difference(n).union(t)}),fC=Nw((e,t)=>{e(uC),t(cC,new Set),t(dC,new Set)}),hC=hw(e=>e(pC),(e,t,n)=>{const r=e(pC).has(n),i=new Set(e(dC)),o=new Set(e(cC));r?(i.add(n),o.delete(n)):(o.add(n),i.delete(n)),t(dC,i),t(cC,o),zw({type:r?"unchecked":"checked",cId:n,handler:e($w),model:e(Ww),fieldInfo:e(oC),handlerQueue:e(sC)})}),mC=({props:e,children:t})=>(Ow([[Ww,e.args.model],[Vw,e.args.apis],[$w,e.args.handler]]),Dw(fC),Dw(Qw),Dw(lC),t);function gC(e,t){const n=new Set(e),r=new Set(t);return e===t||n.size===r.size&&Array.from(n).every(r.has.bind(r))}function vC(e){return"write"in e}const yC=new WeakMap,bC={},{read:xC,write:SC}=hw(null);function wC(e,t,n){const[r,i,o,,a]=e,s=r.get(t);if(s)return s;if(n===e){let r=i.get(t);return r||(r=[DC(e,t,n),n],i.set(t,r)),r}const l=n??bC;let u=o.get(l);u||(u=new WeakMap,o.set(l,u));let c=u.get(t);if(!c){const[r,i]=a?wC(a,t,n):[t];c=[t.read===xC?r:DC(e,t,i),i],u.set(t,c)}return c}function CC(e){for(const t of e[5])t()}function EC(e,t,n,r,i){if(n.read===xC&&vC(n)&&vC(t)&&n.write!==SC&&e!==r){const{write:o}=n;return t.write=IC(e,n.write.bind(n),r,i),()=>{t.write=o}}}function IC(e,t,n,r=n){return function(i,o,...a){return t(function(t){const[r]=wC(e,t,n);return i(r)},function(t,...i){const[a]=wC(e,t,n),s=EC(e,a,t,n,r);try{return o(a,...i)}finally{null==s||s()}},...a)}}function DC(e,t,n){const r=Object.getOwnPropertyDescriptors(t);Object.keys(r).filter(e=>["read","write","debugLabel"].includes(e)).forEach(e=>r[e].configurable=!0);const i=Object.getPrototypeOf(t),o=Object.create(i,r);return o.read!==xC&&(o.read=function(e,t,n){return function(r,i){return t(function(t){const[i]=wC(e,t,n);return r(i)},i)}}(e,t.read.bind(t),n)),vC(o)&&vC(t)&&o.write!==SC&&(o.write=IC(e,t.write.bind(t),n)),o}function PC({atoms:e=[],atomFamilies:t=[],parentStore:n,name:r}){const i=new WeakSet(e),o=yC.get(n),a=(null==o?void 0:o[3])??n,s=[new WeakMap,new WeakMap,new WeakMap,a,o,new Set,void 0],l=s[0],u=s[5],c=function(e){const t=e[3],n=[...cw(t)],r=n[21],i=n[22],o=n[23],a=n[9],s={};n[9]=(e,t)=>a(l,t),n[21]=h(r),n[22]=p,n[23]=h(o),n[24]=([...e])=>{const t=[m(e[0],u),m(e[1],c),m(e[2]),g(e[3]),e[4],e[5],y(e[6]),h(e[7]),h(e[8]),e[9],h(e[10]),h(e[11],e=>d(t[0],e)),e[12],e[13],h(e[14]),h(e[15]),h(e[16]),h(e[17]),h(e[18]),h(e[19]),h(e[20]),h(e[21]),h(e[22]),h(e[23]),()=>e];return t};const l=dw(...n);return l;function u(t){const n=new WeakMap;return function(r){let i=n.get(r);if(i)return i;const o=t(r);return o?(i={...o,d:m(o.d,function(t){return n=>t(wC(e,n)[0])}),p:g(o.p),get n(){return o.n},set n(e){o.n=e},get v(){return o.v},set v(e){o.v=e},get e(){return o.e},set e(e){o.e=e}},n.set(r,i),i):void 0}}function c(e){const t=new WeakMap;return function(n){let r=t.get(n);if(r)return r;const i=e(n);return i?(r={...i,d:g(i.d),t:g(i.t),get u(){return i.u},set u(e){i.u=e}},t.set(n,r),r):void 0}}function d(e,t){return function(n,r){return e.get(r)||(e.set(r,t(n,r)),e.get(r))}}function p(t,n,...r){const[o,a]=wC(e,n),s=EC(e,o,n,a,e);try{return i(t,o,...r)}finally{null==s||s()}}function f(t,n){return function(r,...i){const[o]=wC(e,r);return(n?n(t):t)(o,...i)}}function h(t,n){return function(r,i,...o){const[a]=wC(e,i);return(n?n(t):t)(r,a,...o)}}function m(e,t){return{get:f(e.get.bind(e),t),set:f(e.set.bind(e)),has:f(e.has.bind(e)),delete:f(e.delete.bind(e))}}function g(t){return{get size(){return t.size},add:f(t.add.bind(t)),has:f(t.has.bind(t)),delete:f(t.delete.bind(t)),clear:t.clear.bind(t),forEach:e=>t.forEach(f(e)),*[Symbol.iterator](){for(const n of t)yield wC(e,n)[0]}}}function v(t){if(!t)return;const n=f(t);return n.add=function(n,r){if(void 0===n)return t.add(void 0,r);const[i]=wC(e,n);return t.add(i,r)},n}function y(e){const t={get f(){return e.f},set f(t){e.f=t}};return Object.defineProperties(t,Object.fromEntries(["r","c","m","u"].map(t=>[t,{get:()=>s[t]??(s[t]=v(e[t])),set(n){delete s[t],e[t]=n},configurable:!0,enumerable:!0}]))),Object.assign(t,e)}}(s);s[6]=c,Object.assign(c,{name:r}),yC.set(c,s);for(const t of new Set(e))l.set(t,[DC(s,t,s),s]);for(const e of new Set(t)){for(const t of e.getParams()){const n=e(t);l.has(n)||l.set(n,[DC(s,n,s),s])}const t=e.unstable_listen(({type:e,atom:t})=>{"CREATE"!==e||l.has(t)?"REMOVE"===e&&!i.has(t)&&l.delete(t):l.set(t,[DC(s,t,s),s])});u.add(t)}return c}const RC=function(e,t){return function(n){const{atoms:i=[],atomFamilies:o=[],children:a,scope:s,name:l}=n,u=t(),c=Array.from(i,e=>Array.isArray(e)?e[0]:e);function p(){return[s??PC({atoms:c,atomFamilies:o,parentStore:u,name:l}),function(e){return u!==e.parentStore||!gC(c,e.atoms)||!gC(o,e.atomFamilies)||s!==e.providedScope}]}const[[f,h],g]=m(p);if(h({atoms:c,atomFamilies:o,parentStore:u,providedScope:s})){const e=yC.get(f);e&&CC(e),g(p)}return Ow(Array.from(i).filter(Array.isArray),{store:f}),d(()=>{const e=yC.get(f);return()=>{e&&CC(e)}},[f]),r(e,{store:f,children:a})}}(xw,bw);var MC=Object.defineProperty,LC=Object.defineProperties,AC=Object.getOwnPropertyDescriptors,kC=Object.getOwnPropertySymbols,OC=Object.prototype.hasOwnProperty,qC=Object.prototype.propertyIsEnumerable,TC=(e,t,n)=>t in e?MC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NC=(e,t)=>{for(var n in t||(t={}))OC.call(t,n)&&TC(e,n,t[n]);if(kC)for(var n of kC(t))qC.call(t,n)&&TC(e,n,t[n]);return e},_C=(e,t)=>LC(e,AC(t));function jC(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function FC(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function zC(e,t){return function(e,t,n){var r,i,o;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const r=e.findIndex(e=>u(e,a.id)),i=e.findIndex(e=>u(e,s.id));if(-1===r||-1===i){if(FC(a)){const r=a.initialIndex,i=a.index;return r===i||r<0||r>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,r,i)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==r)return n(e,r,t)}return n(e,r,i)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&FC(a)){const r=a.initialGroup,i=a.initialIndex,o=a.group,s=a.index;if(null==r||null==o||!(r in e)||!(o in e))return"preventDefault"in t&&t.preventDefault(),e;if(r===o&&i===s)return"preventDefault"in t&&t.preventDefault(),e;if(r===o)return _C(NC({},e),{[r]:n(e[r],i,s)});const l=e[r][i];return _C(NC({},e),{[r]:[...e[r].slice(0,i),...e[r].slice(i+1)],[o]:[...e[o].slice(0,s),l,...e[o].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(i=null==(r=m.shape)?void 0:r.current.center)?i:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&FC(a)){const t=null!=a.group&&a.group!==d,r=a.index!==f;if(t||r){const t=null!=(o=a.group)?o:d;if(t in e){if(d===t)return _C(NC({},e),{[d]:n(e[d],f,a.index)});const r=e[d][f];return _C(NC({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),r,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return _C(NC({},e),{[d]:n(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return _C(NC({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,jC)}function WC(e,t){let n=null;const r=new Map,i=new Set;function o(i){let s;if(void 0===t)s=r.get(i);else for(const[e,n]of r)if(t(e,i)){s=n;break}if(void 0!==s){if(!n?.(s[1],i))return s[0];o.remove(i)}const l=e(i);return r.set(i,[l,Date.now()]),a("CREATE",i,l),l}function a(e,t,n){for(const r of i)r({type:e,param:t,atom:n})}return o.unstable_listen=e=>(i.add(e),()=>{i.delete(e)}),o.getParams=()=>r.keys(),o.remove=e=>{if(void 0===t){if(!r.has(e))return;const[t]=r.get(e);r.delete(e),a("REMOVE",e,t)}else for(const[n,[i]]of r)if(t(n,e)){r.delete(n),a("REMOVE",n,i);break}},o.setShouldRemove=e=>{if(n=e,n)for(const[e,[t,i]]of r)n(i,e)&&(r.delete(e),a("REMOVE",e,t))},o}const $C=({itemIndex:e,sectionIndex:t})=>void 0!==e?`${t}-${e}`:`${t}`,VC=hw(),HC=hw(e=>e(VC)?.numberOfSections??0),BC=hw(e=>e(VC)?.numberOfItemsInSection??[]),GC=hw(e=>e(VC)?.keyExtractor??$C),UC=hw(e=>e(VC)?.emptyTexts??(()=>({title:"No items",message:"There are no items to display."}))),YC=hw(e=>e(VC)?.onDragEnd),KC=hw(e=>e(VC)?.onDragOver),XC=hw(e=>e(VC)?.itemRenderer),JC=hw(e=>e(VC)?.headerRenderer),ZC=hw(e=>e(VC)?.dragOverlayRenderer),QC=hw(e=>e(VC)?.onClick),eE=hw(e=>{const t=e(HC),n=e(BC),r=e(GC),i={};for(let e=0;e<t;e++)i[e]=Array.from({length:n[e]},(t,n)=>r({sectionIndex:e,itemIndex:n}));return i}),tE=hw(null),nE=hw(e=>e(tE),(e,t,n)=>{if(null===n)return void t(tE,null);const r=e(tE);t(tE,{...r,...n})}),rE=WC(e=>hw(null,(t,n,r)=>{let i;"over"===e?i=t(KC):"end"===e&&(i=t(YC),n(nE,null));const{source:o,target:a}=r.operation;if(null===a)return void n(nE,{toIndex:void 0,toSectionIndex:void 0});const s=zC(t(eE),r)[a.data.sectionIndex].indexOf(o.id),l=-1!==s?s:a.sortable?.index??0;"start"===e?n(nE,{id:o.id,startSection:o.data.sectionKey,startIndex:o.data.itemIndex,startSectionIndex:o.data.sectionIndex}):"over"===e&&n(nE,{toIndex:l,toSectionIndex:a.data.sectionIndex}),i?.({id:o.id,toIndex:l,toSection:a.data.sectionKey,fromSection:o.data.sectionKey,startSection:t(nE)?.startSection??o.data.sectionKey,event:r})})),iE=[VC,HC,BC,GC,UC,YC,XC,JC,QC,nE],oE=[rE],aE=({props:e,children:t})=>{const n=Pw(VC);return g(()=>{n(e)},[e,n]),t};var sE=Symbol.for("preact-signals");function lE(){if(fE>1)fE--;else{var e,t=!1;for(!function(){var e=vE;for(vE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==pE;){var n=pE;for(pE=void 0,hE++;void 0!==n;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&wE(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(hE=0,fE--,t)throw e}}function uE(e){if(fE>0)return e();gE=++mE,fE++;try{return e()}finally{lE()}}var cE=void 0;function dE(e){var t=cE;cE=void 0;try{return e()}finally{cE=t}}var pE=void 0,fE=0,hE=0,mE=0,gE=0,vE=void 0,yE=0;function bE(e){if(void 0!==cE){var t=e.n;if(void 0===t||t.t!==cE)return t={i:0,S:e,p:cE.s,n:void 0,t:cE,e:void 0,x:void 0,r:t},void 0!==cE.s&&(cE.s.n=t),cE.s=t,e.n=t,32&cE.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=cE.s,t.n=void 0,cE.s.n=t,cE.s=t),t}}function xE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function SE(e,t){return new xE(e,t)}function wE(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function CE(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function EE(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function IE(e,t){xE.call(this,void 0),this.x=e,this.s=void 0,this.g=yE-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function DE(e,t){return new IE(e,t)}function PE(e){var t=e.m;if(e.m=void 0,"function"==typeof t){fE++;var n=cE;cE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,RE(e),t}finally{cE=n,lE()}}}function RE(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,PE(e)}function ME(e){if(cE!==this)throw new Error("Out-of-order effect");EE(this),cE=e,this.f&=-2,8&this.f&&RE(this),lE()}function LE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function AE(e,t){var n=new LE(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}xE.prototype.brand=sE,xE.prototype.h=function(){return!0},xE.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:dE(function(){var e;null==(e=t.W)||e.call(t)}))},xE.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&dE(function(){var e;null==(e=t.Z)||e.call(t)}))}},xE.prototype.subscribe=function(e){var t=this;return AE(function(){var n=t.value,r=cE;cE=void 0;try{e(n)}finally{cE=r}},{name:"sub"})},xE.prototype.valueOf=function(){return this.value},xE.prototype.toString=function(){return this.value+""},xE.prototype.toJSON=function(){return this.value},xE.prototype.peek=function(){var e=cE;cE=void 0;try{return this.value}finally{cE=e}},Object.defineProperty(xE.prototype,"value",{get:function(){var e=bE(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(hE>100)throw new Error("Cycle detected");!function(e){0!==fE&&0===hE&&e.l!==gE&&(e.l=gE,vE={S:e,v:e.v,i:e.i,o:vE})}(this),this.v=e,this.i++,yE++,fE++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{lE()}}}}),IE.prototype=new xE,IE.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===yE)return!0;if(this.g=yE,this.f|=1,this.i>0&&!wE(this))return this.f&=-2,!0;var e=cE;try{CE(this),cE=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return cE=e,EE(this),this.f&=-2,!0},IE.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}xE.prototype.S.call(this,e)},IE.prototype.U=function(e){if(void 0!==this.t&&(xE.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},IE.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(IE.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=bE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),LE.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.m=t)}finally{e()}},LE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,PE(this),CE(this),fE++;var e=cE;return cE=this,ME.bind(this,e)},LE.prototype.N=function(){2&this.f||(this.f|=2,this.u=pE,pE=this)},LE.prototype.d=function(){this.f|=8,1&this.f||RE(this)},LE.prototype.dispose=function(){this.d()};var kE,OE,qE,TE,NE,_E,jE,FE,zE,WE,$E,VE,HE,BE,GE,UE,YE,KE,XE,JE,ZE=Object.create,QE=Object.defineProperty,eI=Object.defineProperties,tI=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyDescriptors,rI=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,oI=Object.prototype.propertyIsEnumerable,aI=e=>{throw TypeError(e)},sI=(e,t,n)=>t in e?QE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lI=(e,t)=>QE(e,"name",{value:t,configurable:!0}),uI=["class","method","getter","setter","accessor","field","value","get","set"],cI=e=>void 0!==e&&"function"!=typeof e?aI("Function expected"):e,dI=(e,t,n,r,i)=>({kind:uI[e],name:t,metadata:r,addInitializer:e=>n._?aI("Already initialized"):i.push(cI(e||null))}),pI=(e,t)=>{return sI(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r},fI=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},hI=(e,t,n,r,i,o)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=uI[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(i=i.prototype),d<5&&(d>3||!f)&&tI(d<4?i:{get[n](){return vI(this,o)},set[n](e){return bI(this,o,e)}},n));d?f&&d<4&&lI(o,(d>2?"set ":d>1?"get ":"")+n):lI(i,n);for(var b=r.length-1;b>=0;b--)u=dI(d,n,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>gI(i,e):e=>n in e},3^d&&(c.get=f?e=>(1^d?vI:xI)(e,i,4^d?o:y.get):e=>e[n]),d>2&&(c.set=f?(e,t)=>bI(e,i,t,4^d?o:y.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?f?o:y[m]:d>4?void 0:{get:y.get,set:y.set}:i,u),l._=1,4^d||void 0===s?cI(s)&&(d>4?g.unshift(s):d?f?o=s:y[m]=s:i=s):"object"!=typeof s||null===s?aI("Object expected"):(cI(a=s.get)&&(y.get=a),cI(a=s.set)&&(y.set=a),cI(a=s.init)&&g.unshift(a));return d||pI(e,i),y&&QE(i,n,y),f?4^d?o:y:i},mI=(e,t,n)=>t.has(e)||aI("Cannot "+n),gI=(e,t)=>Object(t)!==t?aI('Cannot use the "in" operator on this value'):e.has(t),vI=(e,t,n)=>(mI(e,t,"read from private field"),n?n.call(e):t.get(e)),yI=(e,t,n)=>t.has(e)?aI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bI=(e,t,n,r)=>(mI(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xI=(e,t,n)=>(mI(e,t,"access private method"),n);function SI(e,t){if(t){let n;return DE(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return DE(e)}function wI(e,t){if(Object.is(e,t))return!0;if(null===e||null===t)return!1;if("function"==typeof e&&"function"==typeof t)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;return!e.some((e,n)=>!wI(e,t[n]))}if("object"==typeof e&&"object"==typeof t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=n.some(n=>!wI(e[n],t[n]));return!i}return!1}function CI({get:e},t){return{init:e=>SE(e),get(){return e.call(this).value},set(t){const n=e.call(this);n.peek()!==t&&(n.value=t)}}}function EI(e,t){const n=new WeakMap;return function(){let t=n.get(this);return t||(t=SI(e.bind(this)),n.set(this,t)),t.value}}function II(e=!0){return function(t,n){n.addInitializer(function(){const t="field"===n.kind||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,((e,t)=>eI(e,nI(t)))(((e,t)=>{for(var n in t||(t={}))iI.call(t,n)&&sI(e,n,t[n]);if(rI)for(var n of rI(t))oI.call(t,n)&&sI(e,n,t[n]);return e})({},r),{enumerable:e}))})}}function DI(...e){const t=e.map(e=>AE(e));return()=>t.forEach(e=>e())}_E=[CI],NE=[CI],TE=[CI],qE=[II()],OE=[II()],kE=[II()];var PI,RI=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,fI(jE,5,this),yI(this,VE),yI(this,FE,fI(jE,8,this)),fI(jE,11,this),yI(this,HE,fI(jE,12,this)),fI(jE,15,this),yI(this,YE,fI(jE,16,this)),fI(jE,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return vI(this,VE,XE)}get initial(){return vI(this,VE,WE)}get previous(){return vI(this,VE,GE)}set current(e){const t=dE(()=>vI(this,VE,XE));e&&t&&this.equals(t,e)||uE(()=>{vI(this,VE,WE)||bI(this,VE,e,$E),bI(this,VE,t,UE),bI(this,VE,e,JE)})}reset(e=this.defaultValue){uE(()=>{bI(this,VE,void 0,UE),bI(this,VE,e,$E),bI(this,VE,e,JE)})}};function MI(e){return dE(()=>{const t={};for(const n in e)t[n]=e[n];return t})}jE=[,,,ZE(null)],FE=new WeakMap,VE=new WeakSet,HE=new WeakMap,YE=new WeakMap,zE=hI(jE,20,"#initial",_E,VE,FE),WE=zE.get,$E=zE.set,BE=hI(jE,20,"#previous",NE,VE,HE),GE=BE.get,UE=BE.set,KE=hI(jE,20,"#current",TE,VE,YE),XE=KE.get,JE=KE.set,hI(jE,2,"current",qE,RI),hI(jE,2,"initial",OE,RI),hI(jE,2,"previous",kE,RI),pI(jE,RI);PI=new WeakMap;var LI,AI,kI,OI,qI,TI=Object.create,NI=Object.defineProperty,_I=Object.getOwnPropertyDescriptor,jI=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,zI=Object.prototype.propertyIsEnumerable,WI=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),$I=e=>{throw TypeError(e)},VI=Math.pow,HI=(e,t,n)=>t in e?NI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BI=["class","method","getter","setter","accessor","field","value","get","set"],GI=e=>void 0!==e&&"function"!=typeof e?$I("Function expected"):e,UI=(e,t,n,r,i)=>({kind:BI[e],name:t,metadata:r,addInitializer:e=>n._?$I("Already initialized"):i.push(GI(e||null))}),YI=(e,t,n,r,i,o)=>{for(var a,s,l,u,c=7&t,d=BI[c+5],p=e[2]||(e[2]=[]),f=(i=i.prototype,_I(i,n)),h=r.length-1;h>=0;h--)(l=UI(c,n,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>n in e},u.get=e=>e[n],a=(0,r[h])(f[d],l),s._=1,GI(a)&&(f[d]=a);return f&&NI(i,n,f),i},KI=(e,t,n)=>t.has(e)||$I("Cannot "+n),XI=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},JI=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:o,height:a,scale:s}=this,l=new e(i+t,r+n,o,a);return l.scale=((e,t)=>{for(var n in t||(t={}))FI.call(t,n)&&HI(e,n,t[n]);if(jI)for(var n of jI(t))zI.call(t,n)&&HI(e,n,t[n]);return e})({},s),l}get boundingRectangle(){const{width:e,height:t,left:n,top:r,right:i,bottom:o}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:o}}get center(){const{left:e,top:t,right:n,bottom:r}=this;return new XI((e+n)/2,(t+r)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;const{left:n,top:r,width:i,height:o}=this;return n===t.left&&r===t.top&&i===t.width&&o===t.height}containsPoint(e){const{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?function(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){return a*s}return 0}(this,t):0}intersectionRatio(e){const{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){const{top:e,height:t}=this;return e+t}get right(){const{left:e,width:t}=this;return e+t}get aspectRatio(){const{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:"center",y:"center"}){const r=(e,t)=>{const r=n[t],i="x"===t?e.left:e.top,o="x"===t?e.width:e.height;return"start"==r?i:"end"==r?i+o:i+o/2};return XI.delta({x:r(e,"x"),y:r(e,"y")},{x:r(t,"x"),y:r(t,"y")})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};var ZI,QI=class extends(kI=RI,AI=[EI],LI=[EI],kI){constructor(e){var t,n,r;super(XI.from(e),(e,t)=>XI.equals(e,t)),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(qI,5,this),t=this,r=0,(n=OI).has(t)?$I("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),this.velocity={x:0,y:0}}get delta(){return XI.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=XI.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(KI(a=this,s=OI,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);uE(()=>{((e,t,n)=>{KI(e,t,"write to private field"),t.set(e,n)})(this,OI,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(XI.from(e)),this.velocity={x:0,y:0}}};function eD({x:e,y:t},n){const r=Math.abs(e),i=Math.abs(t);return"number"==typeof n?Math.sqrt(VI(r,2)+VI(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n&&i>n.y}qI=(e=>{var t;return[,,,TI(null!=(t=null==e?void 0:e[WI("metadata")])?t:null)]})(kI),OI=new WeakMap,YI(qI,2,"delta",AI,QI),YI(qI,2,"direction",LI,QI),ZI=qI,HI(QI,WI("metadata"),ZI[3]);var tD,nD,rD,iD,oD=(e=>(e.Horizontal="x",e.Vertical="y",e))(oD||{}),aD=Object.values(oD),sD=Object.create,lD=Object.defineProperty,uD=Object.defineProperties,cD=Object.getOwnPropertyDescriptor,dD=Object.getOwnPropertyDescriptors,pD=Object.getOwnPropertySymbols,fD=Object.prototype.hasOwnProperty,hD=Object.prototype.propertyIsEnumerable,mD=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),gD=e=>{throw TypeError(e)},vD=(e,t,n)=>t in e?lD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yD=(e,t)=>{for(var n in t||(t={}))fD.call(t,n)&&vD(e,n,t[n]);if(pD)for(var n of pD(t))hD.call(t,n)&&vD(e,n,t[n]);return e},bD=(e,t)=>uD(e,dD(t)),xD=(e,t)=>lD(e,"name",{value:t,configurable:!0}),SD=(e,t)=>{var n={};for(var r in e)fD.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&pD)for(var r of pD(e))t.indexOf(r)<0&&hD.call(e,r)&&(n[r]=e[r]);return n},wD=e=>{var t;return[,,,sD(null!=(t=null==e?void 0:e[mD("metadata")])?t:null)]},CD=["class","method","getter","setter","accessor","field","value","get","set"],ED=e=>void 0!==e&&"function"!=typeof e?gD("Function expected"):e,ID=(e,t,n,r,i)=>({kind:CD[e],name:t,metadata:r,addInitializer:e=>n._?gD("Already initialized"):i.push(ED(e||null))}),DD=(e,t)=>vD(t,mD("metadata"),e[3]),PD=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},RD=(e,t,n,r,i,o)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=CD[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(i=i.prototype),d<5&&(d>3||!f)&&cD(d<4?i:{get[n](){return AD(this,o)},set[n](e){return OD(this,o,e)}},n));d?f&&d<4&&xD(o,(d>2?"set ":d>1?"get ":"")+n):xD(i,n);for(var b=r.length-1;b>=0;b--)u=ID(d,n,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>LD(i,e):e=>n in e},3^d&&(c.get=f?e=>(1^d?AD:qD)(e,i,4^d?o:y.get):e=>e[n]),d>2&&(c.set=f?(e,t)=>OD(e,i,t,4^d?o:y.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?f?o:y[m]:d>4?void 0:{get:y.get,set:y.set}:i,u),l._=1,4^d||void 0===s?ED(s)&&(d>4?g.unshift(s):d?f?o=s:y[m]=s:i=s):"object"!=typeof s||null===s?gD("Object expected"):(ED(a=s.get)&&(y.get=a),ED(a=s.set)&&(y.set=a),ED(a=s.init)&&g.unshift(a));return d||DD(e,i),y&&lD(i,n,y),f?4^d?o:y:i},MD=(e,t,n)=>t.has(e)||gD("Cannot "+n),LD=(e,t)=>Object(t)!==t?gD('Cannot use the "in" operator on this value'):e.has(t),AD=(e,t,n)=>(MD(e,t,"read from private field"),n?n.call(e):t.get(e)),kD=(e,t,n)=>t.has(e)?gD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),OD=(e,t,n,r)=>(MD(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),qD=(e,t,n)=>(MD(e,t,"access private method"),n);function TD(e,t){return{plugin:e,options:t}}function ND(e){return t=>TD(e,t)}function _D(e){return"function"==typeof e?{plugin:e,options:void 0}:e}tD=[CI];var jD=class{constructor(e,t){this.manager=e,this.options=t,kD(this,rD,PD(nD,8,this,!1)),PD(nD,11,this),kD(this,iD,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return dE(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=AE(e.bind(this));return AD(this,iD).add(t),t}destroy(){AD(this,iD).forEach(e=>e())}static configure(e){return TD(this,e)}};nD=wD(null),rD=new WeakMap,iD=new WeakMap,RD(nD,4,"disabled",tD,jD,rD),DD(nD,jD);var FD,zD=class extends jD{},WD=class{constructor(e){this.manager=e,this.instances=new Map,kD(this,FD,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(_D).reduceRight((e,t)=>e.some(({plugin:e})=>e===t.plugin)?e:[t,...e],[]),n=t.map(({plugin:e})=>e);for(const e of AD(this,FD))if(!n.includes(e)){if(e.prototype instanceof zD)continue;this.unregister(e)}for(const{plugin:e,options:n}of t)this.register(e,n);OD(this,FD,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};function $D(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}FD=new WeakMap;var VD,HD,BD=[],GD=class extends jD{constructor(e){super(e),kD(this,VD),kD(this,HD),this.computeCollisions=this.computeCollisions.bind(this),OD(this,HD,SE(BD)),this.destroy=DI(()=>{const e=this.computeCollisions(),t=dE(()=>this.manager.dragOperation.position.current);if(e!==BD){const e=AD(this,VD);if(OD(this,VD,t),e&&t.x==e.x&&t.y==e.y)return}else OD(this,VD,void 0);AD(this,HD).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){dE(()=>{e?AD(this,HD).value=this.computeCollisions():OD(this,VD,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:o,status:a}=r;if(!a.initialized||!o)return BD;const s=[],l=[];for(const o of null!=e?e:n.droppables){if(o.disabled)continue;if(i&&!o.accepts(i))continue;const e=null!=t?t:o.collisionDetector;if(!e)continue;l.push(o),o.shape;const n=dE(()=>e({droppable:o,dragOperation:r}));n&&(null!=o.collisionPriority&&(n.priority=o.collisionPriority),s.push(n))}return 0===l.length?BD:(s.sort($D),s)}get collisions(){return AD(this,HD).value}};VD=new WeakMap,HD=new WeakMap;var UD=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const e of r)e(...t)}},YD=class extends UD{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function KD(e,t=!0){let n=!1;return bD(yD({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var XD,JD,ZD,QD,eP,tP,nP,rP,iP,oP=class extends zD{constructor(e){super(e);let t=[];this.destroy=DI(()=>{const{dragOperation:n,collisionObserver:r}=e;n.status.initializing&&(t=[],r.enable())},()=>{const{collisionObserver:n,monitor:r}=e,{collisions:i}=n;if(n.isDisabled())return;const o=KD({collisions:i});if(r.dispatch("collision",o),o.defaultPrevented)return;if(((e,t)=>e.map(({id:e})=>e).join("")===t.map(({id:e})=>e).join(""))(i,t))return;t=i;const[a]=i;dE(()=>{var t;(null==a?void 0:a.id)!==(null==(t=e.dragOperation.target)?void 0:t.id)&&(n.disable(),e.actions.setDropTarget(null==a?void 0:a.id).then(()=>{n.enable()}))})})}},aP=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(aP||{}),sP=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(sP||{});nP=[CI],tP=[EI],eP=[EI],QD=[EI],ZD=[EI],JD=[EI],XD=[EI];var lP=class{constructor(){PD(rP,5,this),kD(this,iP,PD(rP,8,this,"idle")),PD(rP,11,this)}get current(){return this.value}get idle(){return"idle"===this.value}get initializing(){return"initializing"===this.value}get initialized(){const{value:e}=this;return"idle"!==e&&"initialization-pending"!==e}get dragging(){return"dragging"===this.value}get dropped(){return"dropped"===this.value}set(e){this.value=e}};rP=wD(null),iP=new WeakMap,RD(rP,4,"value",nP,lP,iP),RD(rP,2,"current",tP,lP),RD(rP,2,"idle",eP,lP),RD(rP,2,"initializing",QD,lP),RD(rP,2,"initialized",ZD,lP),RD(rP,2,"dragging",JD,lP),RD(rP,2,"dropped",XD,lP),DD(rP,lP);var uP,cP,dP,pP,fP,hP,mP,gP,vP,yP=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier="string"==typeof e||"number"==typeof e?e:e.id}setDropTarget(e){return dE(()=>{const{dragOperation:t}=this.manager,n=null!=e?e:null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=KD({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return dE(()=>{const{dragOperation:t}=this.manager;null!=e.source&&this.setDragSource(e.source);if(!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const n=new AbortController,{event:r,coordinates:i}=e;uE(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=null!=r?r:null,t.position.reset(i)});const o=KD({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",o),o.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set("initializing"),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;const{status:e}=t;"initializing"===e.current&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1}))}),n)})}move(e){return dE(()=>{var t,n;const{dragOperation:r}=this.manager,{status:i,controller:o}=r;if(!i.dragging||!o||o.signal.aborted)return;const a=KD({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},null==(t=e.cancelable)||t);(null==(n=e.propagate)||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var t,n,i,o,s;if(a.defaultPrevented)return;const l=null!=(s=e.to)?s:{x:r.position.current.x+(null!=(n=null==(t=e.by)?void 0:t.x)?n:0),y:r.position.current.y+(null!=(o=null==(i=e.by)?void 0:i.y)?o:0)};r.position.current=l})})}stop(e={}){return dE(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let o;i.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const e=dE(()=>{var e;return"dropping"===(null==(e=r.source)?void 0:e.status)}),t=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(e){const{source:e}=r,n=AE(()=>{"idle"===(null==e?void 0:e.status)&&(n(),t())})}else this.manager.renderer.rendering.then(t)})};r.canceled=null!=(t=e.canceled)&&t,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:null!=(n=e.canceled)&&n,suspend:()=>{const e={resume:()=>{},abort:()=>{}};return o=new Promise((t,n)=>{e.resume=t,e.abort=n}),e}}),o?o.then(a).catch(()=>r.reset()):a()})}};pP=[CI],dP=[CI],cP=[CI],uP=[CI];var bP=class{constructor(e,t){kD(this,hP,PD(fP,8,this)),PD(fP,11,this),kD(this,mP,PD(fP,12,this)),PD(fP,15,this),kD(this,gP,PD(fP,16,this)),PD(fP,19,this),kD(this,vP,PD(fP,20,this)),PD(fP,23,this);const{effects:n,id:r,data:i={},disabled:o=!1,register:a=!0}=e;let s=r;this.manager=t,this.id=r,this.data=i,this.disabled=o,this.effects=()=>{var e;return[()=>{const{id:e,manager:t}=this;if(e!==s)return null==t||t.registry.register(this),()=>null==t?void 0:t.registry.unregister(this)},...null!=(e=null==n?void 0:n())?e:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&a&&queueMicrotask(this.register)}register(){var e;return null==(e=this.manager)?void 0:e.registry.register(this)}unregister(){var e;null==(e=this.manager)||e.registry.unregister(this)}destroy(){var e;null==(e=this.manager)||e.registry.unregister(this)}};fP=wD(null),hP=new WeakMap,mP=new WeakMap,gP=new WeakMap,vP=new WeakMap,RD(fP,4,"manager",pP,bP,hP),RD(fP,4,"id",dP,bP,mP),RD(fP,4,"data",cP,bP,gP),RD(fP,4,"disabled",uP,bP,vP),DD(fP,bP);var xP,SP,wP,CP,EP,IP,DP,PP,RP,MP,LP,AP,kP,OP,qP,TP,NP,_P,jP,FP,zP,WP,$P,VP,HP=class{constructor(){this.map=SE(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;if(r){const e=this.cleanupFunctions.get(r);null==e||e(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const a=DI(...t.effects());return this.cleanupFunctions.set(t,a),i},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);null==r||r(),this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);null==t||t(),e.destroy()}this.map.value=new Map}},BP=class extends(DP=bP,IP=[CI],EP=[CI],CP=[CI],wP=[EI],SP=[EI],xP=[EI],DP){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:o}=n,a=SD(n,["modifiers","type","sensors"]);super(a,t),PD(PP,5,this),kD(this,RP,PD(PP,8,this)),PD(PP,11,this),kD(this,MP,PD(PP,12,this)),PD(PP,15,this),kD(this,LP,PD(PP,16,this,this.isDragSource?"dragging":"idle")),PD(PP,19,this),this.type=i,this.sensors=o,this.modifiers=r,this.alignment=a.alignment}get isDropping(){return"dropping"===this.status&&this.isDragSource}get isDragging(){return"dragging"===this.status&&this.isDragSource}get isDragSource(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.source)?void 0:t.id)===this.id}};PP=wD(DP),RP=new WeakMap,MP=new WeakMap,LP=new WeakMap,RD(PP,4,"type",IP,BP,RP),RD(PP,4,"modifiers",EP,BP,MP),RD(PP,4,"status",CP,BP,LP),RD(PP,2,"isDropping",wP,BP),RD(PP,2,"isDragging",SP,BP),RD(PP,2,"isDragSource",xP,BP),DD(PP,BP);var GP=class extends(_P=bP,NP=[CI],TP=[CI],qP=[CI],OP=[CI],kP=[CI],AP=[EI],_P){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:o,type:a}=n;super(SD(n,["accept","collisionDetector","collisionPriority","type"]),t),PD(jP,5,this),kD(this,FP,PD(jP,8,this)),PD(jP,11,this),kD(this,zP,PD(jP,12,this)),PD(jP,15,this),kD(this,WP,PD(jP,16,this)),PD(jP,19,this),kD(this,$P,PD(jP,20,this)),PD(jP,23,this),kD(this,VP,PD(jP,24,this)),PD(jP,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=o,this.type=a}accepts(e){const{accept:t}=this;return!t||("function"==typeof t?t(e):!!e.type&&(Array.isArray(t)?t.includes(e.type):e.type===t))}get isDropTarget(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.target)?void 0:t.id)===this.id}};jP=wD(_P),FP=new WeakMap,zP=new WeakMap,WP=new WeakMap,$P=new WeakMap,VP=new WeakMap,RD(jP,4,"accept",NP,GP,FP),RD(jP,4,"type",TP,GP,zP),RD(jP,4,"collisionDetector",qP,GP,WP),RD(jP,4,"collisionPriority",OP,GP,$P),RD(jP,4,"shape",kP,GP,VP),RD(jP,2,"isDropTarget",AP,GP),DD(jP,GP);var UP,YP=class extends jD{constructor(e,t){super(e,t),this.manager=e,this.options=t}},KP=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(const t of null!=e?e:[])t.controller=this}onEvent(e){var t;if(!this.activated)if(null==(t=this.constraints)?void 0:t.length)for(const t of this.constraints)t.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},XP=class{constructor(e){this.options=e,kD(this,UP)}set controller(e){OD(this,UP,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;null==(t=AD(this,UP))||t.activate(e)}};UP=new WeakMap;var JP,ZP,QP,eR,tR,nR,rR,iR,oR,aR,sR,lR,uR,cR,dR,pR,fR,hR,mR,gR=class extends jD{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},vR=class{constructor(e){this.draggables=new HP,this.droppables=new HP,this.plugins=new WD(e),this.sensors=new WD(e),this.modifiers=new WD(e)}register(e,t){if(e instanceof BP)return this.draggables.register(e.id,e);if(e instanceof GP)return this.droppables.register(e.id,e);if(e.prototype instanceof gR)return this.modifiers.register(e,t);if(e.prototype instanceof YP)return this.sensors.register(e,t);if(e.prototype instanceof jD)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof bP)return e instanceof BP?this.draggables.unregister(e.id,e):e instanceof GP?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof gR)return this.modifiers.unregister(e);if(e.prototype instanceof YP)return this.sensors.unregister(e);if(e.prototype instanceof jD)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}};oR=[EI],iR=[CI],rR=[CI],nR=[CI],tR=[CI],eR=[CI],QP=[EI],ZP=[EI],JP=[EI];var yR=class{constructor(e){PD(uR,5,this),kD(this,aR),kD(this,sR),kD(this,lR,new RI(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new lP,kD(this,cR,PD(uR,8,this,!1)),PD(uR,11,this),kD(this,dR,PD(uR,12,this,null)),PD(uR,15,this),kD(this,pR,PD(uR,16,this,null)),PD(uR,19,this),kD(this,fR,PD(uR,20,this,null)),PD(uR,23,this),kD(this,hR,PD(uR,24,this,[])),PD(uR,27,this),this.position=new QI({x:0,y:0}),kD(this,mR,{x:0,y:0}),OD(this,aR,e)}get shape(){const{current:e,initial:t,previous:n}=AD(this,lR);return e&&t?{current:e,initial:t,previous:n}:null}set shape(e){e?AD(this,lR).current=e:AD(this,lR).reset()}get source(){var e;const t=this.sourceIdentifier;if(null==t)return null;const n=AD(this,aR).registry.draggables.get(t);return n&&OD(this,sR,n),null!=(e=null!=n?n:AD(this,sR))?e:null}get target(){var e;const t=this.targetIdentifier;return null!=t&&null!=(e=AD(this,aR).registry.droppables.get(t))?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const e of this.modifiers)n=e.apply(bD(yD({},this.snapshot()),{transform:n}));return OD(this,mR,n),n}snapshot(){return dE(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:AD(this,mR),shape:this.shape?MI(this.shape):null,position:MI(this.position),status:MI(this.status),canceled:this.canceled}))}reset(){uE(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,AD(this,lR).reset(),this.position.reset({x:0,y:0}),OD(this,mR,{x:0,y:0}),this.modifiers=[]})}};uR=wD(null),aR=new WeakMap,sR=new WeakMap,lR=new WeakMap,cR=new WeakMap,dR=new WeakMap,pR=new WeakMap,fR=new WeakMap,hR=new WeakMap,mR=new WeakMap,RD(uR,2,"shape",oR,yR),RD(uR,4,"canceled",iR,yR,cR),RD(uR,4,"activatorEvent",rR,yR,dR),RD(uR,4,"sourceIdentifier",nR,yR,pR),RD(uR,4,"targetIdentifier",tR,yR,fR),RD(uR,4,"modifiers",eR,yR,hR),RD(uR,2,"source",QP,yR),RD(uR,2,"target",ZP,yR),RD(uR,2,"transform",JP,yR),DD(uR,yR);var bR={get rendering(){return Promise.resolve()}};function xR(e,t){return"function"==typeof e?e(t):null!=e?e:t}var SR=class{constructor(e){var t;this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};const n=null!=e?e:{},r=xR(n.plugins,[]),i=xR(n.sensors,[]),o=xR(n.modifiers,[]),a=null!=(t=n.renderer)?t:bR,s=new YD(this),l=new vR(this);this.registry=l,this.monitor=s,this.renderer=a,this.actions=new yP(this),this.dragOperation=new yR(this),this.collisionObserver=new GD(this),this.plugins=[oP,...r],this.modifiers=o,this.sensors=i;const{destroy:u}=this,c=DI(()=>{var e,t,n;const r=dE(()=>this.dragOperation.modifiers),i=this.modifiers;for(const e of r)i.includes(e)||e.destroy();this.dragOperation.modifiers=null!=(n=null==(t=null==(e=this.dragOperation.source)?void 0:e.modifiers)?void 0:t.map(e=>{const{plugin:t,options:n}=_D(e);return new t(this,n)}))?n:i});this.destroy=()=>{c(),u()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},wR=e=>{throw TypeError(e)},CR=(e,t,n)=>t.has(e)||wR("Cannot "+n),ER=(e,t,n)=>(CR(e,t,"read from private field"),t.get(e)),IR=(e,t,n)=>t.has(e)?wR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),DR=(e,t,n,r)=>(CR(e,t,"write to private field"),t.set(e,n),n),PR=(e,t,n)=>(CR(e,t,"access private method"),n);function RR(e){return!!e&&(e instanceof KeyframeEffect||"getKeyframes"in e&&"function"==typeof e.getKeyframes)}function MR(e,t){const n=e.getAnimations();if(n.length>0)for(const e of n){if("running"!==e.playState)continue;const{effect:n}=e,r=(RR(n)?n.getKeyframes():[]).filter(t);if(r.length>0)return[r[r.length-1],e]}return null}function LR(e){const{width:t,height:n,top:r,left:i,bottom:o,right:a}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:o,right:a}}function AR(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function kR(e){return"nodeType"in e}function OR(e){var t,n,r;return e?AR(e)?e:kR(e)?"defaultView"in e?null!=(t=e.defaultView)?t:window:null!=(r=null==(n=e.ownerDocument)?void 0:n.defaultView)?r:window:window:window}function qR(e){const{Document:t}=OR(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function TR(e){return!(!e||AR(e))&&(e instanceof OR(e).HTMLElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("html"))}function NR(e){return e instanceof OR(e).SVGElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("svg")}function _R(e){return e?AR(e)?e.document:kR(e)?qR(e)?e:TR(e)||NR(e)?e.ownerDocument:document:document:document}function jR(e,t){if(function(e){return"DETAILS"===e.tagName}(e)&&!1===e.open)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return"visible"===n&&"visible"===r&&"visible"===i}function FR(e,t=e.getBoundingClientRect(),n=0){var r,i,o,a,s;let l=t;const{ownerDocument:u}=e,c=null!=(r=u.defaultView)?r:window;let d=e.parentElement;for(;d&&d!==u.documentElement;){if(!jR(d)){const e=d.getBoundingClientRect(),t=n*(e.bottom-e.top),r=n*(e.right-e.left),i=n*(e.bottom-e.top),o=n*(e.right-e.left);l={top:Math.max(l.top,e.top-t),right:Math.min(l.right,e.right+r),bottom:Math.min(l.bottom,e.bottom+i),left:Math.max(l.left,e.left-o),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}const p=c.visualViewport,f=null!=(i=null==p?void 0:p.offsetTop)?i:0,h=null!=(o=null==p?void 0:p.offsetLeft)?o:0,m=null!=(a=null==p?void 0:p.width)?a:c.innerWidth,g=null!=(s=null==p?void 0:p.height)?s:c.innerHeight,v=n*g,y=n*m;return l={top:Math.max(l.top,f-v),right:Math.min(l.right,h+m+y),bottom:Math.min(l.bottom,f+g+v),left:Math.max(l.left,h-y),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function zR(e){return{x:e.clientX,y:e.clientY}}var WR="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function $R(e=document,t=new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame")))try{const e=r.contentDocument;e&&!t.has(e)&&n.push(...$R(e,t))}catch(e){}try{const r=e.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==e&&n.push(...$R(i.document,t))}}catch(e){}return n}function VR(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function HR(){var e,t;const n=VR()?window.visualViewport:null;return{x:null!=(e=null==n?void 0:n.offsetLeft)?e:0,y:null!=(t=null==n?void 0:n.offsetTop)?t:0}}function BR(e){return!(!e||!kR(e))&&e instanceof OR(e).ShadowRoot}function GR(e){if(e&&kR(e)){let t=e.getRootNode();if(BR(t))return t;if(t instanceof Document)return t}return _R(e)}function UR(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function YR(e){return"value"in e}function KR(e){return"CANVAS"===e.tagName}function XR(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(function(e){return"IFRAME"===(null==e?void 0:e.tagName)}(r)){const{contentDocument:e}=r;if(e){const{left:i,top:o}=r.getBoundingClientRect();return XR(e,{x:t-i,y:n-o})}}return r}var JR=new WeakMap;var ZR=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=[];for(const e of n)for(const t of r){const{type:n,listener:r,options:o}=t,a=[e,t];e.addEventListener(n,r,o),this.entries.add(a),i.push(a)}return function(){for(const[e,{type:t,listener:n,options:r}]of i)e.removeEventListener(t,n,r)}}};function QR(e){const t=null==e?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function eM(e,t){const n=()=>performance.now();let r,i;return function(...o){const a=this;i?(null==r||r(),r=function(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}(()=>{e.apply(a,o),i=n()},t-(n()-i))):(e.apply(a,o),i=n())}}var tM,nM=WR?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},rM=class extends nM{constructor(e){super(t=>{ER(this,tM)?e(t,this):DR(this,tM,!0)}),IR(this,tM,!1)}};tM=new WeakMap;var iM,oM,aM,sM,lM,uM,cM,dM,pM,fM,hM,mM=Array.from({length:100},(e,t)=>t/100),gM=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,IR(this,pM),this.disconnect=()=>{var e,t,n;DR(this,cM,!0),null==(e=ER(this,aM))||e.disconnect(),null==(t=ER(this,sM))||t.disconnect(),ER(this,lM).disconnect(),null==(n=ER(this,uM))||n.remove()},IR(this,iM,!0),IR(this,oM),IR(this,aM),IR(this,sM),IR(this,lM),IR(this,uM),IR(this,cM,!1),IR(this,dM,eM(()=>{var e,t,n;const{element:r}=this;if(null==(e=ER(this,sM))||e.disconnect(),ER(this,cM)||!ER(this,iM)||!r.isConnected)return;const i=null!=(t=r.ownerDocument)?t:document,{innerHeight:o,innerWidth:a}=null!=(n=i.defaultView)?n:window,s=r.getBoundingClientRect(),l=FR(r,s),{top:u,left:c,bottom:d,right:p}=l,f=-Math.floor(u),h=-Math.floor(c),m=`${f}px ${-Math.floor(a-p)}px ${-Math.floor(o-d)}px ${h}px`;this.boundingClientRect=s,DR(this,sM,new IntersectionObserver(e=>{const[t]=e,{intersectionRect:n}=t;1!==(1!==t.intersectionRatio?t.intersectionRatio:JI.intersectionRatio(n,FR(r)))&&ER(this,dM).call(this)},{threshold:mM,rootMargin:m,root:i})),ER(this,sM).observe(r),PR(this,pM,fM).call(this)},75)),this.boundingClientRect=e.getBoundingClientRect(),DR(this,iM,function(e,t=e.getBoundingClientRect()){const{width:n,height:r}=FR(e,t);return n>0&&r>0}(e,this.boundingClientRect));let r=!0;this.callback=e=>{r&&(r=!1,n.skipInitial)||t(e)};const i=e.ownerDocument;(null==n?void 0:n.debug)&&(DR(this,uM,document.createElement("div")),ER(this,uM).style.background="rgba(0,0,0,0.15)",ER(this,uM).style.position="fixed",ER(this,uM).style.pointerEvents="none",i.body.appendChild(ER(this,uM))),DR(this,lM,new IntersectionObserver(t=>{var n,r;const i=t[t.length-1],{boundingClientRect:o,isIntersecting:a}=i,{width:s,height:l}=o,u=ER(this,iM);DR(this,iM,a),(s||l)&&(u&&!a?(null==(n=ER(this,sM))||n.disconnect(),this.callback(null),null==(r=ER(this,aM))||r.disconnect(),DR(this,aM,void 0),ER(this,uM)&&(ER(this,uM).style.visibility="hidden")):ER(this,dM).call(this),a&&!ER(this,aM)&&(DR(this,aM,new rM(ER(this,dM))),ER(this,aM).observe(e)))},{threshold:mM,root:i})),ER(this,iM)&&!n.skipInitial&&this.callback(this.boundingClientRect),ER(this,lM).observe(e)}};iM=new WeakMap,oM=new WeakMap,aM=new WeakMap,sM=new WeakMap,lM=new WeakMap,uM=new WeakMap,cM=new WeakMap,dM=new WeakMap,pM=new WeakSet,fM=function(){ER(this,cM)||(PR(this,pM,hM).call(this),function(e,t){return e===t||!(!e||!t)&&e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}(this.boundingClientRect,ER(this,oM))||(this.callback(this.boundingClientRect),DR(this,oM,this.boundingClientRect)))},hM=function(){if(ER(this,uM)){const{top:e,left:t,width:n,height:r}=FR(this.element);ER(this,uM).style.overflow="hidden",ER(this,uM).style.visibility="visible",ER(this,uM).style.top=`${Math.floor(e)}px`,ER(this,uM).style.left=`${Math.floor(t)}px`,ER(this,uM).style.width=`${Math.floor(n)}px`,ER(this,uM).style.height=`${Math.floor(r)}px`}};var vM,yM,bM,xM,SM=new WeakMap,wM=new WeakMap;function CM(e,t){let n=SM.get(e);if(!n){const t=new gM(e,t=>{const n=SM.get(e);n&&n.callbacks.forEach(e=>e(t))},{skipInitial:!0});n={disconnect:t.disconnect,callbacks:new Set}}return n.callbacks.add(t),SM.set(e,n),()=>{n.callbacks.delete(t),0===n.callbacks.size&&(SM.delete(e),n.disconnect())}}var EM=class{constructor(e,t,n){this.callback=t,IR(this,vM),IR(this,yM,!1),IR(this,bM),IR(this,xM,eM(e=>{if(!ER(this,yM)&&e.target&&"contains"in e.target&&"function"==typeof e.target.contains)for(const t of ER(this,bM))if(e.target.contains(t)){this.callback(ER(this,vM).boundingClientRect);break}},75));const r=function(e){const t=new Set;let n=QR(e);for(;n;)t.add(n),n=QR(n);return t}(e),i=function(e,t){const n=new Set;for(const r of e){const e=CM(r,t);n.add(e)}return()=>n.forEach(e=>e())}(r,t),o=function(e,t){var n;const r=e.ownerDocument;if(!wM.has(r)){const e=new AbortController,t=new Set;document.addEventListener("scroll",e=>t.forEach(t=>t(e)),{capture:!0,passive:!0,signal:e.signal}),wM.set(r,{disconnect:()=>e.abort(),listeners:t})}const{listeners:i,disconnect:o}=null!=(n=wM.get(r))?n:{};return i&&o?(i.add(t),()=>{i.delete(t),0===i.size&&(o(),wM.delete(r))}):()=>{}}(e,ER(this,xM));DR(this,bM,r),DR(this,vM,new gM(e,t,n)),this.disconnect=()=>{ER(this,yM)||(DR(this,yM,!0),i(),o(),ER(this,vM).disconnect())}}};function IM(e){return"showPopover"in e&&"hidePopover"in e&&"function"==typeof e.showPopover&&"function"==typeof e.hidePopover}function DM(e){try{IM(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch(e){}}function PM(e){return!(!WR||!e)&&e===_R(e).scrollingElement}function RM(e){var t,n;const r=OR(e),i=PM(e)?function(e){var t,n,r,i;const{documentElement:o}=_R(e),a=OR(e).visualViewport,s=null!=(t=null==a?void 0:a.width)?t:o.clientWidth,l=null!=(n=null==a?void 0:a.height)?n:o.clientHeight,u=null!=(r=null==a?void 0:a.offsetTop)?r:0,c=null!=(i=null==a?void 0:a.offsetLeft)?i:0;return{top:u,left:c,right:c+s,bottom:u+l,width:s,height:l}}(e):LR(e),o=r.visualViewport,a=PM(e)?{height:null!=(t=null==o?void 0:o.height)?t:r.innerHeight,width:null!=(n=null==o?void 0:o.width)?n:r.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-a.width,y:e.scrollHeight-a.height}};return{rect:i,position:s,isTop:s.current.y<=0,isLeft:s.current.x<=0,isBottom:s.current.y>=s.max.y,isRight:s.current.x>=s.max.x}}function MM(e,t){const{isTop:n,isBottom:r,isLeft:i,isRight:o,position:a}=RM(e),{x:s,y:l}=null!=t?t:{x:0,y:0},u=!n&&a.current.y+l>0,c=!r&&a.current.y+l<a.max.y,d=!i&&a.current.x+s>0,p=!o&&a.current.x+s<a.max.x;return{top:u,bottom:c,left:d,right:p,x:d||p,y:u||c}}vM=new WeakMap,yM=new WeakMap,bM=new WeakMap,xM=new WeakMap;var LM=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},AM=new LM(e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()}),kM=new LM(e=>setTimeout(e,50)),OM=new Map,qM=OM.clear.bind(OM);function TM(e,t=!1){if(!t)return NM(e);let n=OM.get(e);return n||(n=NM(e),OM.set(e,n),kM.schedule(qM),n)}function NM(e){return OR(e).getComputedStyle(e)}var _M={excludeElement:!0,escapeShadowDOM:!0};function jM(e,t=_M){const{limit:n,excludeElement:r,escapeShadowDOM:i}=t,o=new Set;return e?function t(a){if(null!=n&&o.size>=n)return o;if(!a)return o;if(qR(a)&&null!=a.scrollingElement&&!o.has(a.scrollingElement))return o.add(a.scrollingElement),o;if(i&&BR(a))return t(a.host);if(!TR(a))return NR(a)?t(a.parentElement):o;if(o.has(a))return o;const s=TM(a,!0);if(r&&a===e||function(e,t=TM(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(a,s)&&o.add(a),function(e,t=TM(e,!0)){return"fixed"===t.position||"sticky"===t.position}(a,s)){const{scrollingElement:e}=a.ownerDocument;return e&&o.add(e),o}return t(a.parentNode)}(e):o}function FM(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=QR(e);for(;r;){if(r===t)return n;const e=LR(r),{x:i,y:o}=zM(r,e);n.x=n.x+e.left,n.y=n.y+e.top,n.scaleX=n.scaleX*i,n.scaleY=n.scaleY*o,r=QR(r)}return n}function zM(e,t=LR(e)){const n=Math.round(t.width),r=Math.round(t.height);if(TR(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const i=TM(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function WM(e){if("none"===e)return null;const[t,n,r="0"]=e.split(" "),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function $M(e){var t,n,r,i,o,a,s,l,u;const{scale:c,transform:d,translate:p}=e,f=function(e){if("none"===e)return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}(c),h=WM(p),m=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(d);if(!m&&!f&&!h)return null;const g=null!=(t=null==f?void 0:f.x)?t:1,v=null!=(n=null==f?void 0:f.y)?n:1,y=null!=(r=null==h?void 0:h.x)?r:0,b=null!=(i=null==h?void 0:h.y)?i:0,x=null!=(o=null==m?void 0:m.x)?o:0,S=null!=(a=null==m?void 0:m.y)?a:0,w=null!=(s=null==m?void 0:m.scaleX)?s:1,C=null!=(l=null==m?void 0:m.scaleY)?l:1;return{x:y+x,y:b+S,z:null!=(u=null==h?void 0:h.z)?u:0,scaleX:g*w,scaleY:v*C}}var VM=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(VM||{}),HM={x:.2,y:.2},BM={x:10,y:10};function GM(e,t,n,r=25,i=HM,o=BM){const{x:a,y:s}=t,{rect:l,isTop:u,isBottom:c,isLeft:d,isRight:p}=RM(e),f=FM(e),h=$M(TM(e,!0)),m=null!==h&&(null==h?void 0:h.scaleX)<0,g=null!==h&&(null==h?void 0:h.scaleY)<0,v=new JI(l.left*f.scaleX+f.x,l.top*f.scaleY+f.y,l.width*f.scaleX,l.height*f.scaleY),y={x:0,y:0},b={x:0,y:0},x=v.height*i.y,S=v.width*i.x;return(!u||g&&!c)&&s<=v.top+x&&1!==(null==n?void 0:n.y)&&a>=v.left-o.x&&a<=v.right+o.x?(y.y=g?1:-1,b.y=r*Math.abs((v.top+x-s)/x)):(!c||g&&!u)&&s>=v.bottom-x&&-1!==(null==n?void 0:n.y)&&a>=v.left-o.x&&a<=v.right+o.x&&(y.y=g?-1:1,b.y=r*Math.abs((v.bottom-x-s)/x)),(!p||m&&!d)&&a>=v.right-S&&-1!==(null==n?void 0:n.x)&&s>=v.top-o.y&&s<=v.bottom+o.y?(y.x=m?-1:1,b.x=r*Math.abs((v.right-S-a)/S)):(!d||m&&!p)&&a<=v.left+S&&1!==(null==n?void 0:n.x)&&s>=v.top-o.y&&s<=v.bottom+o.y&&(y.x=m?1:-1,b.x=r*Math.abs((v.left+S-a)/S)),{direction:y,speed:b}}function UM(e,t=!1){if("scrollIntoViewIfNeeded"in(n=e)&&"function"==typeof n.scrollIntoViewIfNeeded)return void e.scrollIntoViewIfNeeded(t);var n;if(!TR(e))return e.scrollIntoView();var r=function(e){const[t]=jM(e,{limit:1});return null!=t?t:null}(e);if(!TR(r))return;const i=TM(r,!0),o=parseInt(i.getPropertyValue("border-top-width")),a=parseInt(i.getPropertyValue("border-left-width")),s=e.offsetTop-r.offsetTop<r.scrollTop,l=e.offsetTop-r.offsetTop+e.clientHeight-o>r.scrollTop+r.clientHeight,u=e.offsetLeft-r.offsetLeft<r.scrollLeft,c=e.offsetLeft-r.offsetLeft+e.clientWidth-a>r.scrollLeft+r.clientWidth,d=s&&!l;(s||l)&&t&&(r.scrollTop=e.offsetTop-r.offsetTop-r.clientHeight/2-o+e.clientHeight/2),(u||c)&&t&&(r.scrollLeft=e.offsetLeft-r.offsetLeft-r.clientWidth/2-a+e.clientWidth/2),(s||l||u||c)&&!t&&e.scrollIntoView(d)}function YM({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function KM(e,t=TM(e).translate,n=!0){if(n){const t=MR(e,e=>"translate"in e);if(t){const{translate:e=""}=t[0];if("string"==typeof e){const t=WM(e);if(t)return t}}}if(t){const e=WM(t);if(e)return e}return{x:0,y:0,z:0}}var XM=new LM(e=>setTimeout(e,0)),JM=new Map,ZM=JM.clear.bind(JM);function QM(e,t){const n=function(e){const t=e.ownerDocument;let n=JM.get(t);if(n)return n;n=t.getAnimations(),JM.set(t,n),XM.schedule(ZM);const r=n.filter(t=>RR(t.effect)&&t.effect.target===e);return JM.set(e,r),n}(e).filter(e=>{var n,r;if(RR(e.effect)){const{target:i}=e.effect;if(null==(r=i&&(null==(n=t.isValidTarget)?void 0:n.call(t,i)))||r)return e.effect.getKeyframes().some(e=>{for(const n of t.properties)if(e[n])return!0})}}).map(e=>{const{effect:t,currentTime:n}=e,r=null==t?void 0:t.getComputedTiming().duration;if(!e.pending&&"finished"!==e.playState)return"number"==typeof r&&"number"==typeof n&&n<r?(e.currentTime=r,()=>{e.currentTime=n}):void 0});if(n.length>0)return()=>n.forEach(e=>null==e?void 0:e())}var eL=class extends JI{constructor(e,t={}){var n,r,i,o;const{frameTransform:a=FM(e),ignoreTransforms:s,getBoundingClientRect:l=LR}=t,u=QM(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||VR())&&t.contains(e)}),c=l(e);let d,{top:p,left:f,width:h,height:m}=c;const g=TM(e),v=$M(g),y={x:null!=(n=null==v?void 0:v.scaleX)?n:1,y:null!=(r=null==v?void 0:v.scaleY)?r:1},b=function(e,t){var n;const r=e.getAnimations();let i=null;if(!r.length)return null;for(const e of r){if("running"!==e.playState)continue;const r=RR(e.effect)?e.effect.getKeyframes():[],o=r[r.length-1];if(!o)continue;const{transform:a,translate:s,scale:l}=o;if(a||s||l){const e=$M({transform:"string"==typeof a&&a?a:t.transform,translate:"string"==typeof s&&s?s:t.translate,scale:"string"==typeof l&&l?l:t.scale});e&&(i=i?{x:i.x+e.x,y:i.y+e.y,z:null!=(n=i.z)?n:e.z,scaleX:i.scaleX*e.scaleX,scaleY:i.scaleY*e.scaleY}:e)}}return i}(e,g);null==u||u(),v&&(d=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left-o-(1-r)*parseFloat(n),l=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width/r:e.width,c=i?e.height/i:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(c,v,g.transformOrigin),(s||b)&&(p=d.top,f=d.left,h=d.width,m=d.height));const x={width:null!=(i=null==d?void 0:d.width)?i:h,height:null!=(o=null==d?void 0:d.height)?o:m};if(b&&!s&&d){const e=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left+o+(1-r)*parseFloat(n),l=e.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width*r:e.width,c=i?e.height*i:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(d,b,g.transformOrigin);p=e.top,f=e.left,h=e.width,m=e.height,y.x=b.scaleX,y.y=b.scaleY}a&&(s||(f*=a.scaleX,h*=a.scaleX,p*=a.scaleY,m*=a.scaleY),f+=a.x,p+=a.y),super(f,p,h,m),this.scale=y,this.intrinsicWidth=x.width,this.intrinsicHeight=x.height}};function tL(e){return"style"in e&&"object"==typeof e.style&&null!==e.style&&"setProperty"in e.style&&"removeProperty"in e.style&&"function"==typeof e.style.setProperty&&"function"==typeof e.style.removeProperty}var nL=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(tL(n))for(const[r,i]of Object.entries(e)){const e=`${t}${r}`;this.initial.has(e)||this.initial.set(e,n.style.getPropertyValue(e)),n.style.setProperty(e,"string"==typeof i?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(tL(n))for(const r of e){const e=`${t}${r}`;n.style.removeProperty(e)}}reset(){const{element:e}=this;if(tL(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);""===e.getAttribute("style")&&e.removeAttribute("style")}}};function rL(e){return!!e&&(e instanceof OR(e).Element||kR(e)&&e.nodeType===Node.ELEMENT_NODE)}function iL(e){if(!e)return!1;const{KeyboardEvent:t}=OR(e.target);return e instanceof t}var oL={};function aL(e){const t=null==oL[e]?0:oL[e]+1;return oL[e]=t,`${e}-${t}`}var sL=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/XI.distance(t.shape.center,n),type:sP.PointerIntersection,priority:aP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=XI.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:sP.ShapeIntersection,priority:aP.Normal}}return null})(e)},lL=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;const o=r?JI.from(r.current.boundingRectangle).corners:void 0,a=JI.from(n.shape.boundingRectangle).corners.reduce((e,t,n)=>{var r;return e+XI.distance(XI.from(t),null!=(r=null==o?void 0:o[n])?r:i.current)},0),s=a/4;return{id:n.id,value:1/s,type:sP.Collision,priority:aP.Normal}},uL=Object.create,cL=Object.defineProperty,dL=Object.defineProperties,pL=Object.getOwnPropertyDescriptor,fL=Object.getOwnPropertyDescriptors,hL=Object.getOwnPropertySymbols,mL=Object.prototype.hasOwnProperty,gL=Object.prototype.propertyIsEnumerable,vL=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yL=e=>{throw TypeError(e)},bL=(e,t,n)=>t in e?cL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xL=(e,t)=>{for(var n in t||(t={}))mL.call(t,n)&&bL(e,n,t[n]);if(hL)for(var n of hL(t))gL.call(t,n)&&bL(e,n,t[n]);return e},SL=(e,t)=>dL(e,fL(t)),wL=(e,t)=>cL(e,"name",{value:t,configurable:!0}),CL=(e,t)=>{var n={};for(var r in e)mL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&hL)for(var r of hL(e))t.indexOf(r)<0&&gL.call(e,r)&&(n[r]=e[r]);return n},EL=e=>{var t;return[,,,uL(null!=(t=null==e?void 0:e[vL("metadata")])?t:null)]},IL=["class","method","getter","setter","accessor","field","value","get","set"],DL=e=>void 0!==e&&"function"!=typeof e?yL("Function expected"):e,PL=(e,t,n,r,i)=>({kind:IL[e],name:t,metadata:r,addInitializer:e=>n._?yL("Already initialized"):i.push(DL(e||null))}),RL=(e,t)=>bL(t,vL("metadata"),e[3]),ML=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},LL=(e,t,n,r,i,o)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=IL[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(i=i.prototype),d<5&&(d>3||!f)&&pL(d<4?i:{get[n](){return OL(this,o)},set[n](e){return TL(this,o,e)}},n));d?f&&d<4&&wL(o,(d>2?"set ":d>1?"get ":"")+n):wL(i,n);for(var b=r.length-1;b>=0;b--)u=PL(d,n,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>kL(i,e):e=>n in e},3^d&&(c.get=f?e=>(1^d?OL:NL)(e,i,4^d?o:y.get):e=>e[n]),d>2&&(c.set=f?(e,t)=>TL(e,i,t,4^d?o:y.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?f?o:y[m]:d>4?void 0:{get:y.get,set:y.set}:i,u),l._=1,4^d||void 0===s?DL(s)&&(d>4?g.unshift(s):d?f?o=s:y[m]=s:i=s):"object"!=typeof s||null===s?yL("Object expected"):(DL(a=s.get)&&(y.get=a),DL(a=s.set)&&(y.set=a),DL(a=s.init)&&g.unshift(a));return d||RL(e,i),y&&cL(i,n,y),f?4^d?o:y:i},AL=(e,t,n)=>t.has(e)||yL("Cannot "+n),kL=(e,t)=>Object(t)!==t?yL('Cannot use the "in" operator on this value'):e.has(t),OL=(e,t,n)=>(AL(e,t,"read from private field"),n?n.call(e):t.get(e)),qL=(e,t,n)=>t.has(e)?yL("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),TL=(e,t,n,r)=>(AL(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),NL=(e,t,n)=>(AL(e,t,"access private method"),n),_L="button",jL="draggable",FL="dnd-kit-description",zL="dnd-kit-announcement",WL={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},$L={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(e&&e.id!==(null==t?void 0:t.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function VL(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}var HL=["dragover","dragmove"];var BL,GL,UL,YL,KL,XL,JL,ZL,QL,eA,tA,nA,rA,iA=new Map,oA=class extends(KL=zD,YL=[CI],UL=[EI],GL=[EI],BL=[EI],KL){constructor(e){super(e),ML(JL,5,this),qL(this,QL),qL(this,XL,new Set),qL(this,ZL,ML(JL,8,this,new Set)),ML(JL,11,this),this.registerEffect(NL(this,QL,eA))}register(e){return OL(this,XL).add(e),()=>{OL(this,XL).delete(e)}}addRoot(e){return dE(()=>{const t=new Set(this.additionalRoots);t.add(e),this.additionalRoots=t}),()=>{dE(()=>{const t=new Set(this.additionalRoots);t.delete(e),this.additionalRoots=t})}}get sourceRoot(){var e;const{source:t}=this.manager.dragOperation;return GR(null!=(e=null==t?void 0:t.element)?e:null)}get targetRoot(){var e;const{target:t}=this.manager.dragOperation;return GR(null!=(e=null==t?void 0:t.element)?e:null)}get roots(){const{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){const e=[this.sourceRoot,this.targetRoot].filter(e=>null!=e);return new Set([...e,...this.additionalRoots])}return new Set}};JL=EL(KL),XL=new WeakMap,ZL=new WeakMap,QL=new WeakSet,eA=function(){const{roots:e}=this,t=[];for(const n of e)for(const e of OL(this,XL))t.push(NL(this,QL,tA).call(this,n,e));return()=>{for(const e of t)e()}},tA=function(e,t){let n=iA.get(e);n||(n=new Map,iA.set(e,n));let r=n.get(t);if(!r){const i=qR(e)?NL(this,QL,nA).call(this,e,n,t):NL(this,QL,rA).call(this,e,n,t);if(!i)return()=>{};r=i,n.set(t,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,0===r.refCount&&r.cleanup())}},nA=function(e,t,n){const r=e.createElement("style");r.textContent=n,e.head.prepend(r);const i=new MutationObserver(t=>{for(const n of t)for(const t of Array.from(n.removedNodes))if(t===r)return void e.head.prepend(r)});return i.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),t.delete(n),0===t.size&&iA.delete(e)}}},rA=function(e,t,n){!("adoptedStyleSheets"in e)||Array.isArray(e.adoptedStyleSheets);const r=e.ownerDocument.defaultView,{CSSStyleSheet:i}=null!=r?r:{};if(!i)return null;const o=new i;return o.replaceSync(n),e.adoptedStyleSheets.push(o),{refCount:0,cleanup:()=>{var r;if(BR(e)&&(null==(r=e.host)?void 0:r.isConnected)){const t=e.adoptedStyleSheets.indexOf(o);-1!==t&&e.adoptedStyleSheets.splice(t,1)}t.delete(n),0===t.size&&iA.delete(e)}}},LL(JL,4,"additionalRoots",YL,oA,ZL),LL(JL,2,"sourceRoot",UL,oA),LL(JL,2,"targetRoot",GL,oA),LL(JL,2,"roots",BL,oA),RL(JL,oA);var aA="data-dnd-",sA=`${aA}dropping`,lA="--dnd-",uA=`${aA}dragging`,cA=`${aA}placeholder`,dA=[uA,cA,"popover","aria-pressed","aria-grabbing"],pA=["view-transition-name"],fA=`\n :is(:root,:host) [${uA}] {\n position: fixed !important;\n pointer-events: none !important;\n touch-action: none;\n z-index: calc(infinity);\n will-change: translate;\n top: var(${lA}top, 0px) !important;\n left: var(${lA}left, 0px) !important;\n right: unset !important;\n bottom: unset !important;\n width: var(${lA}width, auto);\n max-width: var(${lA}width, auto);\n height: var(${lA}height, auto);\n max-height: var(${lA}height, auto);\n transition: var(${lA}transition) !important;\n }\n\n :is(:root,:host) [${cA}] {\n transition: none;\n }\n\n :is(:root,:host) [${cA}='hidden'] {\n visibility: hidden;\n }\n\n [${uA}] * {\n pointer-events: none !important;\n }\n\n [${uA}]:not([${sA}]) {\n translate: var(${lA}translate) !important;\n }\n\n [${uA}][style*='${lA}scale'] {\n scale: var(${lA}scale) !important;\n transform-origin: var(${lA}transform-origin) !important;\n }\n\n @layer dnd-kit {\n :where([${uA}][popover]) {\n overflow: visible;\n background: unset;\n border: unset;\n margin: unset;\n padding: unset;\n color: inherit;\n\n &:is(input, button) {\n border: revert;\n background: revert;\n }\n }\n }\n [${uA}]::backdrop, [${aA}overlay]:not([${uA}]) {\n display: none;\n visibility: hidden;\n }\n`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function hA(e,t="hidden"){return dE(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=function(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const e=`${aA}${aL("dom-id")}`;r.element.setAttribute(e,""),n.set(r,e)}return n}(n,r.registry.droppables),o=[],a=function(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{const n=r[t];if(YR(e)&&YR(n)&&("file"!==e.type&&(e.value=n.value),"radio"===e.type&&e.name&&(e.name=`Cloned__${e.name}`)),KR(e)&&KR(n)&&n.width>0&&n.height>0){const t=e.getContext("2d");null==t||t.drawImage(n,0,0)}}),n}(n),{remove:s}=a;return function(e,t,n){for(const[r,i]of e){if(!r.element)continue;const e=`[${i}]`,o=t.matches(e)?t:t.querySelector(e);if(r.element.removeAttribute(i),!o)continue;const a=r.element;r.proxy=o,o.removeAttribute(i),JR.set(a,o),n.push(()=>{JR.delete(a),r.proxy=void 0})}}(i,a,o),function(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(cA,t)}(a,t),a.remove=()=>{o.forEach(e=>e()),s.call(a)},a})}function mA(e,t){return e===t||QR(e)===QR(t)}function gA(e){const{target:t}=e;"newState"in e&&"closed"===e.newState&&rL(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>DM(t))}function vA(e){return"TR"===e.tagName}var yA,bA,xA,SA,wA,CA,EA,IA=250,DA="ease";var PA=class extends(bA=jD,yA=[CI],bA){constructor(e,t){super(e,t),qL(this,wA),qL(this,SA,ML(xA,8,this)),ML(xA,11,this),this.state={initial:{},current:{}};const n=e.registry.plugins.get(oA),r=null==n?void 0:n.register(fA);if(r){const e=this.destroy.bind(this);this.destroy=()=>{r(),e()}}this.registerEffect(NL(this,wA,CA).bind(this,n)),this.registerEffect(NL(this,wA,EA))}};xA=EL(bA),SA=new WeakMap,wA=new WeakSet,CA=function(e){const{overlay:t}=this;if(!t||!e)return;const n=GR(t);return n?e.addRoot(n):void 0},EA=function(){var e,t,n;const{state:r,manager:i,options:o}=this,{dragOperation:a}=i,{position:s,source:l,status:u}=a;if(u.idle)return r.current={},void(r.initial={});if(!l)return;const{element:c,feedback:d}=l;if(!c||"none"===d||!u.initialized||u.initializing)return;const{initial:p}=r,f=null!=(e=this.overlay)?e:c,h=FM(f),m=FM(c),g=!mA(c,f),v=new eL(c,{frameTransform:g?m:null,ignoreTransforms:!g}),y=m.scaleX/h.scaleX,b=m.scaleY/h.scaleY;let{width:x,height:S,top:w,left:C}=v;g&&(x/=y,S/=b);const E=new nL(f),{transition:I,translate:D,boxSizing:P,paddingBlockStart:R,paddingBlockEnd:M,paddingInlineStart:L,paddingInlineEnd:A,borderInlineStartWidth:k,borderInlineEndWidth:O,borderBlockStartWidth:q,borderBlockEndWidth:T}=TM(c),N="clone"===d,_="content-box"===P,j=_?parseInt(L)+parseInt(A)+parseInt(k)+parseInt(O):0,F=_?parseInt(R)+parseInt(M)+parseInt(q)+parseInt(T):0,z="move"===d||this.overlay?null:hA(l,N?"clone":"hidden"),W=dE(()=>iL(i.dragOperation.activatorEvent));if("none"!==D){const e=WM(D);e&&!p.translate&&(p.translate=e)}if(!p.transformOrigin){const e=dE(()=>s.current);p.transformOrigin={x:(e.x-C*h.scaleX-h.x)/(x*h.scaleX),y:(e.y-w*h.scaleY-h.y)/(S*h.scaleY)}}const{transformOrigin:$}=p,V=w*h.scaleY+h.y,H=C*h.scaleX+h.x;if(!p.coordinates&&(p.coordinates={x:H,y:V},1!==y||1!==b)){const{scaleX:e,scaleY:t}=m,{x:n,y:r}=$;p.coordinates.x+=(x*e-x)*n,p.coordinates.y+=(S*t-S)*r}p.dimensions||(p.dimensions={width:x,height:S}),p.frameTransform||(p.frameTransform=h);const B=p.coordinates.x-H,G=p.coordinates.y-V,U=(p.dimensions.width*p.frameTransform.scaleX-x*h.scaleX)*$.x,Y=(p.dimensions.height*p.frameTransform.scaleY-S*h.scaleY)*$.y,K={x:B/h.scaleX+U,y:G/h.scaleY+Y},X=C+K.x,J=w+K.y;f.setAttribute(uA,"true");const Z=dE(()=>a.transform),Q=null!=(t=p.translate)?t:{x:0,y:0},ee=Z.x*h.scaleX+Q.x,te=Z.y*h.scaleY+Q.y,ne=HR();if(E.set({width:x-j,height:S-F,top:J+ne.y,left:X+ne.x,translate:`${ee}px ${te}px 0`,transition:I?`${I}, translate 0ms linear`:"",scale:g?`${y} ${b}`:"","transform-origin":`${100*$.x}% ${100*$.y}%`},lA),z&&(c.insertAdjacentElement("afterend",z),null==o?void 0:o.rootElement)){("function"==typeof o.rootElement?o.rootElement(l):o.rootElement).appendChild(c)}let re,ie,oe;IM(f)&&(f.hasAttribute("popover")||f.setAttribute("popover","manual"),DM(f),f.addEventListener("beforetoggle",gA));const ae=(se={placeholder:z,element:c,feedbackElement:f,frameTransform:h,transformOrigin:$,width:x,height:S,top:w,left:C,widthOffset:j,heightOffset:F,delta:K,styles:E,dragOperation:a,getElementMutationObserver:()=>re,getSavedCellWidths:()=>oe,setSavedCellWidths:e=>{oe=e}},new ResizeObserver(()=>{var e,t;const n=new eL(se.placeholder,{frameTransform:se.frameTransform,ignoreTransforms:!0}),r=null!=(e=se.transformOrigin)?e:{x:1,y:1},i=(se.width-n.width)*r.x+se.delta.x,o=(se.height-n.height)*r.y+se.delta.y,a=HR();if(se.styles.set({width:n.width-se.widthOffset,height:n.height-se.heightOffset,top:se.top+o+a.y,left:se.left+i+a.x},lA),null==(t=se.getElementMutationObserver())||t.takeRecords(),vA(se.element)&&vA(se.placeholder)){const e=Array.from(se.element.cells),t=Array.from(se.placeholder.cells);se.getSavedCellWidths()||se.setSavedCellWidths(e.map(e=>e.style.width));for(const[n,r]of e.entries()){const e=t[n];r.style.width=`${e.getBoundingClientRect().width}px`}}se.dragOperation.shape=new eL(se.feedbackElement)}));var se;const le=new eL(f);dE(()=>a.shape=le);const ue=OR(f),ce=e=>{this.manager.actions.stop({event:e})},de=UR(ue);W&&ue.addEventListener("resize",ce),"idle"===dE(()=>l.status)&&requestAnimationFrame(()=>l.status="dragging"),z&&(ae.observe(z),re=function(e,t,n){const r=new MutationObserver(r=>{let i=!1;for(const n of r){if(n.target!==e){i=!0;continue}if("attributes"!==n.type)continue;const r=n.attributeName;if(r.startsWith("aria-")||dA.includes(r))continue;const o=e.getAttribute(r);if("style"===r){if(tL(e)&&tL(t)){const n=e.style;for(const e of Array.from(t.style))""===n.getPropertyValue(e)&&t.style.removeProperty(e);for(const e of Array.from(n)){if(pA.includes(e)||e.startsWith(lA))continue;const r=n.getPropertyValue(e);t.style.setProperty(e,r)}}}else null!==o?t.setAttribute(r,o):t.removeAttribute(r)}i&&n&&(t.innerHTML=e.innerHTML)});return r.observe(e,{attributes:!0,subtree:!0,childList:!0}),r}(c,z,N),ie=function(e,t,n){const r=new MutationObserver(r=>{for(const i of r)if(0!==i.addedNodes.length)for(const r of Array.from(i.addedNodes)){if(r.contains(e)&&e.nextElementSibling!==t)return e.insertAdjacentElement("afterend",t),void DM(n);if(r.contains(t)&&t.previousElementSibling!==e)return t.insertAdjacentElement("beforebegin",e),void DM(n)}});return r.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),r}(c,z,f));const pe=null==(n=i.dragOperation.source)?void 0:n.id,fe=()=>{var e;if(!W||null==pe)return;const t=i.registry.draggables.get(pe),n=null!=(e=null==t?void 0:t.handle)?e:null==t?void 0:t.element;TR(n)&&n.focus()},he=()=>{var e;if(null==re||re.disconnect(),null==ie||ie.disconnect(),ae.disconnect(),ue.removeEventListener("resize",ce),IM(f)&&(f.removeEventListener("beforetoggle",gA),f.removeAttribute("popover")),f.removeAttribute(uA),E.reset(),oe&&vA(c)){const t=Array.from(c.cells);for(const[n,r]of t.entries())r.style.width=null!=(e=oe[n])?e:""}l.status="idle";const t=null!=r.current.translate;z&&(t||z.parentElement!==f.parentElement)&&f.isConnected&&z.replaceWith(f),null==z||z.remove()},me=null==o?void 0:o.dropAnimation,ge=this,ve=DI(()=>{var e;const{transform:t,status:n}=a;if((t.x||t.y||r.current.translate)&&n.dragging){const n=null!=(e=p.translate)?e:{x:0,y:0},i={x:t.x/h.scaleX+n.x,y:t.y/h.scaleY+n.y},o=r.current.translate,s=dE(()=>a.modifiers),l=dE(()=>{var e;return null==(e=a.shape)?void 0:e.current}),u=W&&!de?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(E.set({transition:`${I}, translate ${u}`,translate:`${i.x}px ${i.y}px 0`},lA),null==re||re.takeRecords(),l&&l!==le&&o&&!s.length){const e=XI.delta(i,o);a.shape=JI.from(l.boundingRectangle).translate(e.x*h.scaleX,e.y*h.scaleY)}else a.shape=new eL(f);r.current.translate=i}},function(){if(a.status.dropped){this.dispose(),l.status="dropping";const e=void 0!==ge.dropAnimation?ge.dropAnimation:me;let t=r.current.translate;const n=null!=t;if(t||c===f||(t={x:0,y:0}),!t||null===e)return void he();i.renderer.rendering.then(()=>{!function(e){var t,n,r,i;const{animation:o}=e;if("function"==typeof o){const t=o({element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});return void Promise.resolve(t).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)})}const{duration:a=IA,easing:s=DA}=null!=o?o:{};DM(e.feedbackElement);const[,l]=null!=(t=MR(e.feedbackElement,e=>"translate"in e))?t:[];null==l||l.pause();const u=null!=(n=e.placeholder)?n:e.element,c={frameTransform:mA(e.feedbackElement,u)?null:void 0},d=new eL(e.feedbackElement,c),p=null!=(r=WM(TM(e.feedbackElement).translate))?r:e.translate,f=new eL(u,c),h=JI.delta(d,f,e.alignment),m=p.x-h.x,g=p.y-h.y,v=Math.round(d.intrinsicHeight)!==Math.round(f.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`]}:{},y=Math.round(d.intrinsicWidth)!==Math.round(f.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},lA),e.feedbackElement.setAttribute(sA,""),null==(i=e.getElementMutationObserver())||i.takeRecords(),YM({element:e.feedbackElement,keyframes:SL(xL(xL({},v),y),{translate:[`${p.x}px ${p.y}px 0`,`${m}px ${g}px 0`]}),options:{duration:UR(OR(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?a:0,easing:s}}).then(()=>{e.feedbackElement.removeAttribute(sA),null==l||l.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}({element:c,feedbackElement:f,placeholder:z,translate:t,moved:n,transition:I,alignment:l.alignment,styles:E,animation:null!=e?e:void 0,getElementMutationObserver:()=>re,cleanup:he,restoreFocus:fe})})}});return()=>{he(),ve()}},LL(xA,4,"overlay",yA,PA,SA),RL(xA,PA),PA.configure=ND(PA);var RA,MA,LA,AA,kA,OA,qA,TA=PA,NA=!0;LA=[CI],AA=VM.Forward,RA=[CI],MA=VM.Reverse;var _A=class{constructor(){qL(this,OA,ML(kA,8,this,NA)),ML(kA,11,this),qL(this,qA,ML(kA,12,this,NA)),ML(kA,15,this)}isLocked(e){return e!==VM.Idle&&(null==e?this[VM.Forward]===NA&&this[VM.Reverse]===NA:this[e]===NA)}unlock(e){e!==VM.Idle&&(this[e]=false)}};kA=EL(null),OA=new WeakMap,qA=new WeakMap,LL(kA,4,AA,LA,_A,OA),LL(kA,4,MA,RA,_A,qA),RL(kA,_A);var jA,FA,zA,WA,$A,VA,HA=[VM.Forward,VM.Reverse],BA=class{constructor(){this.x=new _A,this.y=new _A}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},GA=class extends jD{constructor(e){super(e);const t=SE(new BA);let n=null;this.signal=t,AE(()=>{const{status:r}=e.dragOperation;if(!r.initialized)return n=null,void(t.value=new BA);const{delta:i}=e.dragOperation.position;if(n){const e={x:UA(i.x,n.x),y:UA(i.y,n.y)},r=t.peek();uE(()=>{for(const t of aD)for(const n of HA)e[t]===n&&r[t].unlock(n);t.value=r})}n=i})}get current(){return this.signal.peek()}};function UA(e,t){return Math.sign(e-t)}var YA=class extends(FA=zD,jA=[CI],FA){constructor(e){super(e),qL(this,WA,ML(zA,8,this,!1)),ML(zA,11,this),qL(this,$A),qL(this,VA,()=>{if(!OL(this,$A))return;const{element:e,by:t}=OL(this,$A);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)}),this.scroll=e=>{var t;if(this.disabled)return!1;const n=this.getScrollableElements();if(!n)return TL(this,$A,void 0),!1;const{position:r}=this.manager.dragOperation,i=null==r?void 0:r.current;if(i){const{by:r}=null!=e?e:{},o=r?{x:KA(r.x),y:KA(r.y)}:void 0,a=o?void 0:this.scrollIntentTracker.current;if(null==a?void 0:a.isLocked())return!1;for(const e of n){const n=MM(e,r);if(n.x||n.y){const{speed:n,direction:s}=GM(e,i,o);if(a)for(const e of aD)a[e].isLocked(s[e])&&(n[e]=0,s[e]=0);if(s.x||s.y){const{x:i,y:o}=null!=r?r:s,a=i*n.x,l=o*n.y;if(a||l){const n=null==(t=OL(this,$A))?void 0:t.by;if(this.autoScrolling&&n){if(n.x&&!a||n.y&&!l)continue}return TL(this,$A,{element:e,by:{x:a,y:l}}),AM.schedule(OL(this,VA)),!0}}}}}return TL(this,$A,void 0),!1};let t=null,n=null;const r=SI(()=>{const{position:n,source:r}=e.dragOperation;if(!n)return null;const i=XR(GR(null==r?void 0:r.element),n.current);return i&&(t=i),null!=i?i:t}),i=SI(()=>{const t=r.value,{documentElement:i}=_R(t);if(!t||t===i){const{target:t}=e.dragOperation,r=null==t?void 0:t.element;if(r){const e=jM(r,{excludeElement:!1});return n=e,e}}if(t){const e=jM(t,{excludeElement:!1});return this.autoScrolling&&n&&e.size<(null==n?void 0:n.size)?n:(n=e,e)}return n=null,null},wI);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new GA(e),this.destroy=e.monitor.addEventListener("dragmove",t=>{!this.disabled&&!t.defaultPrevented&&iL(e.dragOperation.activatorEvent)&&t.by&&this.scroll({by:t.by})&&t.preventDefault()})}};function KA(e){return e>0?VM.Forward:e<0?VM.Reverse:VM.Idle}zA=EL(FA),WA=new WeakMap,$A=new WeakMap,VA=new WeakMap,LL(zA,4,"autoScrolling",jA,YA,WA),RL(zA,YA);var XA,JA=new class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}}(e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()}),ZA=class extends jD{constructor(e,t){super(e);const n=e.registry.plugins.get(YA);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=AE(()=>{if(this.disabled)return;const{position:t,status:r}=e.dragOperation;if(r.dragging){if(n.scroll()){n.autoScrolling=!0;const e=setInterval(()=>JA.schedule(n.scroll),10);return()=>{clearInterval(e)}}n.autoScrolling=!1}})}},QA={capture:!0,passive:!0},ek=class extends zD{constructor(e){super(e),qL(this,XA),this.handleScroll=()=>{null==OL(this,XA)&&TL(this,XA,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),TL(this,XA,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=AE(()=>{var e,n,r;if(t.status.dragging){const i=null!=(r=null==(n=null==(e=t.source)?void 0:e.element)?void 0:n.ownerDocument)?r:document;return i.addEventListener("scroll",this.handleScroll,QA),()=>{i.removeEventListener("scroll",this.handleScroll,QA)}}})}};XA=new WeakMap;function tk(){var e;null==(e=document.getSelection())||e.removeAllRanges()}var nk,rk=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;const r=null!=(n=t.handle)?n:t.element;return e.target!==r}}),ik=class extends YP{constructor(e,t){super(e),this.manager=e,this.options=t,qL(this,nk,[]),this.listeners=new ZR,this.handleSourceKeyDown=(e,t,n)=>{if(this.disabled||e.defaultPrevented)return;if(!rL(e.target))return;if(t.disabled)return;const{keyboardCodes:r=rk.keyboardCodes,preventActivation:i=rk.preventActivation}=null!=n?n:{};r.start.includes(e.code)&&this.manager.dragOperation.status.idle&&((null==i?void 0:i(e,t))||this.handleStart(e,t,n))}}bind(e,t=this.options){const n=AE(()=>{var n;const r=null!=(n=e.handle)?n:e.element,i=n=>{iL(n)&&this.handleSourceKeyDown(n,e,t)};if(r)return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}});return n}handleStart(e,t,n){const{element:r}=t;if(!r)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),UM(r);const{center:i}=new eL(r);if(this.manager.actions.start({event:e,coordinates:{x:i.x,y:i.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();const o=_R(r),a=[this.listeners.bind(o,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,n),options:{capture:!0}}])];OL(this,nk).push(...a)}handleKeyDown(e,t,n){const{keyboardCodes:r=rk.keyboardCodes}=null!=n?n:{};if(sk(e,[...r.end,...r.cancel])){e.preventDefault();const t=sk(e,r.cancel);return void this.handleEnd(e,t)}sk(e,r.up)?this.handleMove("up",e):sk(e,r.down)&&this.handleMove("down",e),sk(e,r.left)?this.handleMove("left",e):sk(e,r.right)&&this.handleMove("right",e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){var n,r;const{shape:i}=this.manager.dragOperation,o=t.shiftKey?5:1;let a={x:0,y:0},s=null!=(r=null==(n=this.options)?void 0:n.offset)?r:rk.offset;if("number"==typeof s&&(s={x:s,y:s}),i){switch(e){case"up":a={x:0,y:-s.y*o};break;case"down":a={x:0,y:s.y*o};break;case"left":a={x:-s.x*o,y:0};break;case"right":a={x:s.x*o,y:0}}(a.x||a.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:a}))}}sideEffects(){const e=this.manager.registry.plugins.get(ZA);!1===(null==e?void 0:e.disabled)&&(e.disable(),OL(this,nk).push(()=>{e.enable()}))}cleanup(){OL(this,nk).forEach(e=>e()),TL(this,nk,[])}destroy(){this.cleanup(),this.listeners.clear()}};nk=new WeakMap,ik.configure=ND(ik),ik.defaults=rk;var ok,ak=ik;function sk(e,t){return t.includes(e.code)}var lk,uk;ok=new WeakMap;lk=new WeakMap,uk=new WeakMap;var ck=class{};ck.Delay=class extends XP{constructor(){super(...arguments),qL(this,lk),qL(this,uk)}onEvent(e){switch(e.type){case"pointerdown":TL(this,uk,zR(e)),TL(this,lk,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!OL(this,uk))return;const{x:t,y:n}=zR(e);eD({x:t-OL(this,uk).x,y:n-OL(this,uk).y},this.options.tolerance)&&this.abort();break;case"pointerup":this.abort()}}abort(){OL(this,lk)&&(clearTimeout(OL(this,lk)),TL(this,uk,void 0),TL(this,lk,void 0))}},ck.Distance=class extends XP{constructor(){super(...arguments),qL(this,ok)}onEvent(e){switch(e.type){case"pointerdown":TL(this,ok,zR(e));break;case"pointermove":if(!OL(this,ok))return;const{x:t,y:n}=zR(e),r={x:t-OL(this,ok).x,y:n-OL(this,ok).y},{tolerance:i}=this.options;if(i&&eD(r,i))return void this.abort();eD(r,this.options.value)&&this.activate(e);break;case"pointerup":this.abort()}}abort(){TL(this,ok,void 0)}};var dk,pk=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if("mouse"!==r||!rL(i)||t.handle!==i&&!(null==(n=t.handle)?void 0:n.contains(i)))return"touch"===r?[new ck.Delay({value:250,tolerance:5})]:function(e){if(!rL(e))return!1;const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||(n=e).hasAttribute("contenteditable")&&"false"!==n.getAttribute("contenteditable");var n}(i)&&!e.defaultPrevented?[new ck.Delay({value:200,tolerance:0})]:[new ck.Delay({value:200,tolerance:10}),new ck.Distance({value:5})]},preventActivation(e,t){var n;const{target:r}=e;return r!==t.element&&(r!==t.handle&&(!!rL(r)&&(!(null==(n=t.handle)?void 0:n.contains(r))&&Boolean(r.closest('\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n a[href],\n [contenteditable]:not([contenteditable="false"])\n ')))))}}),fk=class extends YP{constructor(e,t){super(e),this.manager=e,this.options=t,qL(this,dk,new Set),this.listeners=new ZR,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:e,coordinates:t}=this.latest;e&&t&&this.manager.actions.move({event:e,to:t})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,t,n=this.options){const{activationConstraints:r=pk.activationConstraints}=null!=n?n:{};return"function"==typeof r?r(e,t):r}bind(e,t=this.options){const n=AE(()=>{var n;const r=new AbortController,{signal:i}=r,o=n=>{(function(e){if(!e)return!1;const{PointerEvent:t}=OR(e.target);return e instanceof t})(n)&&this.handlePointerDown(n,e,t)};let a=[null!=(n=e.handle)?n:e.element];(null==t?void 0:t.activatorElements)&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(const e of a)e&&(yk(e.ownerDocument.defaultView),e.addEventListener("pointerdown",o,{signal:i}));return()=>r.abort()});return n}handlePointerDown(e,t,n){if(this.disabled||!e.isPrimary||0!==e.button||!rL(e.target)||t.disabled||function(e){return"sensor"in e}(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:r=pk.preventActivation}=null!=n?n:{};if(null==r?void 0:r(e,t))return;const{target:i}=e,o=TR(i)&&i.draggable&&"true"===i.getAttribute("draggable"),a=FM(t.element),{x:s,y:l}=zR(e);this.initialCoordinates={x:s*a.scaleX+a.x,y:l*a.scaleY+a.y};const u=this.activationConstraints(e,t,n);e.sensor=this;const c=new KP(u,e=>this.handleStart(t,e));c.signal.onabort=()=>this.handleCancel(e),c.onEvent(e),this.controller=c;const d=$R(),p=this.listeners.bind(d,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:o?this.handleCancel:mk,options:{capture:!0}}]);OL(this,dk).add(()=>{p(),this.initialCoordinates=void 0})}handlePointerMove(e,t){var n,r;if(!1!==(null==(n=this.controller)?void 0:n.activated)){if(this.manager.dragOperation.status.dragging){const n=zR(e),r=FM(t.element);n.x=n.x*r.scaleX+r.x,n.y=n.y*r.scaleY+r.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=n,AM.schedule(this.handleMove)}}else null==(r=this.controller)||r.onEvent(e)}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();const n=!t.initialized;this.manager.actions.stop({event:e,canceled:n})}this.cleanup()}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){const{manager:n,initialCoordinates:r}=this;if(!r||!n.dragOperation.status.idle)return;if(t.defaultPrevented)return;if(n.actions.start({coordinates:r,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();const i=_R(t.target).body;i.setPointerCapture(t.pointerId);const o=rL(t.target)?[t.target,i]:i,a=this.listeners.bind(o,[{type:"touchmove",listener:mk,options:{passive:!1}},{type:"click",listener:mk},{type:"contextmenu",listener:mk},{type:"keydown",listener:this.handleKeyDown}]);OL(this,dk).add(a)}handleCancel(e){const{dragOperation:t}=this.manager;t.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},OL(this,dk).forEach(e=>e()),OL(this,dk).clear()}destroy(){this.cleanup(),this.listeners.clear()}};dk=new WeakMap,fk.configure=ND(fk),fk.defaults=pk;var hk=fk;function mk(e){e.preventDefault()}function gk(){}var vk=new WeakSet;function yk(e){e&&!vk.has(e)&&(e.addEventListener("touchmove",gk,{capture:!1,passive:!1}),vk.add(e))}var bk,xk,Sk,wk,Ck,Ek,Ik,Dk,Pk,Rk,Mk,Lk,Ak,kk,Ok,qk,Tk,Nk,_k={modifiers:[],plugins:[class extends jD{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=FL,announcement:i=zL}={},announcements:o=$L,screenReaderInstructions:a=WL,debounce:s=500}=null!=t?t:{},l=n?`${r}-${n}`:aL(r),u=n?`${i}-${n}`:aL(i);let c,d,p,f;const h=(e=f)=>{p&&e&&(null==p?void 0:p.nodeValue)!==e&&(p.nodeValue=e)},m=()=>AM.schedule(h),g=function(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}(m,s),v=Object.entries(o).map(([e,t])=>this.manager.monitor.addEventListener(e,(n,r)=>{const i=p;if(!i)return;const o=null==t?void 0:t(n,r);o&&i.nodeValue!==o&&(f=o,HL.includes(e)?g():(m(),g.cancel()))})),y=()=>{let e=[];(null==c?void 0:c.isConnected)||(c=function(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}(l,a.draggable),e.push(c)),(null==d?void 0:d.isConnected)||(d=function(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}(u),p=document.createTextNode(""),d.appendChild(p),e.push(d)),e.length>0&&document.body.append(...e)},b=new Set;function x(){for(const e of b)e()}this.registerEffect(()=>{var e;b.clear();for(const t of this.manager.registry.draggables.value){const n=null!=(e=t.handle)?e:t.element;if(n){c&&d||b.add(y),VL(n)&&!VR()||n.hasAttribute("tabindex")||b.add(()=>n.setAttribute("tabindex","0")),n.hasAttribute("role")||"button"===n.tagName.toLowerCase()||b.add(()=>n.setAttribute("role",_L)),n.hasAttribute("aria-roledescription")||b.add(()=>n.setAttribute("aria-roledescription",jL)),n.hasAttribute("aria-describedby")||b.add(()=>n.setAttribute("aria-describedby",l));for(const e of["aria-pressed","aria-grabbed"]){const r=String(t.isDragging);n.getAttribute(e)!==r&&b.add(()=>n.setAttribute(e,r))}const e=String(t.disabled);n.getAttribute("aria-disabled")!==e&&b.add(()=>n.setAttribute("aria-disabled",e))}}b.size>0&&AM.schedule(x)}),this.destroy=()=>{super.destroy(),null==c||c.remove(),null==d||d.remove(),v.forEach(e=>e())}}},ZA,class extends jD{constructor(e,t){super(e,t),this.manager=e;const n=SI(()=>{var e;return _R(null==(e=this.manager.dragOperation.source)?void 0:e.element)});this.destroy=AE(()=>{var e;const{dragOperation:t}=this.manager,{cursor:r="grabbing",nonce:i}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=n.value,t=e.createElement("style");return i&&t.setAttribute("nonce",i),t.textContent=`* { cursor: ${r} !important; }`,e.head.appendChild(t),()=>t.remove()}})}},TA,class extends jD{constructor(e,t){super(e,t),this.manager=e,this.destroy=AE(()=>{var e;const{dragOperation:t}=this.manager,{nonce:n}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(e),tk(),document.addEventListener("selectionchange",tk,{capture:!0}),()=>{document.removeEventListener("selectionchange",tk,{capture:!0}),e.remove()}}})}}],sensors:[hk,ak]},jk=class extends SR{constructor(e={}){const t=xR(e.plugins,_k.plugins),n=xR(e.sensors,_k.sensors),r=xR(e.modifiers,_k.modifiers);super(SL(xL({},e),{plugins:[ek,YA,oA,...t],sensors:n,modifiers:r}))}},Fk=class extends(wk=BP,Sk=[CI],xk=[CI],bk=[CI],wk){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:o,feedback:a="default"}=n,s=CL(n,["element","effects","handle","feedback"]);super(xL({effects:()=>[...i(),()=>{var e,t;const{manager:n}=this;if(!n)return;const r=(null!=(t=null==(e=this.sensors)?void 0:e.map(_D))?t:[...n.sensors]).map(e=>{const t=e instanceof YP?e:n.registry.register(e.plugin),r=e instanceof YP?void 0:e.options;return t.bind(this,r)});return function(){r.forEach(e=>e())}}]},s),t),qL(this,Ek,ML(Ck,8,this)),ML(Ck,11,this),qL(this,Ik,ML(Ck,12,this)),ML(Ck,15,this),qL(this,Dk,ML(Ck,16,this)),ML(Ck,19,this),this.element=r,this.handle=o,this.feedback=a}};Ck=EL(wk),Ek=new WeakMap,Ik=new WeakMap,Dk=new WeakMap,LL(Ck,4,"handle",Sk,Fk,Ek),LL(Ck,4,"element",xk,Fk,Ik),LL(Ck,4,"feedback",bk,Fk,Dk),RL(Ck,Fk);var zk=class extends(Mk=GP,Rk=[CI],Pk=[CI],Mk){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,o=CL(n,["element","effects"]);const{collisionDetector:a=sL}=o,s=e=>{const{manager:t,element:n}=this;if(!n||null===e)return void(this.shape=void 0);if(!t)return;const r=new eL(n),i=dE(()=>this.shape);return r&&(null==i?void 0:i.equals(r))?i:(this.shape=r,r)},l=SE(!1);super(SL(xL({},o),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:n}=t,{source:r}=n;l.value=Boolean(r&&n.status.initialized&&e&&!this.disabled&&this.accepts(r))},()=>{const{element:e}=this;if(l.value&&e){const t=new EM(e,s);return()=>{t.disconnect(),this.shape=void 0}}},()=>{var e;if(null==(e=this.manager)?void 0:e.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),qL(this,Tk),qL(this,Ak,ML(Lk,8,this)),ML(Lk,11,this),qL(this,Nk,ML(Lk,12,this)),ML(Lk,15,this),this.element=r,this.refreshShape=()=>s()}set element(e){TL(this,Tk,e,qk)}get element(){var e;return null!=(e=this.proxy)?e:OL(this,Tk,Ok)}};function Wk(e){var t;if(null!=e)return function(e){return null!=e&&"object"==typeof e&&"current"in e}(e)?null!=(t=e.current)?t:void 0:e}Lk=EL(Mk),Ak=new WeakMap,Tk=new WeakSet,Nk=new WeakMap,kk=LL(Lk,20,"#element",Rk,Tk,Ak),Ok=kk.get,qk=kk.set,LL(Lk,4,"proxy",Pk,zk,Nk),RL(Lk,zk);var $k="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?g:d;function Vk(){const e=m(0)[1];return f(()=>{e(e=>e+1)},[e])}function Hk(e,t=[],n=!1){const r=l(e);return r.current=e,function(e,t=!1){const n=l(e.peek()),r=l(!1),i=Vk();return $k(()=>AE(()=>{const o=n.current,a=e.value;if(o!==a){if(n.current=a,!r.current)return;t?D(i):i()}}),[e,t,i]),{get value(){return r.current=!0,e.peek()}}}(v(()=>SI(()=>r.current()),t),n)}function Bk(e,t){const n=l(new Map),r=Vk();return $k(()=>{if(e)return AE(()=>{var i;let o=!1,a=!1;for(const r of n.current){const[s]=r,l=dE(()=>r[1]),u=e[s];l!==u&&(o=!0,n.current.set(s,u),a=null!=(i=null==t?void 0:t(s,l,u))&&i)}o&&(a?D(r):r())});n.current.clear()},[e]),v(()=>e?new Proxy(e,{get(e,t){const r=e[t];return n.current.set(t,r),r}}):e,[e])}function Gk(e,t){e()}function Uk(e){const t=l(e);return $k(()=>{t.current=e},[e]),t}function Yk(e,t,n=d,r=Object.is){const i=l(e);n(()=>{const n=i.current;r(e,n)||(i.current=e,t(e,n))},[t,e])}function Kk(e,t){const n=l(Wk(e));$k(()=>{const r=Wk(e);r!==n.current&&(n.current=r,t(r))})}var Xk=Object.defineProperty,Jk=Object.defineProperties,Zk=Object.getOwnPropertyDescriptors,Qk=Object.getOwnPropertySymbols,eO=Object.prototype.hasOwnProperty,tO=Object.prototype.propertyIsEnumerable,nO=(e,t,n)=>t in e?Xk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rO=new jk,iO=u(rO),oO=b(x(({children:e},t)=>{const[n,r]=m(0),i=l(null),o=l(null),a=v(()=>({renderer:{get rendering(){var e;return null!=(e=i.current)?e:Promise.resolve()}},trackRendering(e){i.current||(i.current=new Promise(e=>{o.current=e})),S(()=>{e(),r(e=>e+1)})}}),[]);return $k(()=>{var e;null==(e=o.current)||e.call(o),i.current=null},[e,n]),w(t,()=>a),null})),aO=[void 0,wI];function sO(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:o,onDragMove:a,onDragOver:s,onDragEnd:u}=t,c=((e,t)=>{var n={};for(var r in e)eO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Qk)for(var r of Qk(e))t.indexOf(r)<0&&tO.call(e,r)&&(n[r]=e[r]);return n})(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const p=l(null),{plugins:f,modifiers:h,sensors:m}=c,g=xR(f,_k.plugins),v=xR(m,_k.sensors),b=xR(h,_k.modifiers),x=Uk(i),S=Uk(o),w=Uk(s),C=Uk(a),E=Uk(u),I=Uk(r),D=function(e){const t=l(null);t.current||(t.current=e());return y(()=>()=>{var e;return null==(e=t.current)?void 0:e.destroy()},[]),t.current}(()=>{var e;return null!=(e=c.manager)?e:new jk(c)});return d(()=>{if(!p.current)throw new Error("Renderer not found");const{renderer:e,trackRendering:t}=p.current,{monitor:n}=D;D.renderer=e;const r=[n.addEventListener("beforedragstart",e=>{const n=x.current;n&&t(()=>n(e,D))}),n.addEventListener("dragstart",e=>{var t;return null==(t=S.current)?void 0:t.call(S,e,D)}),n.addEventListener("dragover",e=>{const n=w.current;n&&t(()=>n(e,D))}),n.addEventListener("dragmove",e=>{const n=C.current;n&&t(()=>n(e,D))}),n.addEventListener("dragend",e=>{const n=E.current;n&&t(()=>n(e,D))}),n.addEventListener("collision",e=>{var t;return null==(t=I.current)?void 0:t.call(I,e,D)})];return()=>r.forEach(e=>e())},[D]),Yk(g,()=>D&&(D.plugins=g),...aO),Yk(v,()=>D&&(D.sensors=v),...aO),Yk(b,()=>D&&(D.modifiers=b),...aO),io.jsxs(iO.Provider,{value:D,children:[io.jsx(oO,{ref:p,children:n}),n]})}function lO(){return h(iO)}function uO(e){var t;const n=null!=(t=lO())?t:void 0,[r]=m(()=>e(n));return r.manager!==n&&(r.manager=n),$k(r.register,[n,r]),r}function cO({children:e,className:t,dropAnimation:n,style:i,tag:o,disabled:a}){var s;const u=l(null),c=lO(),p=null!=(s=Hk(()=>null==c?void 0:c.dragOperation.source,[c]).value)?s:null,f="function"==typeof a?a(p):a;d(()=>{if(!u.current||!c||f)return;const e=c.plugins.find(e=>e instanceof TA);return e?(e.overlay=u.current,()=>{e.overlay=void 0}):void 0},[c,f]),d(()=>{if(!c)return;const e=c.plugins.find(e=>e instanceof TA);return e?(e.dropAnimation=n,()=>{e.dropAnimation=void 0}):void 0},[c,n]);const h=v(()=>{if(!c)return null;const e=new Proxy(c.registry,{get:(e,t)=>"register"===t||"unregister"===t?dO:e[t]});return new Proxy(c,{get:(t,n)=>"registry"===n?e:t[n]})},[c]);return io.jsx(iO.Provider,{value:h,children:r(o||"div",{ref:u,className:t,style:i,"data-dnd-overlay":!0},function(){if(!p||f)return null;if("function"==typeof e)return io.jsx(pO,{source:p,children:e});return e}())})}function dO(){return()=>{}}function pO({children:e,source:t}){return e(Bk(t))}var fO,hO,mO,gO,vO,yO=Object.create,bO=Object.defineProperty,xO=Object.getOwnPropertyDescriptor,SO=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wO=e=>{throw TypeError(e)},CO=["class","method","getter","setter","accessor","field","value","get","set"],EO=e=>void 0!==e&&"function"!=typeof e?wO("Function expected"):e,IO=(e,t,n,r,i)=>({kind:CO[e],name:t,metadata:r,addInitializer:e=>n._?wO("Already initialized"):i.push(EO(e||null))}),DO=(e,t,n,r,i,o)=>{for(var a,s,l,u,c=7&t,d=CO[c+5],p=e[2]||(e[2]=[]),f=(i=i.prototype,xO(i,n)),h=r.length-1;h>=0;h--)(l=IO(c,n,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>n in e},u.get=e=>e[n],a=(0,r[h])(f[d],l),s._=1,EO(a)&&(f[d]=a);return f&&bO(i,n,f),i},PO=(e,t,n)=>t.has(e)||wO("Cannot "+n),RO=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},MO=class extends(mO=RI,hO=[EI],fO=[EI],mO){constructor(e){var t,n,r;super(RO.from(e),(e,t)=>RO.equals(e,t)),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(vO,5,this),t=this,r=0,(n=gO).has(t)?wO("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),this.velocity={x:0,y:0}}get delta(){return RO.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=RO.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(PO(a=this,s=gO,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);uE(()=>{((e,t,n)=>{PO(e,t,"write to private field"),t.set(e,n)})(this,gO,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(RO.from(e)),this.velocity={x:0,y:0}}};vO=(e=>{var t;return[,,,yO(null!=(t=null==e?void 0:e[SO("metadata")])?t:null)]})(mO),gO=new WeakMap,DO(vO,2,"delta",hO,MO),DO(vO,2,"direction",fO,MO),((e,t)=>{((e,t,n)=>{t in e?bO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(t,SO("metadata"),e[3])})(vO,MO);var LO=(e=>(e.Horizontal="x",e.Vertical="y",e))(LO||{});Object.values(LO);var AO=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/RO.distance(t.shape.center,n),type:sP.PointerIntersection,priority:aP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=RO.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:sP.ShapeIntersection,priority:aP.Normal}}return null})(e)};function kO(e){const{collisionDetector:t,data:n,disabled:r,element:i,id:o,accept:a,type:s}=e,l=uO(t=>new zk(((e,t)=>Jk(e,Zk(t)))(((e,t)=>{for(var n in t||(t={}))eO.call(t,n)&&nO(e,n,t[n]);if(Qk)for(var n of Qk(t))tO.call(t,n)&&nO(e,n,t[n]);return e})({},e),{register:!1,element:Wk(i)}),t)),u=Bk(l);return Yk(o,()=>l.id=o),Kk(i,e=>l.element=e),Yk(a,()=>l.accept=a,void 0,wI),Yk(t,()=>l.collisionDetector=null!=t?t:AO),Yk(n,()=>n&&(l.data=n)),Yk(r,()=>l.disabled=!0===r),Yk(s,()=>l.type=s),{droppable:u,get isDropTarget(){return u.isDropTarget},ref:f(e=>{var t,n;(e||!(null==(t=l.element)?void 0:t.isConnected)||(null==(n=l.manager)?void 0:n.dragOperation.status.idle))&&(l.element=null!=e?e:void 0)},[l])}}const OO=e=>Array.from({length:e},(e,t)=>t),qO=({id:e,sectionIndex:t,itemIndex:n})=>io.jsx("span",{children:`${e}-${t}-${n}`}),TO=n.memo(()=>{const e=Dw(ZC)??qO,{startSectionIndex:t,startIndex:n,id:r}=Dw(nE)??{};return"number"!=typeof t||"number"!=typeof n||void 0===r?null:io.jsx(cO,{dropAnimation:null,children:io.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px",background:"white",boxShadow:"0px 4px 10px 0px rgba(0, 0, 0, 0.15)",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.15)",width:"208px",maxHeight:"32px",fontSize:"12px",lineHeight:"16px"},children:io.jsx(e,{id:r,sectionIndex:t,itemIndex:n})})})}),NO=({sectionIndex:e,itemIndex:t,isDragging:n})=>{const r=Dw(nE),i=r?.toSectionIndex===e,o=r?.startSectionIndex===e,a=t>(r?.startIndex??t)&&e===r?.startSectionIndex?t-1:t;let s=!1;return o&&r.startIndex===a?s=!1:i&&r.toIndex===a&&(s=!0),io.jsx("div",{"data-key":"drop-target-indicator",style:{visibility:s&&!n?"visible":"hidden",padding:0,background:"rgba(64, 64, 64, 1)",borderRadius:2,marginLeft:"4px",width:"calc(100% - 8px)",height:"2px"}})},_O=(e,t)=>e?"2px solid rgba(0, 135, 61, 1)":t?"1px dashed rgba(0, 0, 0, 0.43)":void 0,jO=n.memo(({sectionIndex:e})=>{const t=Dw(BC)[e],n=Dw(GC),r=Dw(UC),i=null!==Dw(nE),o=r(e),a=n({sectionIndex:e}),{ref:s,isDropTarget:l}=kO({id:a,type:"section",accept:"item",collisionPriority:aP.Low,data:{id:a,sectionIndex:e,sectionKey:a}});return t>0?null:io.jsxs(Qu,{ref:s,sx:{margin:"4px",outline:_O(l,i),borderRadius:"4px",boxSizing:"border-box"},children:[io.jsx(Qu,{sx:{position:"relative",top:"4px"},children:io.jsx(NO,{sectionIndex:e,itemIndex:0,isDragging:!1})}),io.jsxs(Qu,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"20px 4px"},children:[io.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"600",fontSize:"14px",lineHeight:"16px",color:"rgba(64, 64, 64, 1)"},children:o.title}),io.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontSize:"12px",lineHeight:"150%",color:"rgba(64, 64, 64, 1)"},children:o.message})]})]})}),FO=n.memo(({id:e,sectionIndex:t})=>{const n=Dw(JC);return void 0===n?null:io.jsx(n,{id:e,sectionIndex:t})});var zO=Object.defineProperty,WO=Object.defineProperties,$O=Object.getOwnPropertyDescriptors,VO=Object.getOwnPropertySymbols,HO=Object.prototype.hasOwnProperty,BO=Object.prototype.propertyIsEnumerable,GO=(e,t,n)=>t in e?zO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UO=(e,t)=>{for(var n in t||(t={}))HO.call(t,n)&&GO(e,n,t[n]);if(VO)for(var n of VO(t))BO.call(t,n)&&GO(e,n,t[n]);return e},YO=(e,t)=>WO(e,$O(t)),KO=class extends gR{apply({transform:e}){if(!this.options)return e;const{axis:t,value:n}=this.options;return YO(UO({},e),{[t]:n})}};KO.configure=ND(KO);var XO=KO,JO=XO.configure({axis:"x",value:0});XO.configure({axis:"y",value:0});var ZO=class extends gR{apply({transform:e}){var t;const{size:n=20}=null!=(t=this.options)?t:{},r="number"==typeof n?n:n.x,i="number"==typeof n?n:n.y;return YO(UO({},e),{x:Math.ceil(e.x/r)*r,y:Math.ceil(e.y/i)*i})}};ZO.configure=ND(ZO);var QO=Object.create,eq=Object.defineProperty,tq=Object.defineProperties,nq=Object.getOwnPropertyDescriptor,rq=Object.getOwnPropertyDescriptors,iq=Object.getOwnPropertySymbols,oq=Object.prototype.hasOwnProperty,aq=Object.prototype.propertyIsEnumerable,sq=e=>{throw TypeError(e)},lq=(e,t,n)=>t in e?eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uq=(e,t)=>{for(var n in t||(t={}))oq.call(t,n)&&lq(e,n,t[n]);if(iq)for(var n of iq(t))aq.call(t,n)&&lq(e,n,t[n]);return e},cq=(e,t)=>tq(e,rq(t)),dq=["class","method","getter","setter","accessor","field","value","get","set"],pq=e=>void 0!==e&&"function"!=typeof e?sq("Function expected"):e,fq=(e,t,n,r,i)=>({kind:dq[e],name:t,metadata:r,addInitializer:e=>n._?sq("Already initialized"):i.push(pq(e||null))}),hq=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},mq=(e,t,n,r,i,o)=>{for(var a,s,l,u,c,d=7&t,p=e.length+1,f=dq[d+5],h=e[p-1]=[],m=e[p]||(e[p]=[]),g=(i=i.prototype,nq({get[n](){return vq(this,o)},set[n](e){return bq(this,o,e)}},n)),v=r.length-1;v>=0;v--)(u=fq(d,n,l={},e[3],m)).static=false,u.private=false,c=u.access={has:e=>n in e},c.get=e=>e[n],c.set=(e,t)=>e[n]=t,s=(0,r[v])({get:g.get,set:g.set},u),l._=1,void 0===s?pq(s)&&(g[f]=s):"object"!=typeof s||null===s?sq("Object expected"):(pq(a=s.get)&&(g.get=a),pq(a=s.set)&&(g.set=a),pq(a=s.init)&&h.unshift(a));return g&&eq(i,n,g),i},gq=(e,t,n)=>t.has(e)||sq("Cannot "+n),vq=(e,t,n)=>(gq(e,t,"read from private field"),t.get(e)),yq=(e,t,n)=>t.has(e)?sq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bq=(e,t,n,r)=>(gq(e,t,"write to private field"),t.set(e,n),n);function xq(e){return e instanceof Jq||e instanceof Xq}var Sq=class extends jD{constructor(e){super(e);const t=AE(()=>{const{dragOperation:t}=e;if(iL(t.activatorEvent)&&xq(t.source)&&t.status.initialized){const t=e.registry.plugins.get(YA);if(t)return t.disable(),()=>t.enable()}}),n=e.monitor.addEventListener("dragmove",(e,t)=>{queueMicrotask(()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;const{dragOperation:n}=t;if(!iL(e.nativeEvent))return;if(!xq(n.source))return;if(!n.shape)return;const{actions:r,collisionObserver:i,registry:o}=t,{by:a}=e;if(!a)return;const s=function(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}(a),{source:l,target:u}=n,{center:c}=n.shape.current,d=[],p=[];uE(()=>{for(const e of o.droppables){const{id:t}=e;if(!e.accepts(l)||t===(null==u?void 0:u.id)&&xq(e)||!e.element)continue;let n=e.shape;const r=new eL(e.element,{getBoundingClientRect:e=>FR(e,void 0,.2)});r.height&&r.width&&(("down"==s&&c.y+10<r.center.y||"up"==s&&c.y-10>r.center.y||"left"==s&&c.x-10>r.center.x||"right"==s&&c.x+10<r.center.x)&&(d.push(e),e.shape=r,p.push(()=>e.shape=n)))}}),e.preventDefault(),i.disable();const f=i.computeCollisions(d,lL);uE(()=>p.forEach(e=>e()));const[h]=f;if(!h)return;const{id:m}=h,{index:g,group:v}=l.sortable;r.setDropTarget(m).then(()=>{const{source:e,target:t,shape:o}=n;if(!e||!xq(e)||!o)return;const{index:a,group:s,target:l}=e.sortable,u=g!==a||v!==s,c=u?l:null==t?void 0:t.element;if(!c)return;UM(c);const d=new eL(c);if(!d)return;const p=JI.delta(d,JI.from(o.current.boundingRectangle),e.alignment);r.move({by:p}),u?r.setDropTarget(e.id).then(()=>i.enable()):i.enable()})})});this.destroy=()=>{n(),t()}}};var wq=Object.defineProperty,Cq=Object.defineProperties,Eq=Object.getOwnPropertyDescriptors,Iq=Object.getOwnPropertySymbols,Dq=Object.prototype.hasOwnProperty,Pq=Object.prototype.propertyIsEnumerable,Rq=(e,t,n)=>t in e?wq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mq=(e,t)=>{for(var n in t||(t={}))Dq.call(t,n)&&Rq(e,n,t[n]);if(Iq)for(var n of Iq(t))Pq.call(t,n)&&Rq(e,n,t[n]);return e},Lq=(e,t)=>Cq(e,Eq(t));function Aq(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function kq(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function Oq(e,t){return function(e,t,n){var r,i,o;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const r=e.findIndex(e=>u(e,a.id)),i=e.findIndex(e=>u(e,s.id));if(-1===r||-1===i){if(kq(a)){const r=a.initialIndex,i=a.index;return r===i||r<0||r>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,r,i)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==r)return n(e,r,t)}return n(e,r,i)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&kq(a)){const r=a.initialGroup,i=a.initialIndex,o=a.group,s=a.index;if(null==r||null==o||!(r in e)||!(o in e))return"preventDefault"in t&&t.preventDefault(),e;if(r===o&&i===s)return"preventDefault"in t&&t.preventDefault(),e;if(r===o)return Lq(Mq({},e),{[r]:n(e[r],i,s)});const l=e[r][i];return Lq(Mq({},e),{[r]:[...e[r].slice(0,i),...e[r].slice(i+1)],[o]:[...e[o].slice(0,s),l,...e[o].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(i=null==(r=m.shape)?void 0:r.current.center)?i:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&kq(a)){const t=null!=a.group&&a.group!==d,r=a.index!==f;if(t||r){const t=null!=(o=a.group)?o:d;if(t in e){if(d===t)return Lq(Mq({},e),{[d]:n(e[d],f,a.index)});const r=e[d][f];return Lq(Mq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),r,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return Lq(Mq({},e),{[d]:n(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return Lq(Mq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,Aq)}var qq="__default__";function Tq(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function Nq(e,t){return e.index-t.index}function _q(e){return Array.from(e).sort(Nq)}var jq,Fq,zq,Wq,$q,Vq,Hq,Bq,Gq=[Sq,class extends jD{constructor(e){super(e);const t=()=>{const t=new Map;for(const n of e.registry.droppables)if(n instanceof Jq){const{sortable:e}=n,{group:r}=e;let i=t.get(r);i||(i=new Set,t.set(r,i)),i.add(e)}for(const[e,n]of t)t.set(e,new Set(_q(n)));return t},n=[e.monitor.addEventListener("dragover",(e,n)=>{if(this.disabled)return;const{dragOperation:r}=n,{source:i,target:o}=r;if(!xq(i)||!xq(o))return;if(i.sortable===o.sortable)return;const a=t(),s=i.sortable.group===o.sortable.group,l=a.get(i.sortable.group),u=s?l:a.get(o.sortable.group);l&&u&&queueMicrotask(()=>{e.defaultPrevented||n.renderer.rendering.then(()=>{var r,c,d;const p=t();for(const[e,t]of a.entries()){const n=Array.from(t).entries();for(const[t,i]of n)if(i.index!==t||i.group!==e||!(null==(r=p.get(e))?void 0:r.has(i)))return}const f=i.sortable.element,h=o.sortable.element;if(!h||!f)return;if(!s&&o.id===i.sortable.group)return;const m=_q(l),g=s?m:_q(u),v=null!=(c=i.sortable.group)?c:qq,y=null!=(d=o.sortable.group)?d:qq,b={[v]:m,[y]:g},x=Oq(b,e);if(b===x)return;const S=x[y].indexOf(i.sortable),w=x[y].indexOf(o.sortable);n.collisionObserver.disable(),Tq(f,S,h,w),uE(()=>{for(const[e,t]of x[v].entries())t.index=e;if(!s)for(const[e,t]of x[y].entries())t.group=o.sortable.group,t.index=e}),n.actions.setDropTarget(i.id).then(()=>n.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(e,n)=>{if(!e.canceled)return;const{dragOperation:r}=n,{source:i}=r;xq(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{const e=t(),r=e.get(i.sortable.initialGroup);r&&n.renderer.rendering.then(()=>{for(const[t,n]of e.entries()){const e=Array.from(n).entries();for(const[n,r]of e)if(r.index!==n||r.group!==t)return}const t=_q(r),n=i.sortable.element,o=t[i.sortable.initialIndex],a=null==o?void 0:o.element;o&&a&&n&&(Tq(n,o.index,a,i.index),uE(()=>{for(const[t,n]of e.entries()){const e=Array.from(n).values();for(const t of e)t.index=t.initialIndex,t.group=t.initialGroup}}))})}))})];this.destroy=()=>{for(const e of n)e()}}}],Uq={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Yq=new class{constructor(){yI(this,PI,new WeakMap)}get(e,t){var n;return e?null==(n=vI(this,PI).get(e))?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return vI(this,PI).has(e)||vI(this,PI).set(e,new Map),null==(r=vI(this,PI).get(e))?void 0:r.set(t,n)}clear(e){var t;return e?null==(t=vI(this,PI).get(e))?void 0:t.clear():void 0}};Fq=[CI],jq=[CI];var Kq=class{constructor(e,t){yq(this,Wq,hq(zq,8,this)),hq(zq,11,this),yq(this,$q),yq(this,Vq),yq(this,Hq,hq(zq,12,this)),hq(zq,15,this),yq(this,Bq),this.register=()=>(uE(()=>{var e,t;null==(e=this.manager)||e.registry.register(this.droppable),null==(t=this.manager)||t.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{uE(()=>{var e,t;null==(e=this.manager)||e.registry.unregister(this.droppable),null==(t=this.manager)||t.registry.unregister(this.draggable)})},this.destroy=()=>{uE(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:i,index:o,sensors:a,type:s,transition:l=Uq,plugins:u=Gq}=n,c=((e,t)=>{var n={};for(var r in e)oq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&iq)for(var r of iq(e))t.indexOf(r)<0&&aq.call(e,r)&&(n[r]=e[r]);return n})(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Jq(c,t,this),this.draggable=new Xq(cq(uq({},c),{effects:()=>[()=>{var e,t,n;const r=null==(e=this.manager)?void 0:e.dragOperation.status;(null==r?void 0:r.initializing)&&this.id===(null==(n=null==(t=this.manager)?void 0:t.dragOperation.source)?void 0:n.id)&&Yq.clear(this.manager),(null==r?void 0:r.dragging)&&Yq.set(this.manager,this.id,dE(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:e,group:t,manager:n}=this,r=vq(this,Vq),i=vq(this,$q);e===r&&t===i||(bq(this,Vq,e),bq(this,$q,t),this.animate())},()=>{const{target:e}=this,{feedback:t,isDragSource:n}=this.draggable;"move"==t&&n&&(this.droppable.disabled=!e)},()=>{const{manager:e}=this;for(const t of u)null==e||e.registry.register(t)},...r()],type:s,sensors:a}),t,this),bq(this,Bq,c.element),this.manager=t,this.index=o,bq(this,Vq,o),this.group=i,bq(this,$q,i),this.type=s,this.transition=l}get initialIndex(){var e,t;return null!=(t=null==(e=Yq.get(this.manager,this.id))?void 0:e.initialIndex)?t:this.index}get initialGroup(){var e,t;return null!=(t=null==(e=Yq.get(this.manager,this.id))?void 0:e.initialGroup)?t:this.group}animate(){dE(()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;n&&t&&(!r||t.idle)&&e.renderer.rendering.then(()=>{const{element:r}=this;if(!r)return;const i=this.refreshShape();if(!i)return;const o=n.boundingRectangle.left-i.boundingRectangle.left,a=n.boundingRectangle.top-i.boundingRectangle.top,{translate:s}=TM(r),l=KM(r,s,!1),u=KM(r,s);if(o||a){const n=UR(OR(r))?cq(uq({},t),{duration:0}):t;YM({element:r,keyframes:{translate:[`${l.x+o}px ${l.y+a}px ${l.z}`,`${u.x}px ${u.y}px ${u.z}`]},options:n}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){uE(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){uE(()=>{const t=vq(this,Bq),n=this.droppable.element,r=this.draggable.element;n&&n!==t||(this.droppable.element=e),r&&r!==t||(this.draggable.element=e),bq(this,Bq,e)})}get element(){var e,t;const n=vq(this,Bq);if(n)return null!=(t=null!=(e=JR.get(n))?e:n)?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){uE(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){uE(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){uE(()=>{this.droppable.id=e,this.draggable.id=e})}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=null!=e?e:sL}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){uE(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};zq=[,,,QO(null)],Wq=new WeakMap,$q=new WeakMap,Vq=new WeakMap,Hq=new WeakMap,Bq=new WeakMap,mq(zq,4,"index",Fq,Kq,Wq),mq(zq,4,"group",jq,Kq,Hq),((e,t)=>{return lq(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r})(zq,Kq);var Xq=class extends Fk{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},Jq=class extends zk{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}},Zq=Object.defineProperty,Qq=Object.defineProperties,eT=Object.getOwnPropertyDescriptors,tT=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,iT=(e,t,n)=>t in e?Zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oT=(e,t)=>{for(var n in t||(t={}))nT.call(t,n)&&iT(e,n,t[n]);if(tT)for(var n of tT(t))rT.call(t,n)&&iT(e,n,t[n]);return e};function aT(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:i,data:o,element:a,handle:s,index:l,group:u,disabled:c,feedback:d,modifiers:p,sensors:h,target:m,type:g}=e,v=oT(oT({},Uq),e.transition),y=uO(t=>new Kq(((e,t)=>Qq(e,eT(t)))(oT({},e),{transition:v,register:!1,handle:Wk(s),element:Wk(a),target:Wk(m),feedback:d}),t)),b=Bk(y,sT);return Yk(i,()=>y.id=i),$k(()=>{uE(()=>{y.group=u,y.index=l})},[y,u,l]),Yk(g,()=>y.type=g),Yk(t,()=>y.accept=t,void 0,wI),Yk(o,()=>o&&(y.data=o)),Yk(l,()=>{var e;(null==(e=y.manager)?void 0:e.dragOperation.status.idle)&&(null==v?void 0:v.idle)&&y.refreshShape()},Gk),Kk(s,e=>y.handle=e),Kk(a,e=>y.element=e),Kk(m,e=>y.target=e),Yk(c,()=>y.disabled=!0===c),Yk(h,()=>y.sensors=h),Yk(n,()=>y.collisionDetector=n),Yk(r,()=>y.collisionPriority=r),Yk(d,()=>y.feedback=null!=d?d:"default"),Yk(v,()=>y.transition=v,void 0,wI),Yk(p,()=>y.modifiers=p,void 0,wI),Yk(e.alignment,()=>y.alignment=e.alignment),{sortable:b,get isDragging(){return b.isDragging},get isDropping(){return b.isDropping},get isDragSource(){return b.isDragSource},get isDropTarget(){return b.isDropTarget},handleRef:f(e=>{y.handle=null!=e?e:void 0},[y]),ref:f(e=>{var t,n;(e||!(null==(t=y.element)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.element=null!=e?e:void 0)},[y]),sourceRef:f(e=>{var t,n;(e||!(null==(t=y.source)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.source=null!=e?e:void 0)},[y]),targetRef:f(e=>{var t,n;(e||!(null==(t=y.target)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.target=null!=e?e:void 0)},[y])}}function sT(e,t,n){return!("isDragSource"!==e||n||!t)}const lT=({id:e,itemIndex:t,sectionIndex:n})=>io.jsx("div",{children:`${n}:${t} - ${e}`}),uT=({id:e,itemIndex:t,sectionIndex:n})=>{const r=Dw(QC),i=Dw(XC),o=Dw(BC).at(n)??0,a=Dw(GC)({sectionIndex:n}),{ref:s,isDragging:l}=aT({id:e,index:t,type:"item",accept:"item",group:a,modifiers:[JO],plugins:[Sq],data:{id:e,sectionIndex:n,sectionKey:a,itemIndex:t}}),u=void 0!==r?()=>{r({id:e,itemIndex:t,sectionIndex:n})}:void 0,c=i??lT;return io.jsx(Nd,{"data-testid":"section-item",onClick:u,ref:s,"data-dragging":l,sx:{padding:0,backgroundColor:l?"rgba(242, 242, 242, 1)":void 0,borderRadius:l?"4px":void 0},children:io.jsxs("div",{style:{width:"100%",opacity:l?.4:1},children:[io.jsx(NO,{isDragging:l,itemIndex:t,sectionIndex:n}),io.jsx(c,{id:e,itemIndex:t,sectionIndex:n}),t===o-1&&io.jsx(NO,{isDragging:l,itemIndex:t+1,sectionIndex:n})]})})},cT=n.memo(uT),dT=n.memo(({sectionIndex:e})=>{const t=Dw(GC),n=Dw(BC).at(e)??0,r=t({sectionIndex:e});return io.jsxs(Qu,{className:"exploration-list",style:{overflow:"auto"},children:[io.jsx(Uc,{}),io.jsx(FO,{id:r,sectionIndex:e}),io.jsx(Uc,{}),io.jsx(jO,{sectionIndex:e}),io.jsx(Ed,{sx:{padding:"2px 8px"},children:OO(n).map(n=>{const r=t({sectionIndex:e,itemIndex:n});return io.jsx(cT,{id:r,itemIndex:n,sectionIndex:e},r)})})]},r)}),pT=n.memo(()=>{const e=Dw(HC),t=Dw(GC),n=Pw(rE("start")),r=Pw(rE("over")),i=Pw(rE("end"));return io.jsxs(sO,{onDragEnd:i,onDragOver:r,onDragStart:n,children:[io.jsx(Qu,{style:{display:"flex",flexDirection:"column"},children:OO(e).map(e=>io.jsx(dT,{sectionIndex:e},t({sectionIndex:e})))}),io.jsx(TO,{})]})}),fT=n.memo(e=>io.jsx(RC,{atoms:iE,atomFamilies:oE,children:io.jsx(aE,{props:e,children:io.jsx(pT,{})})})),hT="12px",mT="nebula-table-utils-head-menu-button",gT="sn-copy-cell";let vT=function(e){return e.Enter="Enter",e.Space=" ",e.Esc="Escape",e.Tab="Tab",e.Shift="Shift",e.Left="ArrowLeft",e.Right="ArrowRight",e.Up="ArrowUp",e.Down="ArrowDown",e.C="c",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.F2="F2",e}({});const yT="nebula-table-utils-column-adjuster";let bT=function(e){return e[e.PixelsMin=30]="PixelsMin",e[e.PixelsMax=7680]="PixelsMax",e[e.PixelsDefault=200]="PixelsDefault",e[e.PercentageMin=1]="PercentageMin",e[e.PercentageMax=100]="PercentageMax",e[e.PercentageDefault=20]="PercentageDefault",e[e.PercentageMaxInIndentMode=75]="PercentageMaxInIndentMode",e[e.AutoMinPivot=80]="AutoMinPivot",e[e.AutoMinTable=120]="AutoMinTable",e}({}),xT=function(e){return e.Auto="auto",e.FitToContent="fitToContent",e.Pixels="pixels",e.Percentage="percentage",e}({});const ST={darker:.15,brighter:.3,opacity:.03},wT={darker:.3,brighter:.5,opacity:.05};let CT=function(e){return e.Cyclic="C",e}({});const ET=(e,t)=>{const n=new Map;for(const t of e)n.set(t.id,t);return t.reduce((e,t)=>{const r=n.get(t);return r&&e.push(r),e},[])},IT=WC(e=>hw(t=>{const n=t(eC),r=t($w),i=t(Jw)?.[e],o=n?.qHyperCube.rankedList?.[e];return i||(r?.isRankedListCorrupt(e)||void 0===o?r?.createRankedList(e):o)})),DT=(e,t=new Set)=>hw(n=>{const r=n(e),i=n(hC);if(!r||0===r.length)return"disabled";const o=r.filter(e=>!t.has(e.id));if(0===o.length)return"disabled";const a=o.filter(e=>i.has(e.id)).length;return 0===a?"none":a===o.length?"all":"some"}),PT=(e,t=new Set)=>hw(null,(n,r,i)=>{const o=n(e);o&&0!==o.length&&(e=>{const{items:t,shouldCheckAll:n,get:r,set:i,excludedIds:o}=e,a=t.filter(e=>!o?.has(e.id));if(0===a.length)return;const s=r(hC),l=new Set,u=new Set;if(a.forEach(e=>{const t=s.has(e.id);t&&!n&&u.add(e.id),!t&&n&&l.add(e.id)}),0===l.size&&0===u.size)return;const c=new Set(r(cC)),d=new Set(r(dC));l.forEach(e=>c.add(e)),l.forEach(e=>d.delete(e)),u.forEach(e=>d.add(e)),u.forEach(e=>c.delete(e)),i(cC,c),i(dC,d),zw({type:"apply",localChecked:l,localUnchecked:u,handler:r($w),model:r(Ww),fieldInfo:r(oC),handlerQueue:r(sC)})})({items:o,shouldCheckAll:i,get:n,set:r,excludedIds:t})}),RT=hw(e=>{const t=e(tC);return t?.qHyperCube.qDimensionInfo.filter(Uw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t??"",alternative:!0}))}),MT=hw(e=>{const t=e(eC),n=e(Hw),r=t?.qHyperCube.qEffectiveInterColumnSortOrder.map(e=>{if(-1===e)return{id:-1,title:n("Common.Values")};const{cId:r,qFallbackTitle:i}=t.qHyperCube.qDimensionInfo[e];return{id:r,title:i??""}});return r}),LT=hw(e=>{const t=e(Hw),n=e(RT),r=e(Gw),i=e(IT("columns")),o=e(IT("rows")),a=e(MT);if(void 0===n||void 0===i||void 0===o||void 0===a)return[];const s=[...a,...n].filter(r);return[{id:"rows",title:t("Common.Rows"),items:ET(s,o)},{id:"columns",title:t("Common.Columns"),items:ET(s,i)}]}),AT=WC(e=>hw(t=>t(LT).at(e))),kT=WC(({sectionIndex:e,itemIndex:t})=>hw(n=>n(AT(e))?.items.at(t)?.title),(e,t)=>e.sectionIndex===t.sectionIndex&&e.itemIndex===t.itemIndex),OT=WC(e=>hw(t=>t(AT(e))?.title)),qT=hw(e=>({sectionIndex:t,itemIndex:n})=>{const r=e(AT(t));return void 0===r?0===t?"rows":"columns":void 0===n?r.id:r.items.at(n)?.id??`missing-item-${t}-${n}`}),TT=hw(e=>e(LT).map(e=>e.items.length)),NT=WC(e=>DT(hw(t=>t(AT(e))?.items),new Set([-1]))),_T=WC(e=>PT(hw(t=>t(AT(e))?.items),new Set([-1]))),jT=hw(null,async(e,t,{event:n,id:r,toIndex:i,toSection:o,startSection:a})=>{const s=e($w),l=e(Ww),u=e(sC),c=e(IT("rows")),d=e(IT("columns")),p=o;if(void 0===s||void 0===l||void 0===c||void 0===d||null===u)return;if(n.operation.canceled)return void t(Jw,null);if("section"===n.operation.target?.type&&a===o)return void t(Jw,null);const f=zC({rows:c,columns:d},n);t(Jw,f),u.add(async()=>{"number"==typeof r?await s.movePseudoDimension({toIndex:i,toSection:p}):await s.moveDimension({cId:r,toIndex:i,toSection:p})})}),FT={noItems:{row:"ChartExploration.PivotTable.RowSectionEmpty.Title",column:"ChartExploration.PivotTable.ColumnSectionEmpty.Title",measure:"ChartExploration.PivotTable.MeasureSectionEmpty.Title"},noSearchFound:{row:"ChartExploration.PivotTable.NoRowsFound.Title",column:"ChartExploration.PivotTable.NoColumnsFound.Title",measure:"ChartExploration.PivotTable.NoMeasuresFound.Title"}},zT="ChartExploration.PivotTable.DimensionSectionEmpty.Message",WT="ChartExploration.PivotTable.MeasureSectionEmpty.Message",$T="#177fe6",VT=(e,t,n,r)=>{if("measure"===t)return e(r?FT.noSearchFound.measure:FT.noItems.measure);const i=r?FT.noSearchFound:FT.noItems;return e(n?i.row:i.column)},HT=(e,t,n)=>n?"":e("measure"===t?WT:zT),BT=WC(e=>hw(t=>{const n=t(Hw),r=t(Bw).length>0;return t=>({title:VT(n,e,0===t,r),message:HT(n,e,r)})})),GT=BT("measure"),UT=BT("dimensions"),YT=({children:e})=>io.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),KT=e=>{const t=Dw(kT(e));return io.jsx(YT,{children:t})},XT=hw(e=>{const t=e(tC);return t?.qHyperCube.qMeasureInfo.filter(Uw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t??""}))}),JT=hw(e=>{const t=e(eC),n=e(XT),r=e(Gw),i=e(IT("measures"));if(void 0===t||void 0===n||void 0===i)return[];const o=t.qHyperCube.qMeasureInfo.filter(Uw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t??""}));o.push(...n);const a=o.filter(r);return ET(a,i)}),ZT=WC(e=>hw(t=>t(JT).at(e)?.title??"")),QT=hw(e=>({itemIndex:t})=>{const n=e(JT);return void 0===t?"measures":n.at(t)?.id??`missing-item-${t}`}),eN=hw(e=>[e(JT).length]),tN=DT(JT),nN=PT(JT),rN=hw(null,async(e,t,{id:n,toIndex:r,event:i})=>{const o=e($w),a=e(Ww),s=e(sC),l=e(IT("measures"));if(void 0===o||void 0===a||void 0===l||"string"!=typeof n||null===s)return;const u=zC({measures:l},i);t(Jw,u),s.add(async()=>{await o.moveMeasure({cId:n,toIndex:r})})}),iN=kS().palette,oN={TEXT:iN.text.primary,DISABLED:iN.text.disabled,HOVER:iN.action.hover,WHITE:If.GREYSCALE_100,BORDER_MEDIUM:If.GREYSCALE_85,DARK_MODE_TEXT:If.GREYSCALE_95,DARK_MODE_BORDER:If.GREYSCALE_95,DARK_MODE_DISABLED:If.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:iN.primary.main,LINK:iN.info.main,ERROR:iN.error.main};function aN(e){return null!==e&&"object"==typeof e&&"r"in e&&"number"==typeof e.r&&"g"in e&&"number"==typeof e.g&&"b"in e&&"number"==typeof e.b&&("number"==typeof e.a||void 0===e.a)}function sN(e){if("object"==typeof e&&aN(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,n=0,r=0;if("string"==typeof e){let i;(i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10)):(i=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(i[1],16),n=parseInt(i[2],16),r=parseInt(i[3],16)):(i=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(i[1]+i[1],16),n=parseInt(i[2]+i[2],16),r=parseInt(i[3]+i[3],16))}return(t<<16)+(n<<8)+r}const lN={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:0,g:0,b:0,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}};function uN(...e){const t={type:"qcm-color",r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let n=0,r=0,i=0,o=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&"qcm-color"===a.type)({r:n,g:r,b:i,a:o}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(aN(e[0]))({r:n,g:r,b:i}=e[0]),"a"in e[0]&&({a:o}=e[0]);else if(e.length<3)if("string"==typeof e[0]){const a=e[0];let s;if(s=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10);else if(s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10),o=parseFloat(s[4]);else if(s=/^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))o=parseInt(s[1],10)/255,n=parseInt(s[2],10),r=parseInt(s[3],10),i=parseInt(s[4],10);else if(s=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(a))n=parseInt(s[1],16),r=parseInt(s[2],16),i=parseInt(s[3],16),o=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))n=parseInt(s[1]+s[1],16),r=parseInt(s[2]+s[2],16),i=parseInt(s[3]+s[3],16),o=1;else if(s=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;n=d[0]+p,r=d[1]+p,i=d[2]+p,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else if(s=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);o=parseFloat(s[7]),e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;n=d[0]+p,r=d[1]+p,i=d[2]+p,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i)}else if(s=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a*t;let u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-l;n=d[0]+p,r=d[1]+p,i=d[2]+p,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else{const e=a.toLowerCase();if(function(e){return e in lN}(e)){const t=lN[e];({r:n,g:r,b:i}=t),o="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(o=(4278190080&e[0])>>>24,o/=255,n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(n=e[0],r=e[1],i=e[2],o=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+n+r+i+o)&&(t.invalid=!0),t.r=Math.floor(n),t.g=Math.floor(r),t.b=Math.floor(i),t.a=o,t}function cN(e){let t,n,r;if(aN(e))return t=e.r.toString(16),n=e.g.toString(16),r=e.b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`;const i="string"==typeof e?sN(e):e;return t=((16711680&i)>>16).toString(16),n=((65280&i)>>8).toString(16),r=(255&i).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`}function dN(e){let t,n,r=0;const i="string"==typeof e?uN(e):e,o=i.r/255,a=i.g/255,s=i.b/255,{a:l}=i,u=Math.max(o,a,s),c=Math.min(o,a,s),d=(u+c)/2;if(u===c)t=0,r=0;else{switch(n=u-c,t=d>.5?n/(2-u-c):n/(u+c),u){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r,s:100*t,l:100*d,a:l}}function pN(e){let t,n,r=0;const i="string"==typeof e?uN(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),u=Math.min(o,a,s),c=l;if(l===u)t=0,r=0;else{switch(n=l-u,t=0===n?0:n/c,l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}}function fN(e){if(aN(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?sN(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function hN(e,t){return aN(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:hN(uN(e))}function mN(e){return aN(e)?1===e.a?fN(e):hN(e):mN(uN(e))}const gN=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function vN(e){return.2126*gN(e.r)+.7152*gN(e.g)+.0722*gN(e.b)}function yN(...e){const t=uN(...e);return t.invalid||vN(t)<.4}function bN(...e){const t=uN(...e),n={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},r=()=>(n.spaces.hslaObject||(n.spaces.hslaObject=dN(n)),n.spaces.hslaObject),i=e=>{const t=r(),{h:n,s:i,l:o,a:a}=t;return`hsla(${n}, ${i}, ${Math.max(0,Math.min(o+e,100))}, ${a})`};return{get type(){return n.type},isInvalid:()=>n.invalid,get r(){return n.r},get g(){return n.g},get b(){return n.b},get a(){return n.a},getR:()=>n.r,getG:()=>n.g,getB:()=>n.b,getAlpha:()=>n.a,setAlpha:e=>{n.a=e,n.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=uN(e);else{if(e.type!==n.type)return!1;t=e}return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a},isDark:()=>yN(n),getRGB:()=>(n.spaces.rgb||(n.spaces.rgb=fN(n)),n.spaces.rgb),getRGBA:()=>(n.spaces.rgba||(n.spaces.rgba=hN(n)),n.spaces.rgba),getString:()=>(n.spaces.string||(n.spaces.string=mN(n)),n.spaces.string),getHex:()=>(n.spaces.hex||(n.spaces.hex=cN(n)),n.spaces.hex),getHSL:()=>(n.spaces.hsl||(n.spaces.hsl=function(e){let t,n,r=0;const i="string"==typeof e?uN(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),u=Math.min(o,a,s),c=(l+u)/2;if(l===u)t=0,r=0;else{switch(n=l-u,t=c>.5?n/(2-l-u):n/(l+u),l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return`hsl(${360*r}, ${100*t}, ${100*c})`}(n)),n.spaces.hsl),getHSLA:()=>(n.spaces.hsla||(n.spaces.hsla=function(e){const{h:t,s:n,l:r,a:i}=dN(e);return`hsla(${t}, ${n}, ${r}, ${i})`}(n)),n.spaces.hsla),getHSLAObject:r,getShiftedHSLA:i,getHSV:()=>(n.spaces.hsv||(n.spaces.hsv=function(e){const{h:t,s:n,v:r}=pN(e);return`hsv(${t}, ${n}, ${r})`}(n)),n.spaces.hsv),getHSVObject:()=>(n.spaces.hsvObject||(n.spaces.hsvObject=pN(n)),n.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(n.r+(e.r-n.r)*t)}, ${Math.floor(n.g+(e.g-n.g)*t)}, ${Math.floor(n.b+(e.b-n.b)*t)}, ${Math.floor(n.a+(e.getAlpha()-n.a)*t)})`,getBrightenedColor:(e=1)=>bN(i(18*e)),getDarkenedColor:(e=1)=>bN(i(18*-e))}}function xN(e,t){if(!e||!t)return;const n=vN(e),r=vN(t);return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)}function SN(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wN,CN="top",EN="top-right",IN="right",DN="bottom-right",PN="bottom",RN="bottom-left",MN="left",LN="top-left";SN(SN(SN(SN(SN(SN(SN(SN(SN(SN(wN={},"equal-equal",[CN,PN]),"equal-higher",[PN,DN]),"equal-lower",[CN,EN]),"equal-void",[CN,PN]),"higher-equal",[MN,RN,CN,EN]),"higher-higher-acute",[PN,RN,MN,EN]),"higher-higher-obtuse",[PN,CN]),"higher-lower-negative",[CN,EN,IN]),"higher-lower-positive",[PN,RN,MN]),"higher-void",[CN]),SN(SN(SN(SN(SN(SN(SN(SN(SN(SN(wN,"lower-equal",[CN]),"lower-higher-negative",[CN,LN]),"lower-higher-positive",[DN]),"lower-lower-acute",[CN,LN,MN,EN,IN]),"lower-lower-obtuse",[CN,PN]),"lower-void",[CN]),"void-equal",[CN]),"void-higher",[CN,PN]),"void-lower",[CN,PN,MN]),"void-void",[CN]),SN(wN,"unclassified",[CN,PN,IN,MN,EN,DN,RN,LN]);var AN,kN,ON=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],qN=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];function TN(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?qN:ON}var NN=function(){if(kN)return AN;kN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},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(r)return r(t,n).value}return t[n]};return AN=function e(){var t,n,r,l,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(d,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},AN}();function _N(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function FN(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(NN);var zN=1/.7,WN="\\s*([+-]?\\d+)\\s*",$N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",VN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",HN=/^#([0-9a-f]{3,8})$/,BN=new RegExp(`^rgb\\(${WN},${WN},${WN}\\)$`),GN=new RegExp(`^rgb\\(${VN},${VN},${VN}\\)$`),UN=new RegExp(`^rgba\\(${WN},${WN},${WN},${$N}\\)$`),YN=new RegExp(`^rgba\\(${VN},${VN},${VN},${$N}\\)$`),KN=new RegExp(`^hsl\\(${$N},${VN},${VN}\\)$`),XN=new RegExp(`^hsla\\(${$N},${VN},${VN},${$N}\\)$`),JN={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 ZN(){return this.rgb().formatHex()}function QN(){return this.rgb().formatRgb()}function e_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=HN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?t_(t):3===n?new o_(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?n_(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?n_(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=BN.exec(e))?new o_(t[1],t[2],t[3],1):(t=GN.exec(e))?new o_(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=UN.exec(e))?n_(t[1],t[2],t[3],t[4]):(t=YN.exec(e))?n_(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=KN.exec(e))?d_(t[1],t[2]/100,t[3]/100,1):(t=XN.exec(e))?d_(t[1],t[2]/100,t[3]/100,t[4]):JN.hasOwnProperty(e)?t_(JN[e]):"transparent"===e?new o_(NaN,NaN,NaN,0):null}function t_(e){return new o_(e>>16&255,e>>8&255,255&e,1)}function n_(e,t,n,r){return r<=0&&(e=t=n=NaN),new o_(e,t,n,r)}function r_(e){return e instanceof FN||(e=e_(e)),e?new o_((e=e.rgb()).r,e.g,e.b,e.opacity):new o_}function i_(e,t,n,r){return 1===arguments.length?r_(e):new o_(e,t,n,null==r?1:r)}function o_(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function a_(){return`#${c_(this.r)}${c_(this.g)}${c_(this.b)}`}function s_(){const e=l_(this.opacity);return`${1===e?"rgb(":"rgba("}${u_(this.r)}, ${u_(this.g)}, ${u_(this.b)}${1===e?")":`, ${e})`}`}function l_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function u_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function c_(e){return((e=u_(e))<16?"0":"")+e.toString(16)}function d_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new f_(e,t,n,r)}function p_(e){if(e instanceof f_)return new f_(e.h,e.s,e.l,e.opacity);if(e instanceof FN||(e=e_(e)),!e)return new f_;if(e instanceof f_)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new f_(a,s,l,e.opacity)}function f_(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function h_(e){return(e=(e||0)%360)<0?e+360:e}function m_(e){return Math.max(0,Math.min(1,e||0))}function g_(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_N(FN,e_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ZN,formatHex:ZN,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return p_(this).formatHsl()},formatRgb:QN,toString:QN}),_N(o_,i_,jN(FN,{brighter(e){return e=null==e?zN:Math.pow(zN,e),new o_(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new o_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new o_(u_(this.r),u_(this.g),u_(this.b),l_(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:a_,formatHex:a_,formatHex8:function(){return`#${c_(this.r)}${c_(this.g)}${c_(this.b)}${c_(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:s_,toString:s_})),_N(f_,function(e,t,n,r){return 1===arguments.length?p_(e):new f_(e,t,n,null==r?1:r)},jN(FN,{brighter(e){return e=null==e?zN:Math.pow(zN,e),new f_(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new f_(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new o_(g_(e>=240?e-240:e+120,i,r),g_(e,i,r),g_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new f_(h_(this.h),m_(this.s),m_(this.l),l_(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=l_(this.opacity);return`${1===e?"hsl(":"hsla("}${h_(this.h)}, ${100*m_(this.s)}%, ${100*m_(this.l)}%${1===e?")":`, ${e})`}`}}));const v_=Math.PI/180,y_=180/Math.PI,b_=4/29,x_=6/29,S_=3*x_*x_;function w_(e){if(e instanceof C_)return new C_(e.l,e.a,e.b,e.opacity);if(e instanceof R_)return M_(e);e instanceof o_||(e=r_(e));var t,n,r=P_(e.r),i=P_(e.g),o=P_(e.b),a=E_((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=E_((.4360747*r+.3850649*i+.1430804*o)/.96422),n=E_((.0139322*r+.0971045*i+.7141733*o)/.82521)),new C_(116*a-16,500*(t-a),200*(a-n),e.opacity)}function C_(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function E_(e){return e>.008856451679035631?Math.pow(e,1/3):e/S_+b_}function I_(e){return e>x_?e*e*e:S_*(e-b_)}function D_(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function P_(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function R_(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function M_(e){if(isNaN(e.h))return new C_(e.l,0,0,e.opacity);var t=e.h*v_;return new C_(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}_N(C_,function(e,t,n,r){return 1===arguments.length?w_(e):new C_(e,t,n,null==r?1:r)},jN(FN,{brighter(e){return new C_(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new C_(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 o_(D_(3.1338561*(t=.96422*I_(t))-1.6168667*(e=1*I_(e))-.4906146*(n=.82521*I_(n))),D_(-.9787684*t+1.9161415*e+.033454*n),D_(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),_N(R_,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof R_)return new R_(e.h,e.c,e.l,e.opacity);if(e instanceof C_||(e=w_(e)),0===e.a&&0===e.b)return new R_(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*y_;return new R_(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new R_(e,t,n,null==r?1:r)},jN(FN,{brighter(e){return new R_(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new R_(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return M_(this).rgb()}}));var L_=e=>()=>e;function A_(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):L_(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?A_:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):L_(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=i_(e)).r,(t=i_(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=A_(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);var k_="center",O_="bottom";[{key:"NoDataExist",alignment:k_,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:k_,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:k_,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:k_},{key:"DataRangeIncludingZero",alignment:O_},{key:"LimitedData",alignment:O_},{key:"NegativeOrZeroValues",alignment:O_}].reduce(function(e,t){return e[t.key]=t,e},{});var q_,T_=["__proto__","constructor"];function N_(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!T_.some(function(e){return r.includes(e)})){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function __(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}function j_(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}}function F_(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function z_(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=$_)):void 0===t&&(t=W_);for(var n,r,i,o,a,s=new B_(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new B_(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(H_)}function W_(e){return e.children}function $_(e){return Array.isArray(e)?e[1]:null}function V_(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function H_(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function B_(e){this.data=e,this.depth=this.height=0,this.parent=null}B_.prototype=z_.prototype={constructor:B_,count:function(){return this.eachAfter(F_)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return z_(this).eachBefore(V_)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},q_=function(e){
101
101
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
102
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,p=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=p-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,p):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,p=d.length,b=0;b<p;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},q_({exports:{}});const G_=(e,t=oN.TEXT,n=oN.WHITE)=>{const r=bN(e??""),i=bN(t),o=bN(n);return r.isInvalid()?t:function(e,t,n){const r=xN(e,t),i=xN(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},U_=e=>{const t=e.getStyle("","","dataColors.selected")||oN.SELECTED,n=function(e,t){const n=bN("#FFFFFF"),r=bN(e),i=bN(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=xN(n,r),a=xN(i,r),s=o>a||o>4.5;return!s&&a>3?i.getHex():s?"#FFFFFF":"#000000"}(t,oN.TEXT);return{background:t,color:n}},Y_=(e,t)=>{const n=bN(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},K_=e=>{const t=bN(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},X_=e=>{e.stopPropagation(),e.preventDefault()},J_=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,Z_=(e,t)=>{const n=e.closest(".exploration-list"),r=n?.nextElementSibling||n?.parentElement?.nextElementSibling;if(null===r||!r){if(t===vT.Tab)return;return n?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]}return r.getElementsByClassName("exploration-section-header")[0]},Q_=e=>{const{currentTarget:t}=e,n=J_(t);let r=t.closest("li")?.previousElementSibling?.getElementsByClassName(n)[0];if(!r){const e=t.closest(".exploration-list"),i=e?.querySelector(".exploration-section-header");if(i)return i;if(r=((e,t)=>{const n=e.closest(".exploration-list"),r=n?.previousElementSibling;if(null===r||!r)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const i=r.getElementsByClassName(t);return i.length>0?i[i.length-1]:void 0})(t,n),!r){const e=t.closest(".exploration-panel")?.getElementsByClassName(n)[1];return e??null}}return r},ej=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},tj=e=>{const t=e.key===vT.Down?(e=>{const{currentTarget:t,key:n}=e,r=J_(t),i=t.closest("li");let o=i?.nextElementSibling?.getElementsByClassName(r)[0];return o||(o=Z_(t,n),o)?o:t.closest(".exploration-panel")?.getElementsByClassName(r)[0]})(e):Q_(e);t&&ej(t)},nj=(e,t)=>{const{key:n}=e;switch(n){case vT.Tab:if(e.shiftKey)e.preventDefault(),((e,t)=>{const{currentTarget:n}=e,r=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if(n===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=r&&r[t.itemIndex];return void(e&&ej(e))}const n=Q_(e);n&&ej(n)}if(n===t.items.explorationItemFocusRef.current){const t=n.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void ej(t);const r=Q_(e);r&&ej(r)}})(e,t);else{const n=((e,t)=>{const{currentTarget:n,key:r}=e;if(e.shiftKey)return!0;if(n===t.items.explorationItemFocusRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];return e&&ej(e),!0}if(n===t.items.draggableIconRef.current){const e=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const n=e&&e[t.itemIndex+1];return n&&ej(n),!0}const i=Z_(n,r);if(!i)return!1;ej(i)}return!0})(e,t);n?e.preventDefault():e.stopPropagation()}break;case vT.Down:case vT.Up:X_(e),tj(e);break;case vT.Enter:case vT.Space:X_(e),((e,t)=>{const{currentTarget:n}=e;if(n===t.items.draggableIconRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-item")[0];return void(e&&ej(e))}if(n===t.items.explorationItemRef.current){const e=n.getElementsByClassName("exploration-draggable-icon")[0];return void ej(e)}n===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id)})(e,t)}},rj=(e,t)=>{const{key:n,currentTarget:r}=e;if(r===t.current&&n===vT.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:n}=e;if(n!==t.current)return;const r=n.closest('[role="region"]')?.getElementsByTagName("button")[0];r&&ej(r)})(e,t);else{const e=r.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&ej(e)}},ij=(e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=t.sectionIndex??2;if(0===r)return void((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel")?.getElementsByTagName("input")[0];r&&ej(r)})(e,t);const i=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[r-1],o=i?.getElementsByClassName("exploration-item-focus").length??0;if(o>0){const e=i?.getElementsByClassName("exploration-draggable-icon")[o-1];e&&ej(e)}},oj=(e,t)=>{const{key:n}=e;switch(n){case vT.Tab:X_(e),e.shiftKey?ij(e,t):((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-list"),i=r?.getElementsByClassName("exploration-item-focus")[0];if(!i){const e=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[2].getElementsByClassName("exploration-section-header")[0];return void(e&&ej(e))}ej(i)})(e,t);break;case vT.Down:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a+1<i?r?.getElementsByClassName("exploration-section-header")[a+1]:r?.getElementsByClassName("exploration-section-header")[0],o&&ej(o)})(e,t);break;case vT.Up:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a-1>=0?r?.getElementsByClassName("exploration-section-header")[a-1]:r?.getElementsByClassName("exploration-section-header")[i-1],o&&ej(o)})(e,t);break;case vT.Enter:case vT.Space:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(e.preventDefault(),n!==t.ref.current)return;const r="all"!==t.checkState;t.toggleAllCheckboxes(r)})(e,t)}},aj=({children:e})=>io.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),sj=({children:e,sectionIndex:t})=>{const r=Dw(void 0!==t?NT(t):tN),i=Pw(void 0!==t?_T(t):nN),o=n.useRef(null),a={ref:o,toggleAllCheckboxes:i,checkState:r,sectionIndex:t};return io.jsxs(Qu,{ref:o,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{oj(e,a)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"12px","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsx(Ic,{disabled:"disabled"===r,checked:"all"===r,indeterminate:"some"===r,onChange:e=>{i(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),io.jsx(aj,{children:e})]})},lj=({sectionIndex:e})=>{const t=Dw(OT(e));return io.jsx(sj,{sectionIndex:e,children:t})},uj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M.5 4.774v6.452a2 2 0 0 0 1.154 1.813l5.5 2.566a2 2 0 0 0 1.692 0l5.5-2.566a2 2 0 0 0 1.154-1.813V4.774a2 2 0 0 0-1.154-1.813L8.846.395a2 2 0 0 0-1.692 0l-5.5 2.566A2 2 0 0 0 .5 4.774m1 0v-.032l6 2.428v7.493l-5.423-2.53a1 1 0 0 1-.577-.907zm.545-.89.032-.016 5.5-2.567a1 1 0 0 1 .846 0l5.5 2.567.032.015L8 6.293zm12.455.858v6.484a1 1 0 0 1-.577.906L8.5 14.663V7.17z"})})),cj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M5.5 1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm0 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM5 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 1.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM9.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"})})),dj=fl("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),pj=fl(cj)(()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}})),fj=({children:e})=>io.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),hj=({icon:e,title:t,...r})=>{const[i,o]=Rw(hC),a=Dw(Hw),s=n.useRef(null),l=n.useRef(null),u=n.useRef(null),c={id:r.id,itemIndex:r.itemIndex,toggleCheckedById:o,items:{explorationItemRef:s,explorationItemFocusRef:l,draggableIconRef:u}};return io.jsxs(Qu,{ref:s,className:"exploration-item",onClick:e=>{e.stopPropagation(),o(r.id)},onKeyDown:e=>{nj(e,c)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"12px"},title:t,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsxs(Qu,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{nj(e,c)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsx(Ic,{checked:i.has(r.id),"aria-label":a("ChartExploration.ListItem.Label",t),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===r.id?"hidden":"visible"}}),io.jsx(e,{height:"12px",style:{flexShrink:0}}),io.jsx(fj,{children:t})]}),io.jsx(pj,{ref:u,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{nj(e,c)}})]})},mj=e=>{const t=Dw(kT(e))??"";return io.jsx(hj,{title:t,icon:uj,...e})},gj=()=>{const e=Dw(qT),t=Dw(TT),n=Dw(UT),r=Pw(jT);return io.jsx(fT,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:KT,headerRenderer:lj,itemRenderer:mj})},vj=({itemIndex:e})=>{const t=Dw(ZT(e));return io.jsx(YT,{children:t})},yj=()=>{const e=Dw(Hw);return io.jsx(sj,{children:e("Common.Values")})},bj=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"}),io.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"})]})),xj=e=>{const{itemIndex:t}=e,n=Dw(ZT(t));return io.jsx(hj,{title:n,icon:bj,...e})},Sj=()=>{const e=Dw(QT),t=Dw(eN),n=Dw(GT),r=Pw(rN);return io.jsx(Qu,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:io.jsx(fT,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:vj,headerRenderer:yj,itemRenderer:xj})})},wj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014zM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0m-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6 6 0 0 1-1.413 1.415"})})),Cj=()=>{const[e,t]=Rw(Bw),r=Dw(Hw),i=n.useRef(null),[o]=Dw(eN),[a=0,s=0]=Dw(TT),l=f(e=>{t(e.target.value)},[t]),u=0===e.length||0===a&&0===s&&0===o?r("Common.Search.NoResultsAvailable"):r("ChartExploration.Pivot.Search.ResultsFound",a.toString(),s.toString(),o.toString());return io.jsxs(Qu,{ref:i,onKeyDown:e=>{rj(e,i)},style:{position:"sticky",top:0,zIndex:10,width:"calc(100% - 16px)",backgroundColor:"var(--sprout-common-background-color-weak)",paddingTop:2,paddingRight:8,paddingLeft:8,paddingBottom:8},children:[io.jsx(dj,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:u}),io.jsx(Np,{size:"small",fullWidth:!0,"data-testid":"chart-exploration-search-input","aria-label":r("Common.Search.AccessibilityLabel"),type:"search",defaultValue:e,placeholder:r("Common.Search"),onChange:l,startAdornment:io.jsx(pd,{position:"start",children:io.jsx(wj,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},Ej=e=>{const t=Ls(Ef());return io.jsx(ml,{theme:t,children:io.jsx(xw,{children:io.jsx(mC,{props:e,children:io.jsxs(Qu,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[io.jsx(Cj,{}),io.jsx(gj,{}),io.jsx(Sj,{})]})})})})},Ij=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:Ej,classification:{tags:["exploration"],exclusive:!0}}};var Dj=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(Dj||{}),Pj=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(Pj||{}),Rj=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(Rj||{}),Mj=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(Mj||{});const Lj=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,Aj=e=>{if(!Array.isArray(e))return"";let t="{<";const n=[];if(e.forEach(e=>{let t=`[${e.field}]${e.exclude?"-":""}={`,r="}",i="";switch(e.type){case Rj.SEARCH:i=(e=>{let t="",n="";const r=e.options?.mode;if(!r)return"";switch(r){case Dj.BEGINNING_OF_WORD:t="*^",n="*";break;case Dj.ENDS_WITH:t="*";break;case Dj.STARTS_WITH:n="*";break;case Dj.MATCHES_EXACTLY:break;case Dj.CONTAINS:default:t="*",n="*"}const i=e.options.values?.[0]??"";return""!==i?`"${t}${i}${n}"`:""})(e);break;case Rj.CONDITION:i=(e=>{const{options:t}=e,n=t?.mode===Pj.GENERAL,r=t?.modifier?.type===Mj.FIXED_VALUE,i=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===i.length||!r&&(!t.firstValue?.aggregator||!t.firstValue?.field)||r&&!t.firstValue?.fixedValue||n&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let o,a,s="=";n&&r?(o=`${t.conditionField?.aggregator}(${Lj(t.conditionField?.field)})`,a=`${t.firstValue?.fixedValue}`):!n&&r?(o="",a=`${t.firstValue?.fixedValue}`,s=""):n||r?(o=`${t.conditionField?.aggregator}(${Lj(t.conditionField?.field)})`,a=`${t.firstValue?.aggregator}(${Lj(t.firstValue?.field)})`):(o=`${Lj(e.field)}`,a=`${t.firstValue?.aggregator}(total ${Lj(t.firstValue?.field)})`);const l=`${s}${o}${i[0]}${a}`;let u="";if(i.length>1){if(!r&&(!t.secondValue?.aggregator||!t.secondValue?.field)||r&&!t.secondValue?.fixedValue)return"";let e,a;n&&r?(e=`${t.secondValue?.fixedValue}`,a=` and ${o}`):!n&&r?(e=`${t.secondValue?.fixedValue}`,a=""):n||r?(e=`${t.secondValue?.aggregator}(${Lj(t.secondValue?.field)})`,a=` and ${o}`):(e=`${t.secondValue?.aggregator}(total ${Lj(t.secondValue?.field)})`,a=` and ${o}`),u=`${a}${i[1]}${e}`}return`"${l}${u}"`})(e);break;case Rj.CLEAR_SELECTION:i=`[${e.field}]=`,t="",r="";break;case Rj.VALUES:default:i=e.options?.values?e.options.values.map(e=>`'${e.replace(/'/g,"''")}'`).join(","):""}""!==i&&n.push(`${t}${i}${r}`)}),0===n.length)return;return t+=`${n.join(",")}>}`,t},kj=[];for(let e=0;e<256;++e)kj.push((e+256).toString(16).slice(1));let Oj;const qj=new Uint8Array(16);var Tj={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Nj(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!Oj){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Oj=crypto.getRandomValues.bind(crypto)}return Oj(qj)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(kj[e[t+0]]+kj[e[t+1]]+kj[e[t+2]]+kj[e[t+3]]+"-"+kj[e[t+4]]+kj[e[t+5]]+"-"+kj[e[t+6]]+kj[e[t+7]]+"-"+kj[e[t+8]]+kj[e[t+9]]+"-"+kj[e[t+10]]+kj[e[t+11]]+kj[e[t+12]]+kj[e[t+13]]+kj[e[t+14]]+kj[e[t+15]]).toLowerCase()}(r)}const _j=()=>crypto?.randomUUID?.()??function(e){return Tj.randomUUID&&!e?Tj.randomUUID():Nj(e)}(),jj=1e3,Fj=1e3,zj=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,n=((e,t)=>{const n=new Set;for(const t of e){if(n.has(t))return!0;n.add(t)}const r=e.includes(-1),i=e.filter(e=>-1!==e);if(t){const n=r?t.length+1:t.length;if(e.length!==n)return!0}const o=[...i].sort((e,t)=>e-t);for(let e=0;e<o.length;e++)if(o[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);n&&(e.qInterColumnSortOrder=((e,t)=>{const n=[];if(t)for(let e=0;e<t.length;e++)n.push(e);return e.qMeasures.length>=2&&n.push(-1),n})(e,t))},Wj=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},$j=e=>{if(!e)return;zj(e);const t=e.qDimensions,{qInterColumnSortOrder:n}=e;((e,t=[])=>{const n=t.filter(e=>-1!==e);for(let r=0;r<n.length;r++)if(-1!==n[r]&&n[r]!==r){const i=n[r],o=n.indexOf(r),a=n[o];Wj(n,r,o),Wj(e,r,o),Wj(t,t.indexOf(i),t.indexOf(a))}})(t,n)},Vj=P;class Hj extends Vj{#u;constructor(e,t){super(e),this.path=e.path,this.#u=t}async addDimension(e,t,n,r){if(!e||this.#c(e))return;const i=t??!1;if(e.qDef.cId||(e.qDef.cId=_j()),r)return this.addAlternativeDimension(e,i,n);if(this.getDimensions().length<this.maxDimensions()){const t=await(async(e,t,n,r)=>{const i=e.getDimensions(),o=e.hcProperties.qNoOfLeftDims;return await e.autoSortDimension(t),$j(e.hcProperties),(-1===o||Number.isNaN(+o))&&(e.hcProperties.qNoOfLeftDims=i.length),n?((e,t,n,r)=>{if(!e)return;const{qInterColumnSortOrder:i,qNoOfLeftDims:o}=e,a=t.length,s=i.indexOf(-1),l=-1!==s,u=void 0!==r?r+(o||0):void 0;if(l&&void 0!==u&&s>=u?((e,t,n)=>{t.splice(n,1),t.push(e),t.splice(n+1,0,-1)})(a,i,s):i.push(a),void 0===r)t.push(n);else if(void 0!==u){const e=l&&u>s?u-1:u;t.splice(e,0,n)}})(e.hcProperties,i,t,r):((e,t,n,r)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const i=e.qNoOfLeftDims,{qInterColumnSortOrder:o}=e,a=t.length,s=o.indexOf(-1),l=-1!==s&&i>0&&s<i;if(o.push(a),l)void 0===r?t.splice(i-1,0,n):s<r?t.splice(r-1,0,n):(t.splice(r,0,n),o.splice(s,1),o.splice(s+1,0,-1));else{const e=r??i;t.splice(e,0,n),-1!==s&&(o.splice(s,1),o.splice(s+1,0,-1))}e.qNoOfLeftDims++})(e.hcProperties,i,t,r),t})(this,e,i,n);return this.#d({section:i?"columns":"rows",cId:e.qDef.cId,addLast:void 0===n}),t}}async addDimensions(e,t,n){const r=[];for await(const i of e){const e=await this.addDimension(i,n,void 0,t);e&&r.push(e)}return r}addAlternativeDimension(e,t,n){if(!e||this.#c(e))return;const r=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=r.length);let i=n;return i=void 0===i?t?r.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+i:Math.min(i,this.hcProperties.excludedNoOfLeftDims),r.splice(i,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#d({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),e}async addFieldDimension(e,t,n,r={}){const i=this.createFieldDimension(e,t,n);return this.addDimension(i,r.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const n=e.map(e=>this.createFieldDimension(e.field,e.label,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const n=e.map(e=>this.createLibraryDimension(e.id,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}reinsertDimension(e,t,n){e.qDef.cId||(e.qDef.cId=_j());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,n);return this.reinsertAlternativeDimension(e,n,t)}reinsertAlternativeDimension(e,t,n){const r=this.getDimensions(),i=this.getAlternativeDimensions();if(r.length>=jj)return Promise.resolve();const o="number"==typeof t?t:i.length;return i.splice(o,0,e),this.#d({section:n?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,n){return Promise.all([...e].reverse().map(e=>this.removeDimension(e,t,n)))}async removeDimension(e,t,n){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!n&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#p({cId:t.qDef.cId,section:n?"columns":"rows"}),t}const r=this.getDimensions(),i=this.properties.qHyperCubeDef.qNoOfLeftDims,o=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof o&&"number"==typeof i&&o+1<=i&&this.properties.qHyperCubeDef.qNoOfLeftDims--;const a=this.properties.qHyperCubeDef.columnWidths?this.properties.qHyperCubeDef.columnWidths[1]:void 0;Array.isArray(a)&&a.length>e&&a.splice(e,1);const s=r.splice(e,1).at(0);if(s)return((e,t)=>{if(!e)return-1;const n=e.indexOf(t);if(-1===n)return-1;for(let n=0;n<e.length;++n)e[n]>t&&e[n]--;e.splice(n,1)})(this.hcProperties.qInterColumnSortOrder,e),$j(this.hcProperties),this.#p({cId:s.qDef.cId,section:n?"columns":"rows"}),s}#c(e){return!(!e||void 0===e.qDef.cId)&&[...this.getDimensions(),...this.getAlternativeDimensions()].some(t=>t.qDef.cId===e.qDef.cId)}async addMeasures(e,t=!1){const n=[];for await(const r of e){const e=await this.addMeasure(r,t,void 0,!0);e&&n.push(e)}return n}addAlternativeMeasures(e,t){if(this.#f(e))return;const n=this.getAlternativeMeasures(),r=void 0===t?n.length:t,i=n.splice(r,0,e);return this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),i}async addMeasure(e,t,n,r){if(this.#f(e))return;if(e.qDef.cId||(e.qDef.cId=_j()),t)return this.addAlternativeMeasures(e,n);r||delete e.qDef.qNumFormat;const i=this.getMeasures();if(i.length<this.maxMeasures()){const t=1===i.length;return void 0!==n&&n>=0?i.splice(n,0,e):i.push(e),this.autoSortMeasure(e).then(()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#h({cId:e.qDef.cId,addLast:void 0===n}),e))}return i.length<Fj?(this.getAlternativeMeasures().push(e),this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const n=this.getMeasures(),r=this.getAlternativeMeasures(),i=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=_j()),t=void 0!==t?t:n.length,n.length<this.maxMeasures()){if(n.splice(t,0,e),2===n.length){-1===i.indexOf(-1)&&i.push(-1)}this.#h({cId:e.qDef.cId})}else n.length<Fj&&(t=r.length,r.splice(t,0,e),this.#h({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#p({cId:t.qDef.cId,section:"measures"}),t}const n=this.getMeasures();let r,i,o;if("number"==typeof e&&e<n.length){r=2===n.length,i=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;r&&(o=t.indexOf(-1),t.splice(o,1),this.hcProperties.qNoOfLeftDims&&o+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(i=this.getAlternativeMeasures().splice(e-n.length,1)[0]);if(i)return this.#p({cId:i.qDef.cId,section:"measures"}),i}async removeMeasures(e,t){return await Promise.all([...e].reverse().map(e=>this.removeMeasure(e,t))),e}#f(e){return!(!e||void 0===e.qDef.cId)&&[...this.getMeasures(),...this.getAlternativeMeasures()].some(t=>t.qDef.cId===e.qDef.cId)}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#m("rows"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getColumnDimensions(){const e=this.#m("columns"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#g(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#v(e){return[...this.#g(e)]}#y(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#b(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#x(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#m(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:n}=this.hcProperties;if(this.#S())return"columns"===e?t:[];switch(e){case"rows":return-1===n?t:t.slice(0,n);case"columns":return-1===n?[]:t.slice(n);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#S(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#w(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#S())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#C(e,t=!0){const n=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(n);const r=this.#m(e),i=this.getDimensions(),o=r.map(e=>-1===e?-1:i[e]);switch(e){case"rows":return o.concat(t?this.getAlternativeRowDimensions():[]).map(n);case"columns":return o.concat(t?this.getAlternativeColumnDimensions():[]).map(n);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],n=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const r=t.filter((e,n)=>t.indexOf(e)!==n);return console.warn("Corrupt ranked list detected: duplicate ids",{duplicates:r,section:e,chartId:n}),!0}const r=this.#C(e);if(t.length!==r.length)return console.warn("Corrupt ranked list detected: length mismatch",{section:e,chartId:n,fieldIds:r,rankedList:t,diff:new Set(r).symmetricDifference(new Set(t))}),!0;const i=r.filter(e=>!t.includes(e));if(i.length>0)return console.warn("Corrupt ranked list detected: missing ids",{missingIds:i,section:e,chartId:n}),!0;const o=this.#C(e,!1),a=t.filter(e=>o.includes(e)),s=o.filter((e,t)=>e!==a[t]);return s.length>0&&(console.warn("Corrupt ranked list detected: main field order mismatch",{section:e,chartId:n,orderMismatchIds:s}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#E({section:e});case"measures":return this.#I();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#E({section:e}){const t=this.getDimensions(),n=this.#m(e),r="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),i=n.map(e=>-1===e?-1:t[e].qDef.cId);return i.push(...r.map(e=>e.qDef.cId)),this.#y(e,i)}#I(){if(void 0!==this.hcProperties.rankedList?.measures)return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map(e=>e.qDef.cId);return this.#y("measures",e)}#D({section:e,cId:t,fields:n,addLast:r}){const i=this.#g(e),o=n.findIndex(e=>e.qDef.cId===t),a=n[o+1]?.qDef.cId,s=n[o-1]?.qDef.cId;if(r)i.push(t);else if(o>=0)if(a){const e=i.indexOf(a);i.splice(e,0,t)}else if(s){const e=i.indexOf(s);i.splice(e+1,0,t)}else i.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#d({section:e,cId:t,alternative:n=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#E({section:e});let i=[];return i="columns"===e?n?this.getAlternativeColumnDimensions():this.getColumnDimensions():n?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#D({section:e,cId:t,fields:i,addLast:r})}#h({cId:e,alternative:t=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#I();const r=t?this.getAlternativeMeasures():this.getMeasures();return this.#P(),this.#D({section:"measures",cId:e,fields:r,addLast:n})}#P(){const e=this.#g("rows"),t=this.#g("columns");this.#w("rows")&&!e.includes(-1)?e.push(-1):this.#w("columns")&&!t.includes(-1)&&t.push(-1)}#R(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#g("rows"),t=this.#g("columns"),n=e.indexOf(-1),r=t.indexOf(-1);-1!==n&&e.splice(n,1),-1!==r&&t.splice(r,1)}#p({cId:e,section:t}){const n=this.#g(t),r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.#R())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex(t=>t.qDef.cId===e),n=this.#v("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t);if(void 0===i)return;const o=n.slice(r+1).find(e=>this.getAlternativeMeasures().some(t=>t.qDef.cId===e)),a=this.getAlternativeMeasures().findIndex(e=>e.qDef.cId===o);await this.addAlternativeMeasures(i,-1===a?void 0:a),this.#y("measures",n)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex(t=>t.qDef.cId===e),n=this.#v("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t,!0);if(void 0===i)return;const o=this.getMeasures().map(e=>e.qDef.cId),a=n.slice(r+1).find(e=>o.includes(e)),s=o.findIndex(e=>e===a);await this.addMeasure(i,!1,-1===s?void 0:s),this.#y("measures",n)}async moveDimensionToAlternative(e){const t=this.#b(e),n=this.getDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#v(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!1,o);if(void 0===a)return;const s=r.slice(i+1).find(e=>this.getAlternativeDimensions().some(({qDef:t})=>t.cId===e));let l=this.getAlternativeDimensions().findIndex(({qDef:e})=>e.cId===s);l=-1===l?void 0:l;void 0!==this.addAlternativeDimension(a,o,l)&&this.#y(t,r)}async moveDimensionFromAlternative(e){const t=this.#b(e),n=this.getAlternativeDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#v(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!0,o);if(void 0===a)return;const s=this.#C(t,!1),l=r.slice(i+1).find(e=>s.includes(e));let u=s.findIndex(e=>e===l);u=-1===u?void 0:u;void 0!==await this.addDimension(a,o,u)&&this.#y(t,r)}movePseudoDimension({toIndex:e,toSection:t}){const n=this.#b(-1);if(null===n)return void console.error("Cannot move pseudo dimension, unable to find it in any section",{toIndex:e,toSection:t});const r="columns"===t,i=n===t,o=this.#v(t);if(i){const e=o.indexOf(-1);o.splice(e,1)}else{const i=this.#g(n),o=i.indexOf(-1);if(-1===o)return void console.error("Couldn't delete pseudo dimension from current section",{toIndex:e,toSection:t,fromSection:n});i.splice(o,1),this.hcProperties.qNoOfLeftDims=r?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const a=e-o.slice(0,e).filter(e=>this.#x(e)).length,s=r?this.hcProperties.qNoOfLeftDims+a:a,l=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(l,1),this.hcProperties.qInterColumnSortOrder.splice(s,0,-1),o.splice(e,0,-1),this.#y(t,o)}async moveDimension({cId:e,toIndex:t,toSection:n}){const r=this.#b(e),i=this.#x(e);if(null===r)return void console.error("Cannot move dimension, unable to find it in any section",{cId:e});const o=(i?this.getAlternativeDimensions():this.getDimensions()).findIndex(({qDef:t})=>t.cId===e);if(-1===o)return void console.error("Couldn't find dimension to move",{cId:e,toIndex:t,toSection:n});const a=this.#v(n),s=a.indexOf(e);-1!==s&&a.splice(s,1);const l=t-a.slice(0,t).filter(e=>this.#x(e)!==i).length,u="columns"===n,c="columns"===r,d=await this.removeDimension(o,i,c);if(void 0===d)return;void 0!==await this.addDimension(d,u,l,i)&&(a.splice(t,0,e),this.#y(n,a))}async moveMeasure({cId:e,toIndex:t}){const n=this.#x(e),r=(n?this.getAlternativeMeasures():this.getMeasures()).findIndex(t=>t.qDef.cId===e);if(-1===r)return void console.error("Cannot move measure, unable to find it in any section",{cId:e});const i=this.#v("measures"),o=i.indexOf(e);-1!==o&&i.splice(o,1);const a=t-i.slice(0,t).filter(e=>this.#x(e)!==n).length,s=await this.removeMeasure(r,n);if(void 0===s)return;void 0!==await this.addMeasure(s,n,a)&&(i.splice(t,0,e),this.#y("measures",i))}getLabels(){return this.getMeasures().filter(e=>!e.qLibraryId&&!!e.qDef.qLabel).map(e=>e.qDef.qLabel)}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find(t=>t.id===e)}addFilterField(e){const t=e.qTags??e.tags,n=Array.isArray(t)&&t.includes("$numeric"),r=e.isDerived,i=Array.isArray(this.properties.filters)?this.properties.filters:[],o={type:"values",field:r?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:_j(),qTags:Array.isArray(t)?t:[],isNumeric:n};return i.push(o),this.properties.filters=i,this.properties.qHyperCubeDef.qContextSetExpression=Aj(i),o}addFilters(e){const t=[];for(const n of e)t.push(this.addFilterField(n));return t}#M(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=Aj(t),t}removeFilters(e){if(0===e.length)return[];let t=[];const n=[...e].sort((e,t)=>t-e);t=this.getFilters().filter((t,n)=>e.includes(n));for(const e of n)this.#M(e);return t}getAddDimensionLabel(){return this.#u.get("Visualization.Requirements.AddDimension")}canColorBy(){return!1}}var Bj={exports:{}};!function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ae});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function v(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(v("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(v("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),p=c(r[1],i),f=h(0),m=h(1),g=y(d,f),v=y(p,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),p=h(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var I=t().bind(null,!0),D={},P=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function k(e,t){var n=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){k(e[r],t[r])||(n=!1)}),n);if(P(e)&&P(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?I({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||L(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):R(o)&&R(a)?r=r.concat(D.generate(a,o,s)):P(o)&&P(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(k(t,i))return r;if(!M(t[0])&&M(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){M(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},D.apply=function(e,t){t.forEach(function(t){var n,r,i=A(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(P(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(P(a)&&P(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(a)&&R(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]}),I(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=A(e,t.from);P(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(P(i)?i.splice(+o,1):delete i[o])})},D.clone=function(e){return I({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):I(e,t)};const O=D,q=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var T="accumulation";function N(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===T)return n[r]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===T)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),p=w.getAboveComp(n,l,c,d),f=w.getRangeComp("RangeSum",p);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(f,h,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=N(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=N(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(T))return!1;var o=N(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function $(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const H={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,p=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(r,u),h=w.getAboveComp(r,u,p,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:r,properties:i,layout:a})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=W(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=W(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var B="timeSeriesDecomposition";function G(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function U(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?w.generateTSDExpression(n,t,r):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=w.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(U(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(U(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=G(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=G(t,e);return n&&!n.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=G(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,c),p="".concat(c," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(p,f,h);p=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return p},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,p=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),d=ue(i,o,a),p=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(p,"))")}(c,d,n.field,n.value,p,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",pe="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,pe)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:pe},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ve="qDef.qDef",ye="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Ce="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Ie="qDef.qAggrFunc",De="qDef.base.qAggrFunc",Pe={initBase:function(e,t){(t||Pe.isValid(e))&&(n(e,ye,o(e,ve)),n(e,xe,o(e,be)),n(e,Ce,o(e,Se)),n(e,Ee,o(e,we)))},restoreBase:function(e){Pe.isValid(e)&&(n(e,ve,o(e,ye)),n(e,be,o(e,xe)),n(e,Se,o(e,Ce)),n(e,we,o(e,Ee)),o(e,Ie)&&o(e,De)&&n(e,Ie,o(e,De)),delete e.qDef.base)},isValid:function(e){var t=o(e,ye),n=o(e,xe);return void 0!==t||void 0!==n}};const Re=Pe;function Me(e){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(e)}var Le={accumulation:F,movingAverage:H,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ae={modifiers:Le,apply:Oe,applyModifiers:qe,cleanUpMeasure:Te,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:Ne,getActiveModifier:_e,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ue({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var ke={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;ke[n.id]=ke[n.id]||{isFirstTime:!0};var u=ke[n.id].isFirstTime;if(ke[n.id].isFirstTime=!1,r&&"object"===Me(r))return qe({model:n,properties:r});var c=n?n.layout:void 0,d=o(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var p=o(c,"qHyperCube.qMeasureInfo"),f=ke[n.id].lastReloadTime;if(ke[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Ne({measures:p,layout:c})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ge({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:p,layout:c,model:n,lastReloadTime:f});return h||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ue({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:p,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);$e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ke({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(n++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&He(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),qe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Me(e.base)})}(p)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Te(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function qe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),$e(i);var p=Qe(i);return et({model:n,libraryIds:p,masterItem:u}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Ne({measures:n,properties:r}))return n.forEach(function(e){return Te(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ue({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(n)||Re.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Te(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Te(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Ne(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:ze(e),properties:n,layout:r})})}function _e(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function je(e){var t=_e(e);return!t||Le[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function $e(e){Fe(e).forEach(function(e){return function(e){var n=_e(e);n&&(void 0!==n.outputExpression&&We(n)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function He(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=He(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,n=e.properties,r=e.layout;return!Be(t)&&Ue({modifiers:ze(t),properties:n,layout:r})}function Ue(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):q(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ue({modifiers:r,properties:e})){var o=Be(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>$e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var p=n(8),f=n.n(p);const h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},v=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},y=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),w=n.n(S);function C(e,t){var n=w()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function E(e,t){return w()(!0,{},t,e)}function I(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var D=Math.pow(2,53)-1;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const M=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},A=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},k=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},q=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=C(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=C(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},T=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=E(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=E(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},N=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=I(a.max,i.dimensions.length,D),l=I(a.min,i.dimensions.length,0);return{maxDimensions:I(o.max,s,D),minDimensions:I(o.min,l,0),maxMeasures:s,minMeasures:l}},_=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=w()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return P(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return R(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function H(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const B={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,v({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),y({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,p=void 0===d||d,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:u}),v=o.getValue(r,u||"").qHyperCubeDef,y=o.getValue(g,u||"").qHyperCubeDef,b=N({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,C=b.minMeasures,E=l.defaultDimension,I=void 0===E?k():E,D=l.defaultMeasure,P=void 0===D?O():D;y.qDimensions.length=0,y.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C})&&z({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C,newHyperCubeDef:y}),q({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:y,defaultDimension:I}),T({exportFormat:t,maxMeasures:w,minMeasures:C,newHyperCubeDef:y,defaultMeasure:P}),W({newProperties:g,dataDefinition:a,hypercubePath:u}),$({newProperties:g,dataDefinition:a,hypercubePath:u}),_({exportFormat:t,newHyperCubeDef:y}),L("qMaxStackedCells",v,y),L("qNoOfLeftDims",v,y),A("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",v,y,"S"),A("qReductionMode",v,y,"N"),A("qSortbyYValue",v,y),A("qIndentMode",v,y),A("qShowTotalsAbove",v,y),M(g,t,r),m.qProperty=g;var R=o.getValue(c||{},"support.modifiers");return V({measures:y.qMeasures,modifierTypes:R}),p&&H(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&H(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function Y(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!G[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(U(a,t,r,i),Y(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),p=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:p});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:p})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},pe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},he=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ve={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=B.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=B.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,p=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ue(d,p),v=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:v,properties:d})&&he(d):me(d),v&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),pe(f),c}};var ye=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?H(n,"unsupportedAutoMinMax")||w()(n.measureAxis,t.measureAxis):H(n,"supportedAutoMinMax")||w()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ye.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&w()(s,n.properties.measureAxes[t[0].axis])):w()(s,n.properties.measureAxes[0])}},Se=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},we={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ve.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ve.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Ce(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Ce(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ie(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Ce(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var De="qHyperCubeDef.qMeasures",Pe="conditionalColoring",Re="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ee({properties:e,arrayPath:De,quarantineName:Pe,arrayName:Re,itemPath:Me})},unquarantine:function(e){Ie({properties:e,arrayPath:De,itemPath:Me,arrayName:Re,quarantineName:Pe})}};var Ae="qHyperCubeDef.qMeasures",ke="measures",Oe="qHyperCubeDef.qDimensions",qe="dimensions",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Ne="alternativeMeasures",_e="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const We={quarantine:function(e){Ee({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ee({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},unquarantine:function(e){Ie({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ie({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ee({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Ie({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ie({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})}},$e={hypercube:B,colorChart:ve,axisChart:we,quarantineProperty:x,unquarantineProperty:H,quarantineArrayProp:Ee,unquarantineArrayProp:Ie,conditionalColoring:Le,conditionalShow:We}})(),r.default})()}(Bj);var Gj=Er(Bj.exports);const Uj="qHyperCubeDef.qMeasures",Yj="measures",Kj="qHyperCubeDef.qDimensions",Xj="dimensions",Jj="qDef.representation",Zj="tableRepresentation",Qj="qDef.conditionalColoring",eF="conditionalColoring",tF="qMiniChartDef",nF="miniChartDef",rF=e=>{Gj.unquarantineArrayProp({properties:e,arrayPath:Kj,itemPath:Jj,arrayName:Xj,quarantineName:Zj}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Jj,arrayName:Yj,quarantineName:Zj}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Qj,arrayName:Yj,quarantineName:eF}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:tF,arrayName:Yj,quarantineName:nF})},iF=e=>{Gj.quarantineArrayProp({properties:e,arrayPath:Kj,itemPath:Jj,arrayName:Xj,quarantineName:Zj}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Jj,arrayName:Yj,quarantineName:Zj}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Qj,arrayName:Yj,quarantineName:eF}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:tF,arrayName:Yj,quarantineName:nF})};function oF(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(i)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}const aF="qHyperCubeDef.qDimensions",sF="dimensions",lF="qOtherTotalSpec.qTotalMode",uF="totalMode",cF={quarantine(e){Gj.quarantineArrayProp({properties:e,arrayPath:aF,quarantineName:uF,arrayName:sF,itemPath:lF})},unquarantine(e){Gj.unquarantineArrayProp({properties:e,arrayPath:aF,quarantineName:uF,arrayName:sF,itemPath:lF})}};function dF(e){const t=oF(e);return(e,n,r,i)=>{const o=Gj.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),a=o.qProperty.qHyperCubeDef.qDimensions.length,s=o.qProperty.qHyperCubeDef.qMeasures.length;let l,u=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,c=!0;a+s===u.length&&N_(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",u.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(u=d,l=[...d],N_(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",u),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):u.length=0;const p=+(u.indexOf(-1)>-1),f=a+p;if(f>u.length)for(let e=u.length;e<f;e++)u.indexOf(e)<0&&u.push(e-p);for(let e=u.length-1;e>=0;e--)u[e]>=a&&u.splice(e,1);s>1&&u.indexOf(-1)<0?u.push(-1):s<2&&u.indexOf(-1)>-1&&u.splice(u.indexOf(-1),1);const h=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===h&&N_(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===u.length){for(let e=0;e<l.length;e++)if(l[e]!==u[e]){c=!1;break}c&&(Gj.unquarantineProperty(o.qProperty,"noOfLeftDims"),Gj.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return Gj.unquarantineProperty(o.qProperty,"rankedList"),Gj.conditionalShow.unquarantine(o.qProperty),cF.unquarantine(o.qProperty),rF(o.qProperty),Gj.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function pF(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=Gj.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=o.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let u=a.qInterColumnSortOrder;N_(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),Gj.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims,Gj.quarantineProperty(o.properties,"qHyperCubeDef.rankedList","rankedList"),delete o.properties.qHyperCubeDef.rankedList;const c=o.properties.qLayoutExclude.quarantine?.interColSortOrder;c&&(u=c,N_(o,"properties.qHyperCubeDef.qInterColumnSortOrder",u),N_(o,"data.0.interColumnSortOrder",u),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=u.length;e<s+l;e++)u.length<=e&&u.push(e);return Gj.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),Gj.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),Gj.conditionalShow.quarantine(o.properties),cF.quarantine(o.properties),iF(o.properties),o}const fF=e=>({dimensions:{min:1,max:1e3,description(t,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(i)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),hF={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let mF=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e}({}),gF=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const vF=e=>{switch(e?.type){case"url":return mF.Link;case"image":return mF.Image;case"indicator":return mF.Indicator;case"miniChart":return mF.MiniChart;default:return mF.Text}},yF=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),bF=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>vF(e.qDef.representation)===mF.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:a}=n.properties.qHyperCubeDef;let s=!1;r?.indexOf(-1);const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},xF=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:yF({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>vF(e.qDef.representation)===mF.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>vF(e.qDef.representation)===mF.Link&&e.qDef.representation?.urlPosition===gF.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>vF(e.qDef.representation)===mF.Link&&e.qDef.representation?.urlPosition===gF.Attribute},...bF(n)}},SF=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[mF.Image],o=!r?.("qMiniChartDef")&&t[mF.MiniChart],a=!r?.("tableIndicators")&&t[mF.Indicator],s=i&&t[mF.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&s)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>vF(e.qDef.representation)===mF.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:a?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let wF=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),CF=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),EF=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),IF=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const DF="image",PF=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},RF=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:xT.Auto,translation:"Common.Auto"},{value:xT.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:xT.Pixels,translation:"Object.Table.Column.Pixels"},{value:xT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:xT.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PixelsDefault,show:e=>e.qDef.columnWidth?.type===xT.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PercentageDefault,show:e=>e.qDef.columnWidth?.type===xT.Percentage}}),MF=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==DF},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==DF)}}},LF="TOTAL_OFF",AF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:CF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:CF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},kF="TOTAL_OFF",OF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:CF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:CF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},qF=e=>{const{translator:t,anything:n,flags:r}=e,i=(e=>{const{translator:t,anything:n}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:LF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:LF,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&PF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==LF&&PF(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:AF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...xF(e),...RF()}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:AF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...SF(e,{[mF.Image]:!0,[mF.Indicator]:!0}),...RF()}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e);return r.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?i:{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Property.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:kF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:kF,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&PF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==kF&&PF(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:OF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...xF(e),...RF()}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:OF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...SF(e,{[mF.Image]:!0,[mF.ImagesInIndentMode]:!0,[mF.Indicator]:!0}),...RF()}},filters:{type:"items",translation:"SimpleProperties.Filters.Filters",ref:"filters",allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:"properties.filters.add",grouped:!0,items:{filter:{type:"object",component:"filter-item",ref:"filter"}}}}}},TF=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,a=i.theme.current(),s=n(a,o);return{color:"transparent"===s?"none":s}}}),NF=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},_F=({ref:e,themeAccessor:t,translator:n,flags:r})=>({component:"dropdown",ref:e,options:(e,i,o)=>{const a=o.theme.current();return((e,t,n,r)=>{const i=t.fontFamily??"Source Sans Pro, sans-serif",o=t.fontFamilies??[],a=Array.from(new Set([e,i,...o])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...a.sort().map(e=>NF(e,!0))],l=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...TN(r).filter(e=>!a.includes(e)).map(e=>NF(e,!0))];return[...s,...l.length>1?l:[]]})(t(a),a,n,r)},defaultValue:(e,n,r)=>t(r.theme.current())}),jF=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],FF=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),a=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>NF(e,!1))],s=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...jF.filter(e=>!o.includes(e)).map(e=>NF(e,!1))];return[...a,...s.length>1?s:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),zF=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:a})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:_F({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n,flags:r}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:FF({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:TF(`${e}.fontColor`,void 0,t=>i(t,e,"color")??t.color)}},background:TF(`${e}.background`,"properties.background",(t,n)=>{const r=n?oN.WHITE:oN.TRANSPARENT;return i(t,e,"backgroundColor")??r},a)}}}}),WF=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r})=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:TF(`${e}.fontColor`,void 0,t=>r(t,e,"color")??t.color)}},background:TF(`${e}.background`,"properties.background",t=>r(t,e,"backgroundColor")??n??"transparent")}}}}),$F=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map(e=>({value:e+1,translation:e+1})),defaultValue:1}),VF="12px",HF="Source Sans Pro, sans-serif",BF="600",GF=15e3,UF=4/3;let YF=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),KF=function(e){return e.Solid="solid",e.None="none",e}({});const XF={display:"flex",justifyContent:"center",alignItems:"center"},JF={borderStyle:"solid"},ZF={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},QF={lineHeight:UF,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},ez=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),tz=(e,t)=>e>0?`${e}px ${KF.Solid} ${t}`:KF.None,nz=(e,t,n,r,i)=>{const o=Number(!t||i?.right),a=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?tz(o,n):KF.None,borderBottom:tz(a,n),borderLeft:"rtl"===r?tz(o,n):KF.None,borderTop:KF.None}},rz=(e,t,n,r,i,o,a)=>{const s=nz(t,r,i,o,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=tz(2,i)),n||(s.borderLeft="rtl"!==o?tz(1,i):"none",s.borderRight="rtl"===o?tz(1,i):"none")),s},iz=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=tz(1,n)),t&&(r.borderRight=tz(1,n)),r},oz=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},az=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:zF({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:oz}),dimensionValueSection:zF({section:"dimensionValues",translator:e,flags:t,getThemeValue:oz}),measureValueSection:zF({section:"measureValues",translator:e,flags:t,getThemeValue:oz}),measureLabelSection:WF({section:"measureLabels",getThemeValue:oz}),totalValuesSection:WF({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:oz}),nullValuesSection:WF({section:"nullValues",fallbackBackground:YF.NullValueBackground,getThemeValue:oz}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:$F("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:$F("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:TF("grid.border","properties.border",e=>e.object?.pivotTableV2?.grid?.borderColor??YF.DividerLight),divider:TF("grid.divider","properties.pivot.divider",e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??YF.DividerDark),background:TF("grid.background","properties.background",e=>e.object?.pivotTableV2?.grid?.backgroundColor??YF.Transparent)}}}}}}]}),sz=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},lz=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[az(e,t),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:xT.Auto,translation:"Common.Auto"},{value:xT.Pixels,translation:"Object.Table.Column.Pixels"},{value:xT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:xT.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===xT.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===xT.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some(e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode)}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}]},...sz(t)}}),uz="auto",cz={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:uz,translation:"Object.Table.SortingInSearch",options:[{value:uz,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function dz(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:qF(e),sorting:cz,addons:hF,settings:lz(t,n)}}}function pz(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:dz(e),importProperties:dF(e),exportProperties:pF,exploration:Ij(e),data:fF(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new Hj(t,e.translator):void 0}}const fz=()=>{let e;return{promise:new Promise(t=>{e=t}),resolve:e}};function hz(e,t){return R(()=>e,t)}const mz={},gz=e=>{const t=R(()=>({current:mz}),[]);return t.current=t.current===mz?e:t.current,t},vz=e=>!!e&&0===bN(e).a,yz="#grid",bz=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},xz=(e,t,n,r,i)=>{const o=bz(".qv-object .qv-inner-object",n),a=bz(".qv-panel-sheet",n),s=bz(yz,n)??a,l=(e=>{const t=e.components?.find(e=>"general"===e.key),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return K_(n);if("none"===r)return"transparent";if(void 0===r)return;const o=bN(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),u=r?.(t),c=i?.(t),d=l||u||o||c,p=vz(d),f=!vz(h=p?s:d)&&G_(h,oN.TEXT,oN.DARK_MODE_TEXT)===fN(oN.DARK_MODE_TEXT);var h;const m=((e,t,n,r=oN.WHITE)=>e&&!vz(e)?e:vz(t)?n&&!vz(n)?n:r:t)(l,d,s);return{color:d,headerColor:m,isDark:f}},Sz=(e,t,n,r)=>{const i=O(),o=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[n,r]=A([]);return k(()=>{let n;return e&&(n=new MutationObserver(e=>{r(e)}),n.observe(e,t)),()=>{n?.disconnect()}},[e,t]),n})(t.closest(yz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter(({oldValue:e})=>e?.includes("background")).map(({oldValue:e})=>e).join(",");return R(()=>({...i,background:xz(e,i,t,n,r)}),[i.name(),t,n,r,e,o])};function wz(e,t){const n=R(()=>({isLoading:!0}),t),[r,i]=L(async()=>{try{return await e()}finally{n.isLoading=!1}},t);return[r,n.isLoading,i]}const Cz=3,Ez=/\n/g;function Iz(e,t,n){let r=0,i=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),a=e.slice(0,o),s=e.slice(0,o-1),l=n(a),u=n(s);if(l>t&&u<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function Dz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=Cz,allowLineBreaks:a=!0}=i??{},{estimateWidth:s,measureText:l,estimateLineCount:u}=v(()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i)=>{const{maxNbrLinesOfText:o=Cz,allowLineBreaks:a=!0}=i??{};return()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const s=i.measureText.bind(i),l=__(e=>{if(void 0===e)return 0;if(a){const t=e.split(Ez).map(e=>s(e).width);return t.reduce((e,t)=>t>e?t:e,0)}const t=e.replace(Ez," ");return s(t).width}),u=e=>+l(e).toFixed(2),c=__(({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;const r=a?e.split(Ez):[e];let i=0;for(const e of r){let n=e;do{i+=1,n=Iz(n,t,u)}while(null!==n&&i<o);if(i>=o)break}return i},({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`);return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:c}}})({fontStyle:n,fontWeight:r,fontSize:e,fontFamily:t},{maxNbrLinesOfText:o,allowLineBreaks:a})(),[n,r,e,t,o,a]);return{estimateWidth:s,measureText:l,estimateLineCount:u}}var Pz,Rz=E;Pz=Rz.createRoot,Rz.hydrateRoot;const Mz="Source Sans Pro, sans-serif";function Lz(e,t){const[n,r]=m(t);n.some((e,n)=>e!==t[n])&&(r(t),e())}var Az={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const kz=({translator:e})=>(v(()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(Az).forEach(t=>{e.add(Az[t])})}}(e)},[e]),e),Oz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},qz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},Tz=fl("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...Oz},"&::-moz-range-track":{...Oz},"&::-ms-track":{...Oz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...qz},"&::-moz-range-thumb":{...qz},"&::-ms-thumb":{...qz},"&:hover:not(:focus, :active)":{"&::after":{backgroundColor:t||"#D9D9D9","@media (hover: none)":{backgroundColor:"none"}}},"&:focus-visible, &:active":{"&::after":{backgroundColor:"#177fe6",borderLeft:"1px solid #fff",borderRight:e?void 0:"1px solid #fff"}},"&::after":{content:'""',height:"100%",width:"3px",position:"absolute"}})),Nz=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:u,isLeftColumn:c,accessibilityRelatedArgs:d,direction:p="ltr"})=>{const f=kz({translator:d.translator}),h=l({initWidth:e,columnWidth:e,initX:0}),m=n?0:1,g=r&&!c,v=()=>g?h.current.columnWidth-m:"100%",y={left:"rtl"!==p?v():void 0,right:"rtl"===p?v():void 0},b=t=>{h.current={initWidth:e,columnWidth:e,initX:t??h.current.initX}};Lz(()=>{g&&b()},[e]);const x=e=>{const t=Math.max(e,bT.PixelsMin);h.current.columnWidth=t,o(t)},S=()=>{if(h.current.columnWidth!==h.current.initWidth){const e={type:xT.Pixels,pixels:h.current.columnWidth};a(e)}u?.(!1)},w=e=>{const t="rtl"===p?h.current.initWidth+h.current.initX-e.clientX:h.current.initWidth+e.clientX-h.current.initX;x(t)},C=e=>{X_(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S()},E=e=>{const t="rtl"===p?h.current.initWidth+-h.current.initX-e.touches[0].clientX:h.current.initWidth+e.touches[0].clientX-h.current.initX;x(t)},I=e=>{X_(e),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",I),S()},D=!r&&s?e=>{if(e.key===vT.Left||e.key===vT.Right){X_(e);const t=5,n=e.key===vT.Left?t:-t,r="rtl"===p?n:-n;u?.(!0),x(h.current.columnWidth+r)}else e.key===vT.Space||e.key===vT.Enter?(X_(e),s(e),u?.(!1),S()):e.key===vT.Esc&&(X_(e),s(e),u?.(!1),x(h.current.initWidth))}:void 0,P=f.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return io.jsx(Tz,{style:y,hoverColor:i,isLastColumn:n,className:yT,"data-testid":yT,onMouseDown:e=>{X_(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:xT.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(X_(e),document.addEventListener("touchmove",E),document.addEventListener("touchend",I),u?.(!0),b(e.touches[0].clientX))},onKeyDown:D,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":P,"aria-valuemin":bT.PixelsMin,"aria-valuemax":bT.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:p},t)},_z=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})})),jz=fl(Qu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"})),Fz=fl(_z,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),zz=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),Wz=fl(Uc)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),$z=fl(bp)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),Vz=fl(bp,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"})),Hz=fl("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),Bz=fl("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),Gz=fl(mu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),Uz=fl(Wd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),Yz=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})})),Kz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?Kz(t):t:e.parentElement?.children?.[0]},Xz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?Xz(t):t},Jz=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===vT.Down||t===vT.Up){const n=e=>t===vT.Down?Kz(e):Xz(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},Zz=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(n)}}:{}}))})));let Qz={};const eW=({autoFocus:e,id:t,onClick:r,itemTitle:i,icon:o,enabled:a,subMenus:s,isSubMenu:l,isActive:u,direction:c,isPagination:d})=>{const[p,h]=m(!1),g=n.useRef(null),v=f(e=>{e.stopPropagation(),h(!1)},[h]);return io.jsxs(io.Fragment,{children:[io.jsxs(Vz,{ref:s?g:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(r&&(await r(e),Qz={}),s?.length&&(h(!0),Qz[i]=h,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!u,onKeyDown:Jz,children:[u?io.jsx(Hz,{direction:c,isPagination:d}):null,io.jsxs(Bz,{children:[io.jsx(Uz,{direction:c,isPagination:d,children:io.jsx(o,{})}),io.jsx(Gz,{variant:"body2",children:i})]}),s?.length?io.jsx(Yz,{}):null]},t),s?.length?io.jsx(iW,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:v,menuGroups:Zz(s,Qz),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:d}):null]})},tW=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(e=>[[e.groupHeading&&io.jsx($z,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>io.jsx(eW,{...e,isSubMenu:t,direction:n,isPagination:r},e.id))].filter(Boolean)]),nW=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((i,o)=>[tW({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?io.jsx(Wz,{"data-testid":"group-divider",variant:"middle"}):void 0]),rW={appear:0,enter:0,exit:0},iW=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?io.jsx(zz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:rW,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:nW({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,oW=(e,t)=>e.some(e=>t[e]>0),aW={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},sW=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=m(null),[a,s]=m(aW);return Lz(()=>{e||(s(aW),o(null))},[e]),d(()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),u=await r.createSessionObject(e),c=await u.getLayout(),{qStateCounts:d}=c.qListObject?.qDimensionInfo??{};i=c.qInfo?.qId,a?l():(o(u),d&&s((e=>({canSelectAll:oW(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:oW(["qSelected"],e),canSelectPossible:oW(["qOption"],e),canSelectAlternative:oW(["qAlternative"],e),canSelectExcluded:oW(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},lW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3.5 1.793 6.207 4.5l-.707.707-1.5-1.5V14H3V3.707l-1.5 1.5L.793 4.5zM8 4h5v1H8zm0 3h6v1H8zm0 3h7v1H8z"})})),uW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm9 1.5H6v-1h4zm5.354-8.646L12.707 10l2.646 2.646-.707.707L12 10.708l-2.646 2.646-.708-.707L11.293 10 8.646 7.354l.708-.708L12 9.293l2.646-2.647zM1 10H0V6h1zm2-9H1.5a.5.5 0 0 0-.5.5V3H0V1.5A1.5 1.5 0 0 1 1.5 0H3zm11.5-1A1.5 1.5 0 0 1 16 1.5V3h-1V1.5a.5.5 0 0 0-.5-.5H13V0zM10 1H6V0h4z"})})),cW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3.914 8h8.207L10.5 6.379l.707-.708L14.036 8.5l-2.829 2.828-.707-.707L12.12 9H3.914l1.621 1.621-.707.707L2 8.5l2.828-2.828.707.707zM15 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 13V2h-2v3h-1V2H4v3H3V2H1v12h2v-2h1v2h8v-2h1v2z"})})),dW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 2h1v10.293l1.5-1.5.707.707L3.5 14.207.793 11.5l.707-.707 1.5 1.5zm12 2H8v1h7zM8 7h6v1H8zm5 3H8v1h5z"})})),pW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8z"})})),fW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8zM8.5 4v8h-1V4z"})})),hW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7"})})),mW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9.057 11.164a6 6 0 1 1 2.112-2.116 1 1 0 0 1 .052.044l4.176 4.08a1 1 0 0 1 .009 1.422l-.707.707a1 1 0 0 1-1.406.008l-4.185-4.087a1 1 0 0 1-.05-.058ZM10.5 6a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0"})})),gW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 4v1H1v10h10v-2h1v2a1 1 0 0 1-.883.993L11 16H1a1 1 0 0 1-.993-.883L0 15V5a1 1 0 0 1 .883-.993L1 4zm12-4a1 1 0 0 1 .993.883L16 1v10a1 1 0 0 1-.883.993L15 12H5a1 1 0 0 1-.993-.883L4 11V1a1 1 0 0 1 .883-.993L5 0zm0 1H5v10h10zm-2.36 2.653.72.694L9.143 8.72 6.64 6.125l.72-.694L9.143 7.28z"})})),vW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8l8-8zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),yW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 3h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),bW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8h8V4zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),xW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})}));let SW=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const wW="/qListObjectDef",CW=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:u,focusColumnAdjuster:c,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(n[SW.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:lW,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:dW,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:hW,subMenus:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:uj,isActive:e.groupDimensionPos===n}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&o?.select){const i=[];n[SW.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:mW,enabled:!0}]}]),!e.isLocked&&n[SW.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:xW,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(wW))},icon:gW,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(wW))},icon:bW,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(wW))},icon:vW,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(wW))},icon:yW,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(wW))},icon:uW,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.expandCallback()},icon:fW,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.collapseCallback()},icon:pW,enabled:!0}]}]),i.length>0&&f.push(...i)}return n[SW.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),c?.(u)},icon:cW,enabled:!0}]}]),f},EW=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:u,searchRelatedArgs:c,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:h,model:m,direction:g="ltr",isPagination:v,isAccessibleHeader:y,iconSize:b=hT})=>{const x=l(null),S=kz({translator:i}),{qLibraryId:w,fieldId:C,headTextAlign:E}=r,I=d?.app,{fieldInstance:D,selectionActionsEnabledStatus:P}=sW({open:e,headerData:r,app:I,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:r}),M=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>f(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}},[e,t,n,r?.qStateName,i,o]))({qLibraryId:w,fieldId:C,searchRelatedArgs:c,selectionRelatedArgs:d,direction:g}),L=f(e=>{e.stopPropagation(),t(!1)},[t]),A=f(e=>{e.stopPropagation(),t(e=>!e)},[t]);return o.active?io.jsxs(jz,{rightAligned:"right"===E,shouldShowMenuIcon:s,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===y?A:void 0,ref:x,isAccessibleHeader:y,children:[s?io.jsx(Fz,{height:b,className:mT,"data-testid":mT,isInteractionsActive:o.active??!1,children:io.jsx(_z,{})}):null,io.jsx(iW,{open:e,anchorEl:!1===y?x.current:n.current,onClose:L,menuGroups:CW({headerData:r,translator:S,menuAvailabilityFlags:a,setOpen:t,...u,embedListbox:M,interactions:o,fieldInstance:D,selectionActionsEnabledStatus:P,anchorRef:n,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:h}),direction:g,isPagination:v})]}):null},IW=e=>e.isDark?{background:e.color,borderColor:oN.DARK_MODE_BORDER,color:oN.DARK_MODE_TEXT,disabledColor:oN.DARK_MODE_DISABLED,iconColor:oN.DARK_MODE_TEXT}:{background:e.color,borderColor:oN.BORDER_MEDIUM,color:oN.TEXT,disabledColor:oN.DISABLED},DW=fl(Qu,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",padding:t.spacing(0,1,0,1),color:e.color,background:e.background,borderTop:`1px solid ${e.borderColor}`})),PW=fl(Qp,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),RW=fl(uc,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)})),MW=fl(mu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),LW=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=v(()=>IW(r.background),[r]);if(!n.active)return null;const a=i?io.jsx(DW,{footerStyle:o,children:e}):null;return t?E.createPortal(e,t):a},AW=u({}),kW=()=>h(AW),OW=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(c)?0:-1,b=v(()=>IW(p.background),[p]),x=i?i.getBoundingClientRect().width:h.width,S=kz({translator:d}),w=v(()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:S,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:x,visibilityThreshold:g}),[t,n,r,i,o,a,s,l,u,c,S,p,f,h,m,b,y,x,g]);return io.jsx(AW.Provider,{value:w,children:e})};let qW=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),TW=function(e){return e[e.DisplayedRowsLabel=250]="DisplayedRowsLabel",e[e.FirstPage=350]="FirstPage",e[e.LastPage=350]="LastPage",e[e.RowsPerPage=550]="RowsPerPage",e[e.SelectPage=700]="SelectPage",e}({});const NW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})),_W=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})})),jW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})})),FW={FirstPage:_W,PreviousPage:NW,NextPage:Yz,LastPage:jW,FirstPageRTL:jW,PreviousPageRTL:Yz,NextPageRTL:NW,LastPageRTL:_W},zW=({disabledCondition:e,pageNumber:t,type:n})=>{const{direction:r,footerStyle:i,handleChangePage:o,translator:a,interactions:s,tabIndex:l}=kW(),u=n.concat("rtl"===r?"RTL":""),c=FW[u];return{styledProps:{footerStyle:i,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:l,onClick:e?void 0:()=>{o(t)}},IconComponent:c}},WW=()=>{const{pageInfo:e,width:t,interactions:n,visibilityThreshold:r}=kW(),i=0===e.page,{IconComponent:o,styledProps:a}=zW({type:qW.FirstPage,disabledCondition:i,pageNumber:0});return t<=(r?.firstPage||TW.FirstPage)?null:io.jsx(RW,{...a,disabled:!n.active,children:io.jsx(o,{height:hT})})},$W=(e,t,n=!1)=>{n&&e.key===vT.Tab&&!e.shiftKey&&(X_(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},VW=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o,visibilityThreshold:a}=kW(),s=e.page>=n-1,{IconComponent:l,styledProps:u}=zW({type:qW.LastPage,disabledCondition:s,pageNumber:n-1}),c=t.enabled?e=>{$W(e,t,r)}:void 0;return i<=(a?.lastPage||TW.LastPage)?null:io.jsx(RW,{...u,onKeyDown:c,disabled:!o.active,children:io.jsx(l,{height:hT})})},HW=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o}=kW(),a=e.page>=n-1,{IconComponent:s,styledProps:l}=zW({type:qW.NextPage,disabledCondition:a,pageNumber:e.page+1}),u=!(i>TW.FirstPage&&i>TW.LastPage)&&t.enabled?e=>{$W(e,t,r)}:void 0;return io.jsx(RW,{...l,onKeyDown:u,disabled:!o.active,children:io.jsx(s,{height:hT})})},BW=()=>{const{pageInfo:e,interactions:t}=kW(),n=0===e.page,{IconComponent:r,styledProps:i}=zW({type:qW.PreviousPage,disabledCondition:n,pageNumber:e.page-1});return io.jsx(RW,{...i,disabled:!t.active,children:io.jsx(r,{height:hT})})},GW=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=kW(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||TW.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return io.jsx(MW,{variant:"caption",dir:"ltr",children:s})},UW=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=kW(),u=i.qInfo.qId,c=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${u}`,f={tabIndex:s,id:`${d}-${u}`,"data-testid":d,"aria-labelledby":p};return io.jsxs(io.Fragment,{children:[io.jsxs(MW,{variant:"caption",id:p,children:[c,":"]}),io.jsx(PW,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:f,disabled:!l.active,children:n})]})},YW=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=kW();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||TW.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=io.jsx(io.Fragment,{children:e.rowsPerPageOptions.map(e=>io.jsx("option",{value:e,children:e},e))});return io.jsx(UW,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},KW=1e3,XW="…",JW=({totalPages:e,page:t})=>{const n=Math.min(e,KW),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-KW):0,a=Array.from(Array(n).keys()).map(e=>{const t=e+o;return io.jsx("option",{value:t,children:t+1},t)});return o>0&&a.unshift(io.jsx("option",{value:XW,disabled:!0,children:XW},"startMoreOptions")),i<e-1&&a.push(io.jsx("option",{value:XW,disabled:!0,children:XW},"endMoreOptions")),io.jsx(io.Fragment,{children:a})},ZW=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=kW(),{page:o}=e;if(t<=(i?.selectPage||TW.SelectPage))return null;const a=io.jsx(JW,{totalPages:n,page:o});return io.jsx(UW,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})};var QW=b(e=>io.jsxs(OW,{...e,children:[io.jsx(YW,{}),io.jsx(ZW,{}),io.jsx(GW,{}),io.jsx(WW,{}),io.jsx(BW,{}),io.jsx(HW,{}),io.jsx(VW,{})]}));const e$=e=>io.jsx(LW,{...e,children:io.jsx(QW,{...e})}),t$=u({}),n$=()=>h(t$),r$=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const a=v(()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i}),[e,t,n,r,i]);return io.jsx(t$.Provider,{value:a,children:o})},i$=u({}),o$=()=>h(i$),a$=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:a,env:s,children:l})=>{const u=v(()=>({model:t,app:e,interactions:a,embed:r,theme:n,keyboard:i,env:s,translator:o}),[e,a,t,r,n,i,s,o]);return io.jsx(i$.Provider,{value:u,children:l})},s$=u({}),l$=()=>h(s$),u$=({children:e,...t})=>io.jsx(s$.Provider,{value:t,children:e}),c$=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=o$(),{layoutService:n}=l$(),r=e.getStyle("","","fontFamily")??HF;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:io.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:io.jsx("span",{style:{...QF,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},d$="/qHyperCubeDef",p$=-1,f$="PSEUDO-DIM",h$=e=>e===p$?f$:(({cId:e})=>e??_j())(e),m$=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===p$?n.columnWidthLocation=wF.Measures:n.isLeftDimension?n.columnWidthLocation=wF.Dimension:t.at(-1)===p$?n.columnWidthLocation=wF.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=wF.Pivot))},g$=(e,t,n,r)=>{const i=h$(n),o=e.getDimensionInfoIndex(n),a=e.isLeftDimension(o);return n===p$?{id:i,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:wF.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:i,colIdx:0,label:n.qFallbackTitle??"",qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===CT.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:wF.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName}},v$=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})=>{let i=r;var o;n.length>0&&(i=(o=r).at(-1)===p$?o.slice(0,-1):o);const a=i.length+(n.length?1:0),s=Math.max(1,n.length),l=((e,t)=>Array(e).fill(null).map(()=>Array.from({length:t},()=>null)))(a,s);return n.forEach((n,r,i)=>{const o=r===i.length-1;l[a-1][r]=g$(e,t,n,o)}),i.forEach((n,r,i)=>{const o=r===i.length-1;l[r][s-1]=g$(e,t,n,o)}),l},y$=(e,t,n,r)=>{const i=((e,t,n,r)=>{let i;return i=0===n.length||n.includes(p$)?v$({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n}):(e=>e[0].map((t,n)=>e.map(e=>e[n])))(v$({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})),e.isIndentModeEnabled&&i[i.length-1].length>1&&(i[i.length-1]=[i.at(-1),...new Array(i[0]?i[0].length-1:0).fill(null)]),i.length&&i.at(-1)?.forEach((t,n)=>{Array.isArray(t)?t.forEach((t,n)=>{m$({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}):m$({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}),i})(e,t,n,r);return{data:i,size:{x:i[0]?.length??0,y:i.length}}};var b$={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:S$(e),value:S$(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}},x$=b$;function S$(e){try{return decodeURIComponent(e)}catch{return e}}function w$(e){if(!(this instanceof w$))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>x$.fromSearchString(t.search)}})}function C$(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/shouldNotDecodePlus/gi,"%2B")}w$.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},w$.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=C$(t.key),t.value?n+=`=${C$(t.value)}`:n+=t.useEqualSign?"=":"";return n};var E$=w$;var I$,D$=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},P$=class{decode(e){let t="";const n=new D$(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},R$=e=>e>=0&&e<=1114111,M$=e=>e.match(/[\s]/),L$=class extends P${decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!M$(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return R$(a)?String.fromCharCode(a):"�"}},A$=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,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},k$=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;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,r)}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 A$.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return A$.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||A$.newInstanceIfNeeded(e,t,this._value)}},O$=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 k$);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},q$=(()=>{const e=[],t=[],n=new O$;let r,i,o;for(r 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[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})(),T$=class extends P${decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,q$.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=q$.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&R$(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&R$(r)?String.fromCharCode(r):null}},N$=class extends P${decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),R$(o))?String.fromCharCode(o):(e.reset(),null)}},_$=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,j$=5e6,F$=5e5,z$=(e,t)=>{const{maxByteSizeSvg:n=F$,maxByteSizeImage:r=j$}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=_$.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r};"undefined"!=typeof document&&(I$=document.createElement("div"));var W$=Array.prototype.indexOf,$$=[",",".","_"," "],V$=[",",".","-","_"," "],H$={width:["%"],height:["%"]},B$={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},G$={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":B$.image,"background-color":B$.color,"border-color":B$.color,"border-image":B$.image,color:B$.color,icon:B$.image,"list-style-image":B$.image,"outline-color":B$.color},U$={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function Y$(e,t,n){let r;if(t){if(W$)return W$.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function K$(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return I$.appendChild(n),t=I$.innerHTML,I$.removeChild(n),t}function X$(e,t,n){let r,i,o,a,s,l,u,c,d;for(e=Z$(e).toLowerCase(),t=Z$(t),o=0;o<U$.attr_name.length;o++)if(e.match(U$.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<U$.attr_val.length;o++)if(t.toLowerCase().match(U$.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=H$[e],r||(r=V$),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&Y$(u,r)<0?(d=c.toString(16),i+=`&#x${d};`):i+=u;return n||(i+='"'),i}function J$(e,t,n){let r,i,o,a,s,l,u,c,d,p;if(e=Z$(e).toLowerCase(),t=Z$(t),Y$(e,U$.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<U$.css_val.length;r++)if(t.toLowerCase().indexOf(U$.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=G$[e],i||(i=B$.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&Y$(u,i)<0?(d=c.toString(16),p="000000".substr(d.length),o+=`\\${p}${d}`):o+=u;return o}function Z$(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new T$,new N$,new L$];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}var Q$=[];for(let e=0;e<255;e++)Q$[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var eV={html:e=>K$(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=J$(t,n[t],!0),o+=J$(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=X$(e,t[e],!0),i+=X$(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function tV(e,t){throw new Error(t)}var nV={canonicalize:Z$,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?eV.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&tV(this,"Invalid parameter type"),eV.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&tV(this,"Invalid parameter type"),eV.attr(e)):void tV(this,"Invalid parameter type")},encodeForAttr:X$,encodeForAttr2:function(e){return X$("nonsens",e,!0)},encodeForCSS:J$,encodeForHref:function(e){Z$(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new E$(e),n=E$.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+E$.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=$$),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),Y$(i,t)>=0||null==Q$[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:K$,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=Z$(t).toLowerCase():tV(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:z$,validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const rV=(e,t)=>t.qAttrExps?.qValues?.[e],iV=(e,t)=>{switch(e){case"topLeft":default:return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-start"};case"centerLeft":return{horizontal:"center",vertical:"flex-start"};case"bottomLeft":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-start"};case"topCenter":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"center"};case"centerCenter":return{horizontal:"center",vertical:"center"};case"bottomCenter":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"center"};case"topRight":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-end"};case"centerRight":return{horizontal:"center",vertical:"flex-end"};case"bottomRight":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-end"}}},oV=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>!r||t&&(t.toLowerCase().includes("javascript:")||!nV.isSafeDataURL(t))?{type:mF.Text,url:void 0,text:e,labelStructure:i}:{type:mF.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:iV(r,a),labelStructure:i,imageBox:o},aV=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:mF.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:mF.MiniChart,text:r,miniChart:a}},sV=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===gF.Attribute?void 0:n?.urlLabel},lV=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:mF.Link,url:nV.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:mF.Text,url:void 0,text:t,labelStructure:e}}},uV=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:u})=>{const c=vF(t),d=s(e);return c===mF.Image&&u[mF.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:u,imageBox:c}=t??{};if("url"===l){const t=rV(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),oV({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return oV({text:u||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i});const l=rV(n.imageLabel??-1,e)?.qText??r;return oV({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i})}return{type:mF.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,a):c===mF.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===gF.Attribute){const o=sV(n.url??-1,e,t);return lV({labelStructure:r,text:i||o||"",url:o})}if(o===gF.Dimension){const o=sV(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),lV({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:mF.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,a,d):c===mF.Indicator&&u[mF.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:mF.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):c===mF.MiniChart&&u[mF.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?aV(e,t,o,d):{type:mF.Text,url:void 0,text:d,labelStructure:a}},cV=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?K_(i):null,a=r?K_(r):null,s=((e,t)=>e||!t?null:G_(t))(a,o);return{color:s??a,background:o}},dV=(e,t)=>t.qSubNodes.reduce((e,t)=>0===t.qSubNodes.length?e+1:dV(e,t),e),pV=(e,t,n,r,i,o)=>{const a=i?o.rowsPerPage-n:GF-r;let s=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;s=e.qDown+n}return Math.min(a,dV(s,e))},fV=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:u=!0,isIndentModeEnabled:c=!1,indentLevel:d,labelStructure:p,env:f,pageInfo:h,direction:m="ltr"})=>{const g=(!c||!u)&&"P"===e.qType,v=((e,t)=>{if(e!==p$){if(t){const t=vF(e.representation);return t===mF.Link||t===mF.Image?e.representation:{type:mF.Text}}return e.representation}})(s,c),y=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let a=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:s}=r;a=i===mF.Link?"P"===e.qType?o:t:`${t} ${!s||!t&&s?"":n} ${s}`.trim()}return a})({node:e,isLeftColumn:u,isIndentModeEnabled:c,labelStructure:p,representationType:vF(v),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),b=uV({cell:{...e,qText:y},representationProperties:v,attrExprInfoIndex:l,env:f,labelStructure:p,direction:m,enabledFeatures:{[mF.Image]:!0,[mF.Indicator]:!0}}),x={id:_j(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:u?o:r,isLeftColumn:u,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:pV(e,i,o,r,u,h),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof s||!s.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:g,expressionColor:cV(l,e),selectionCellType:u?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!u,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},hV=(e,t,n,r,i,o,a,s,l)=>{const{isIndentModeEnabled:u}=i;if(!t.length)return e;let c=0;return function t(d,p,f,h=0,m=-1){e[h]||(e[h]={}),u&&m++;const g=i.leftDimensionInfoIndexes.indexOf(p$);f.forEach((f,v)=>{const y={originalValue:f.qText??"",maskedValue:"",delimeter:"-",suffix:""};c+=0===v?0:1;const b=n.qTop-r.page*r.rowsPerPage,x=Math.max(0,b+c-f.qUp),S=n.qTop+c-f.qUp;if(u){if(i.hasPseudoDimOnLeft&&m<=g)if(y.originalValue=f.qText??"",y.maskedValue=f.qText??"","N"===f.qType||"U"===f.qType||"T"===f.qType)"U"===f.qType&&(y.originalValue=i.getNullValueText()),m<g&&(y.suffix=i.visibleMeasureInfo[0].qFallbackTitle??"");else if("P"===f.qType){y.originalValue=(p||d)?.representation.labelStructure?.originalValue??"",y.maskedValue=(p||d)?.representation.labelStructure?.originalValue??"",y.suffix=f.qText??"";const e=f.qSubNodes;f={...(p||d)?.ref,...f.qText?{qText:f.qText}:{},qSubNodes:e},m=(p||d)?.indentLevel??0}"U"===f.qType&&(y.originalValue=i.getNullValueText())}let w=h;u&&(w=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===f.qSubNodes.length&&(w=0));const C=e.at(h)?.[x],E=u&&void 0===C?.ref.qText||!C?fV({node:f,parent:p,root:d,x:w,y:S,pageY:x,layoutService:i,dimensionInfo:o[w],attrExprInfoIndex:a[w],isLeftColumn:!0,...u&&{isIndentModeEnabled:u,indentLevel:m},env:s,pageInfo:r,labelStructure:y,direction:l}):e[h][x];if(e[h][x]=E,f.qSubNodes.length){const e=u?0:h+1;t(d||E,E,f.qSubNodes,e,m)}})}(null,null,t,0,-1),e},mV=(e,t)=>{e.slice(0,-1).forEach(e=>{Object.values(e).forEach((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)})})},gV=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],a=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},vV=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:a,direction:s})=>{const{qLeft:l,qArea:u}=t;if(!l.length)return e;const c=hV(e.grid,l,u,n,r,i,o,a,s);mV(c,n.rowsOnCurrentPage);const d=gV(c,r);return{...e,grid:c,columnCount:c.length,totalDividerIndex:d}},yV=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach((t,n)=>{t.forEach((t,o)=>{const a=e.qTop-r.page*r.rowsPerPage+n,s=e.qLeft+o;Array.isArray(i[a])||(i[a]=[]);const l="U"===t.qType;i[a][s]=i[a][s]??{id:_j(),ref:t,isNull:l}})}),i},bV=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?yV({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},xV=(e,t,n,r,i,o,a,s,l,u)=>{const{isIndentModeEnabled:c}=r;if(!t.length)return e;let d=0;!function t(a,p,f,h=0){e[h]||(e[h]={}),f.forEach((f,m)=>{d+=0===m?0:1;const g=n.qLeft+d-f.qUp,v=e[h][g]??fV({node:f,parent:p,root:a,x:g,y:h,pageY:h,layoutService:r,dimensionInfo:i[h],attrExprInfoIndex:o[h],isLeftColumn:!1,...c&&{isIndentModeEnabled:c},env:s,pageInfo:l,direction:u});e[h][g]=v,f.qSubNodes.length&&t(a||v,v,f.qSubNodes,h+1)})}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},SV=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:a,pageInfo:s,direction:l})=>{const{qTop:u,qArea:c}=t;if(!u.length)return e;const d=xV(e.grid,u,c,n,r,i,o,a,s,l);mV(d,n.size.x);const p=gV(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:p}},wV=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},n)=>(e[t]=n,e),{}),CV=(e,t)=>{const{env:n}=o$(),{direction:r}=n$(),{layoutService:i,effectivePropertiesService:o}=l$(),{qPivotDataPages:a,pageInfo:s}=n$(),[l,u]=m(null),c=((e,t,n)=>v(()=>({left:e.map(wV),top:t.map(wV),measures:n.map(wV)}),[n,e,t]))(e,t,i.visibleMeasureInfo),d=v(()=>y$(i,o,t,e),[i,o,t,e]),p=f(()=>a.slice(1).reduce((e,t)=>bV({prevData:e,dataPage:t,pageInfo:s}),((e,t)=>{const{qData:n,qArea:r}=e;return yV({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(a[0],s)),[a,s]),h=f(()=>a.slice(1).reduce((e,o)=>SV({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r}),((e,t,n,r,i,o,a,s)=>{const{qArea:l,qTop:u}=e,c=xV([],u,l,t,n,r,i,o,a,s);mV(c,t.size.x);const d=gV(c);return{grid:c,rowCount:c.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],i,t,c.top,d.size.y,n,s,r)),[a,i,t,c.top,d.size.y,n,s,r]),g=f(()=>a.slice(1).reduce((t,o)=>vV({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:n,direction:r}),((e,t,n,r,i,o,a)=>{const{qArea:s,qLeft:l}=e,u=hV([],l,s,n,t,r,i,o,a);mV(u,n.rowsOnCurrentPage);const c=gV(u,t);return{grid:u,columnCount:u.length,layoutSize:t.size,totalDividerIndex:c}})(a[0],i,s,e,c.left,n,r)),[a,i,s,e,c,n,r]),[y,b]=m(()=>p()),[x,S]=m(()=>h()),[w,C]=m(()=>g());Lz(()=>{b(p())},[p]),Lz(()=>{S(h())},[h]),Lz(()=>{C(g())},[g]),Lz(()=>{l&&l.forEach(o=>{b(e=>bV({prevData:e,dataPage:o,pageInfo:s})),S(e=>SV({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r})),C(t=>vV({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:n,direction:r}))})},[l]);const E=f(e=>{u(e)},[]);return{headersData:d,measureData:y,topDimensionData:x,leftDimensionData:w,attrExprInfoIndexes:c,nextPageHandler:E}},EV=Math.sqrt(1e4),IV=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/bT.PixelsMin)}),DV=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/EV),r=Math.ceil(e.qHeight/EV);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*EV,qTop:e.qTop+n*EV,qWidth:Math.min(EV,e.qWidth-i*EV),qHeight:Math.min(EV,e.qHeight-n*EV)});return t};function PV({nextPageHandler:e}){const{model:t}=o$(),{pageInfo:n}=n$(),{layoutService:r}=l$(),i=(e=>{const t=l(e);return t.current=e,t})(n.page),o=t,a=f(async(e,t)=>{await(o?.collapseLeft(d$,e,t,!1))},[o]),s=f(async(e,t)=>{await(o?.collapseTop(d$,e,t,!1))},[o]),u=f(async(e,t)=>{await(o?.expandLeft(d$,e,t,!1))},[o]),c=f(async(e,t)=>{await(o?.expandTop(d$,e,t,!1))},[o]),d=f(async t=>{if(o?.getHyperCubePivotData&&0!==t.length)try{const r=await o.getHyperCubePivotData(d$,t.reduce((e,t)=>[...e,...DV(t)],[]));i.current===n.page&&e(r)}catch(e){console.error(e)}},[o,e,n,i]),p=f((e,{dimensionInfoIndex:n,isLeftColumn:i,x:o=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:u}=r.layout.qHyperCube;let c=[];switch(a){case wF.Dimension:c=[{qPath:`${d$}/qDimensions/${n}/qDef/columnWidth`,oldValue:l[n].columnWidth}];break;case wF.Measures:if(i)c=s.map((e,t)=>({qPath:`${d$}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth}));else{const e=r.getMeasureInfoIndexFromCellIndex(o);c=[{qPath:`${d$}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case wF.Pivot:c=[{qPath:`${d$}/topHeadersColumnWidth`,oldValue:u}]}const d=c.map(t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}});t?.applyPatches(d,!0)},[t,r]),h=f(async e=>{await(o?.applyPatches([{qPath:`${d$}/indentModeColumnWidth`,qOp:r.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...r.indentModeColumnWidth,...e})}],!0))},[o,r]);return v(()=>({collapseLeft:a,collapseTop:s,expandLeft:u,expandTop:c,applyColumnWidth:p,applyIndentModeColumnWidth:h,fetchPages:d}),[a,s,u,c,p,h,d])}const RV=(e,t,n)=>(r,i)=>{if("P"===r)return p$;const o=t[n+i];return e[o]},MV=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach(e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)})};return n(e),t},LV=u({}),AV=()=>h(LV),kV=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=l$(),{qPivotDataPages:r}=n$();return v(()=>{const i=MV(r[0]?.qLeft??[]),o=MV(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(RV(n,t,0)),visibleTopDimensionInfo:o.map(RV(n,t,e))}},[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=CV(t,n),u=PV({nextPageHandler:l}),c=v(()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:a,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:s,dataModel:u}),[t,n,r,i,o,a,s,u]);return io.jsx(LV.Provider,{value:c,children:e})},OV=20,qV=18,TV=.75,NV=e=>-1!==e&&e?.representation?.type===mF.Image,_V=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===mF.Image,jV=e=>void 0===e?BF:e,FV=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const n=+e;return n>=0?n:t}return t},zV=e=>FV(e,bT.PixelsDefault),WV=(e,t)=>FV(e,bT.PercentageDefault)*t/100,$V=(e,t,n)=>{switch(t?.type){case xT.Pixels:return zV(t.pixels);case xT.Percentage:return WV(t.percentage,e);case xT.FitToContent:case xT.Auto:default:return n}},VV=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:a})=>e.reduce((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:u,qDimensionInfo:c}}}=t,{id:d,colIdx:p,qApprMaxGlyphCount:f,isLeftDimension:h}=s,m=c.find(e=>e.cId===d),g={width:24,...m?.representation?.imageBox};if(!h)return e+0;if(d===f$)return e+0;const v=_V({isLeftColumn:h,layoutService:t,representation:m?.representation||{type:mF.Text}})?g.width+8+4:r(f),y=!n.qAlwaysFullyExpanded&&p<u-1?21:0;let b=0;if(i&&o&&a){b=o("- ")+a}return Math.max(e,24*l+qV+y+v+b)},0),HV=(e,t,n)=>e.reduce((e,r)=>{const i=(n?0:1)*qV;return Math.max(e,i+t(r.qFallbackTitle??""))},0),BV=(e,t,n,r)=>{const i=100*e/t,o=r*TV*(i/100),a=i/100*+n;return Math.min(a,o)},GV=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),UV=(e,t)=>e.some(e=>e>=t*TV),YV=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:u})=>{let c=[];const d=i*TV,p=n.data[n.data.length-1][0];if(!Array.isArray(p))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const f=Math.min(d,r.at(-1)),h=Math.min(d,VV({headers:p,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,HV(e.visibleMeasureInfo,a));let g=0;const v=p.findIndex(e=>e.id===f$),y=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===xT.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+qV+16:24})({layoutService:e,measureTextForHeader:a,translator:u,headersData:n});if(e.hasPseudoDimOnLeft)if(0===v){const e=Math.max(f,h,m);c=[Math.max(y,e-f),f]}else{const n=Math.min(d,HV(e.visibleMeasureInfo,l,!0));g=Math.min(d,VV({headers:p.slice(0,v),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:n}));const r=Math.max(f,h,g);c=[Math.max(y,r-f),f]}else c=[Math.max(y,h-f),f];const b=Math.min(d,c.reduce((e,t)=>e+t,0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=xT.Pixels,x.pixels=o);return[xT.Pixels,xT.Percentage].includes(x.type)||UV(c,i)?((e,t,n,r)=>{let i=e[0],o=e[1],a=[];const s=e.reduce((e,t)=>e+t,0),{type:l,pixels:u,percentage:c}=t,d=FV(u,bT.PixelsDefault),p=FV(c,bT.PercentageDefault),f=UV(e,n);l===xT.Auto&&f&&(i>o?i-=o:o-=i),l===xT.Pixels&&d&&(i=BV(e[0],s,d,n),o=BV(e[1],s,d,n)),l===xT.Percentage&&p&&(i=GV(e[0],s,p,n),o=GV(e[1],s,p,n));let h=0;o<=r&&(h=i-5,h>0&&(i-=h,o+=h)),h=o-r,h>0&&(i+=h,o-=h),a=[i,o];const m=a.reduce((e,t)=>e+t,0);return{leftGridColumnWidths:a,leftGridWidth:m,leftGridFullWidth:m}})(c,x,i,f):{leftGridWidth:b,leftGridColumnWidths:c,leftGridFullWidth:b}};function KV({tableWidth:e}){const t=e*TV,{styleService:n,layoutService:r,effectivePropertiesService:i}=l$(),{translator:o}=o$(),{gridSectionsData:{headersData:a}}=AV(),{measureText:s}=Dz(n.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:u}=Dz({...n.dimensionValues,fontWeight:jV(n.dimensionValues.fontWeight)}),{measureText:c}=Dz({...n.dimensionValues,...n.measureLabels}),d=f((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:p,topHeadersColumnWidth:f}},visibleMeasureInfo:h,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,v=(t=0)=>h.reduce((n,{qFallbackTitle:r,columnWidth:i})=>{const o=c(r)+qV,a=Math.max(o,t);return Math.max(n,m?a:$V(e,i,a))},0),y=e=>a.data.reduce((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===f$)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?OV:0;return qV+s(t)+OV+r})(r);return Math.max(i,t)},0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const S=x.map((o,s)=>{let u=qV;if(m&&1!==a.size.x||!n||void 0===d||d!==o.colIdx){let t;o.columnWidthLocation===wF.Pivot?t=m?void 0:f:o.columnWidthLocation===wF.Dimension&&({columnWidth:t}=o);let n=0;if(o.isLeftDimension)if(o.id===f$)n=v();else{const e=y(s),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:a}=e,s=r.getDimensionInfo(a);if(NV(s))return bT.PixelsDefault;const u=!i.qAlwaysFullyExpanded&&o&&t<p-1?21:0;return qV+l(n)+u})(o,s);n=Math.max(e,t),m&&!g&&s+1===p&&o.columnWidthLocation===wF.Dimension&&a.size.x>1&&(n=e)}else n=y(s),o.columnWidthLocation===wF.Measures&&(n=v(n));m&&1===a.size.x&&(t=r.indentModeColumnWidth),u=m&&!g&&a.size.x>1?n:$V(e,t,n)}else u=m?Math.min(t,n):n;return b+=u,u});return m&&a.size.x>1?YV({layoutService:r,effectivePropertiesService:i,headersData:a,columnWidths:S,tableWidth:e,widthOverride:n,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:u,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:S,leftGridFullWidth:b}},[e,a,r,t,s,c,l,u,o,i]),[p,h]=m(d);Lz(()=>{h(d())},[d]);const g=f((e,t)=>{h(d(e,t))},[d]);return{...p,overrideLeftGridWidth:g}}function XV({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=l$(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=AV(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:u}=i,{estimateWidth:c,measureText:d}=Dz(r.measureValues,{allowLineBreaks:!1}),{estimateWidth:p}=Dz({...r.dimensionValues,fontWeight:jV(r.dimensionValues.fontWeight)},{allowLineBreaks:!1}),h=e-n-1,m=o.at(-1),g=m===p$,y=s.length-a>o.length?21:0,b=v(()=>{const e=g?u:[m],t=l.x/e.length,n=[],r=[];let i=h;const o=(e,r)=>{n[e]=Math.min(bT.PixelsMax,Math.max(bT.PixelsMin,r)),i-=n[e]*t};if(e.forEach((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(n){case xT.Pixels:o(t,zV(i));break;case xT.Percentage:o(t,WV(a,h));break;case xT.FitToContent:o(t,((e,t,n)=>n?bT.PixelsDefault:qV+(g?Math.max(c(e),d(t)):Math.max(Math.max(...u.map(e=>c(e.qApprMaxGlyphCount))),p(e)+y)))(s,l??"",NV(e)));break;case xT.Auto:default:r.push(t)}}else r.push(t)}),r.length){const e=r.length*t,o=i/e;r.forEach(e=>{n[e]=Math.max(bT.AutoMinPivot,o)})}return n},[g,u,m,l.x,h,c,d,p,y]),x=v(()=>{if(g){return u.reduce((e,t,n)=>e+b[n],0)/u.length}return b[0]},[g,b,u]),S=parseFloat((t/i.size.x).toFixed(12)),w=f(e=>(g&&void 0!==e?b[i.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-S,[g,b,i,x,S]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,h),getRightGridColumnWidth:w}}const JV=`scrollable-container--${EF.TopGrid}`,ZV=`scrollable-container--${EF.LeftGrid}`,QV=`scrollable-container--${EF.DataGrid}`,eH=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},tH=(e,t)=>e>t?IF.Forward:e<t?IF.Backward:IF.None,nH=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{const{direction:s}=n$();d(()=>{const{headerGridWrapperElement:l,topGridWrapperElement:u,leftGridWrapperElement:c,dataGridWrapperElement:d}=r(),p=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},f=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},h=r=>{const a=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(a,s);n.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),u.scrollLeft=l,e.current?.forEach(e=>{e?.scrollTo(l)}),c.scrollTop=d.scrollTop,t.current?.forEach(e=>{e?.scrollTo(a.scrollTop)}),o(r),i?.(r)};return c.addEventListener("scroll",p),u.addEventListener("scroll",f),d.addEventListener("scroll",h),a.scroll||setTimeout(()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)},0),()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)}},[o,i,a,e,t,n,r,s])},rH=()=>{const{interactions:e}=o$(),t=l(null),n=l(null),r=l(null),i=l(null),o=l([]),a=l([]),s=l(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c},resetHorizontalScrollbarHeight:p}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const[r,i]=m(0),[o,a]=m(0);return g(()=>{if(e.current||n.current){const t=Math.max(eH(e.current).width,eH(n.current).width);r!==t&&i(t)}}),g(()=>{if(t.current||n.current){const e=Math.max(eH(t.current).height,eH(n.current).height);o!==e&&a(e)}}),{scrollbarsDimensions:{verticalScrollbarWidth:r,horizontalScrollbarHeight:o},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:a}})=>{const{pageInfo:s}=n$(),{downloadService:l,viewService:u,layoutService:c}=l$(),d=f(()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)},[e,t,n,r]);g(()=>{d()},[s.page,d]),g(()=>{c.triggerdByExpandOrCollapse||d()},[c,d]),g(()=>{if(c.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach(e=>{e?.scrollTo(t)}),i.current?.forEach(t=>{t?.scrollTo(e)}),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}},[c,r,a,o,i]),g(()=>{(l.isDownloadedAsPDForImage||c.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=u.scrollTop,r.current.scrollLeft=u.scrollLeft,n.current.scrollLeft=u.leftGridScrollLeft,t.current.scrollTop=u.topGridScrollTop)},[u,l,c,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s}});const{trackScrollDirection:h,scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y}}=(()=>{const e=l(IF.None),t=l(IF.None),n=l({prevScrollTop:0,prevScrollLeft:0}),r=f(r=>{if(r instanceof WheelEvent&&(e.current=tH(r.deltaY,0),t.current=tH(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=tH(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=tH(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}},[e,t,n]);return{trackScrollDirection:r,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=l$();return f(t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===ZV&&(e.leftGridScrollLeft=r.scrollLeft),i===QV&&(e.scrollLeft=r.scrollLeft),i===JV&&(e.topGridScrollTop=r.scrollTop),i!==ZV&&i!==QV||(e.scrollTop=r.scrollTop)},[e])})(),x={gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},getWrapperElements:f(()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current}),[t,n,r,i]),updateViewService:b,trackScrollDirection:h,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{d(()=>{const{headerGridWrapperElement:i,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:u}=r(),c=e=>{e.ctrlKey||(e.preventDefault(),i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,s.scrollTop=i.scrollTop,o(e))},d=e=>{e.ctrlKey||(e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach(e=>{e?.scrollTo(l.scrollTop)}),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,u.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e))},p=t=>{t.ctrlKey||(t.preventDefault(),s.scrollLeft+=t.deltaX,e.current?.forEach(e=>{e?.scrollTo(s.scrollLeft)}),i.scrollTop+=t.deltaY,s.scrollTop=i.scrollTop,u.scrollLeft=s.scrollLeft,n.current?.scrollTo({scrollLeft:s.scrollLeft}),o(t))},f=r=>{r.ctrlKey||(r.preventDefault(),u.scrollLeft+=r.deltaX,u.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:u.scrollLeft,scrollTop:u.scrollTop}),s.scrollLeft=u.scrollLeft,e.current?.forEach(e=>{e?.scrollTo(u.scrollLeft)}),l.scrollTop=u.scrollTop,t.current?.forEach(e=>{e?.scrollTo(u.scrollTop)}),o(r))};return i.addEventListener("wheel",c),l.addEventListener("wheel",d),s.addEventListener("wheel",p),u.addEventListener("wheel",f),a.scroll||setTimeout(()=>{i.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)},0),()=>{i.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)}},[o,i,a,e,t,n,r])})(x),nH(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c,resetHorizontalScrollbarHeight:p}}},iH=()=>{const{layoutService:e}=l$(),{rect:t,pageInfo:n}=n$();return v(()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}},[t,e,n.shouldShowPagination])},oH=({children:e,style:t})=>io.jsx("div",{"data-testid":"fullSize",style:t,children:e}),aH=({children:e,style:t})=>{const{direction:n}=n$();return io.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},sH=e=>e&&`scrollable-container--${e}`,lH=({children:e,style:t,origin:n},r)=>{const{interactions:i}=o$(),o=i.scroll?t:{overflow:"hidden"};return io.jsx("div",{"data-testid":"scrollable","data-key":sH(n),style:o,ref:r,children:e})};var uH=n.forwardRef(lH);const cH=({children:e,style:t})=>{const{direction:n}=n$();return io.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};var dH=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function pH(e,t){return e===t||!(!dH(e)||!dH(t))}function fH(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!pH(e[n],t[n]))return!1;return!0}function hH(e,t){var n;void 0===t&&(t=fH);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}var mH="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function gH(e){cancelAnimationFrame(e.id)}function vH(e,t){var n=mH();var r={id:requestAnimationFrame(function i(){mH()-n>=t?e.call(null):r.id=requestAnimationFrame(i)})};return r}var yH=-1;function bH(e){if(void 0===e&&(e=!1),-1===yH||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),yH=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return yH}var xH=null;function SH(e){if(void 0===e&&(e=!1),null===xH||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?xH="positive-descending":(t.scrollLeft=1,xH=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),xH}return xH}var wH=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function CH(e){var t,n=e.getColumnOffset,i=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,u=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,d=e.getRowHeight,p=e.getRowOffset,f=e.getRowStartIndexForOffset,h=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=m(r.props,ql(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:ql(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=hH(function(e,t,n,i,o,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),r._callOnScroll=void 0,r._callOnScroll=hH(function(e,t,n,i,o){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})}),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var i,o=r.props,s=o.columnWidth,l=o.direction,u=o.rowHeight,c=r._getItemStyleCache(g&&s,g&&l,g&&u),f=e+":"+t;if(c.hasOwnProperty(f))i=c[f];else{var h=n(r.props,t,r._instanceProps),m="rtl"===l;c[f]=i={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:p(r.props,e,r._instanceProps),height:d(r.props,e,r._instanceProps),width:a(r.props,t,r._instanceProps)}}return i},r._getItemStyleCache=void 0,r._getItemStyleCache=hH(function(e,t,n){return{}}),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState(function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=r.props.direction,u=o;if("rtl"===t)switch(SH()){case"negative":u=-o;break;case"positive-descending":u=l-i-o}u=Math.max(0,Math.min(u,l-i));var c=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:u,scrollTop:c,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&gH(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=vH(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}El(t,e),t.getDerivedStateFromProps=function(e,t){return EH(e,t),v(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,a=o.columnCount,d=o.height,p=o.rowCount,f=o.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,v=bH();void 0!==r&&(r=Math.max(0,Math.min(r,a-1))),void 0!==i&&(i=Math.max(0,Math.min(i,p-1)));var y=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,x=y>d?v:0;this.scrollTo({scrollLeft:void 0!==r?u(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?c(this.props,i,n,g,this._instanceProps,b):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(SH()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&gH(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,n=e.className,i=e.columnCount,o=e.direction,a=e.height,u=e.innerRef,c=e.innerElementType,d=e.innerTagName,p=e.itemData,f=e.itemKey,h=void 0===f?wH:f,m=e.outerElementType,g=e.outerTagName,v=e.rowCount,y=e.style,b=e.useIsScrolling,x=e.width,S=this.state.isScrolling,w=this._getHorizontalRangeToRender(),C=w[0],E=w[1],I=this._getVerticalRangeToRender(),D=I[0],P=I[1],R=[];if(i>0&&v)for(var M=D;M<=P;M++)for(var L=C;L<=E;L++)R.push(r(t,{columnIndex:L,data:p,isScrolling:b?S:void 0,key:h({columnIndex:L,data:p,rowIndex:M}),rowIndex:M,style:this._getItemStyle(M,L)}));var A=s(this.props,this._instanceProps),k=l(this.props,this._instanceProps);return r(m||g||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},r(c||d||"div",{children:R,ref:u,style:{height:A,pointerEvents:S?"none":void 0,width:k}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],u=o[3],c=this._getVerticalRangeToRender(),d=c[0],p=c[1],f=c[2],h=c[3];this._callOnItemsRendered(a,s,d,p,l,u,f,h)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,v=m.scrollLeft,y=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(v,y,g,x,b)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,u=l.horizontalScrollDirection,c=l.isScrolling,d=l.scrollLeft,p=n||r||a||1;if(0===t||0===s)return[0,0,0,0];var f=i(this.props,d,this._instanceProps),h=o(this.props,f,d,this._instanceProps),m=c&&"backward"!==u?1:Math.max(1,p),g=c&&"forward"!==u?1:Math.max(1,p);return[Math.max(0,f-m),Math.max(0,Math.min(t-1,h+g)),f,h]},y._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,u=a.scrollTop,c=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=f(this.props,u,this._instanceProps),p=h(this.props,d,u,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,c),g=s&&"forward"!==l?1:Math.max(1,c);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,p+g)),d,p]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var EH=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},IH=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},DH=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},PH=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var u=a+1;u<=n;u++){var c=o(u);i[u]={offset:s,size:c},s+=c}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},RH=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?MH(e,t,n,o,0,r):LH(e,t,n,Math.max(0,o),r)},MH=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=PH(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},LH=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&PH(e,t,r,n).offset<i;)r+=a,a*=2;return MH(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},AH=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=PH(e,t,n,o),u="column"===e?DH(t,o):IH(t,o),c=Math.max(0,Math.min(u-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=c+s?"auto":"center"),r){case"start":return c;case"end":return d;case"center":return Math.round(d+(c-d)/2);default:return i>=d&&i<=c?i:d>c||i<d?d:c}},kH=CH({getColumnOffset:function(e,t,n){return PH("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return RH("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=PH("column",e,t,r),s=n+o,l=a.offset+a.size,u=t;u<i-1&&l<s;)u++,l+=PH("column",e,u,r).size;return u},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:IH,getEstimatedTotalWidth:DH,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return AH("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return AH("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return PH("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return RH("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=PH("row",e,t,r),s=n+o,l=a.offset+a.size,u=t;u<i-1&&l<s;)u++,l+=PH("row",e,u,r).size;return u},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),OH=function(e,t){return e};function qH(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=u(r.props,ql(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:ql(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=hH(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=hH(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,s=i.itemSize,l=i.layout,u=r._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===l,h="rtl"===a,m=f?d:0;u[e]=t={position:"absolute",left:h?void 0:m,right:h?m:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=hH(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch(SH()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&gH(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=vH(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}El(t,e),t.getDerivedStateFromProps=function(e,t){return TH(e,t),d(e),null};var p=t.prototype;return p.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?bH():0:l.scrollHeight>l.clientHeight?bH():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(SH()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&gH(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,u=e.innerTagName,c=e.itemCount,d=e.itemData,p=e.itemKey,f=void 0===p?OH:p,h=e.layout,m=e.outerElementType,g=e.outerTagName,v=e.style,y=e.useIsScrolling,b=e.width,x=this.state.isScrolling,S="horizontal"===o||"horizontal"===h,w=S?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),E=C[0],I=C[1],D=[];if(c>0)for(var P=E;P<=I;P++)D.push(r(t,{data:d,key:f(P,d),index:P,isScrolling:y?x:void 0,style:this._getItemStyle(P)}));var R=i(this.props,this._instanceProps);return r(m||g||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},r(l||u||"div",{children:D,ref:s,style:{height:S?"100%":R,pointerEvents:x?"none":void 0,width:S?R:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var u=s(this.props,a,this._instanceProps),c=l(this.props,u,a,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),p=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,u-d),Math.max(0,Math.min(t-1,c+p)),u,c]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var TH=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},NH=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var u=r(l);i[l]={offset:a,size:u},a+=u}n.lastMeasuredIndex=t}return i[t]},_H=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=NH(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},jH=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&NH(e,n,t).offset<r;)n+=o,o*=2;return _H(e,t,Math.min(n,i-1),Math.floor(n/2),r)},FH=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},zH=qH({getItemOffset:function(e,t,n){return NH(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:FH,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===a||"horizontal"===l?u:s,d=NH(e,t,i),p=FH(e,i),f=Math.max(0,Math.min(p-c,d.offset)),h=Math.max(0,d.offset-c+d.size+o);switch("smart"===n&&(n=r>=h-c&&r<=f+c?"auto":"center"),n){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return r>=h&&r<=f?r:r<h?h:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?_H(e,t,i,0,n):jH(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,u="horizontal"===i||"horizontal"===s?l:o,c=NH(e,t,r),d=n+u,p=c.offset+c.size,f=t;f<a-1&&p<d;)f++,p+=NH(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function WH(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var $H=["style"],VH=["style"];function HH(e,t){var n=e.style,r=Oe(e,$H),i=t.style,o=Oe(t,VH);return!WH(n,i)&&!WH(r,o)}const BH=10,GH=(e,t)=>e.current===IF.Backward?t:0,UH=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},YH=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,KH=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(UH(t,e,n,r)){const t=a[a.length-1],i={qLeft:e,qTop:n+s,qWidth:1,qHeight:r};void 0!==t&&YH(t,i)?t.qWidth+=i.qWidth:a.push(i)}return a},XH=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=r,u=n.current===IF.Backward?Math.max(0,i-25):o,c=Math.min(u+25,a);return KH({pageInfo:e,measureData:t,startLeft:u,endLeft:c,pageTop:s,qHeight:l})},JH=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:a,pageTop:s,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=e.size.x,l=GH(n,BH),u=Math.max(r-l,0);return{startLeft:u,endLeft:u+Math.min(o+BH,s-u),pageTop:i,qHeight:a}})(r,i,n),u=KH({pageInfo:e,measureData:t,startLeft:o,endLeft:a,pageTop:s,qHeight:l});return u.length>0?[...u,...XH({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:a,columnEndIndex:r.size.x})]:u},ZH=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},QH=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,eB=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const a=[],s=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(ZH(i,n,o,r)){const e=a.at(-1),t={qLeft:n,qTop:o+s,qWidth:r,qHeight:1};void 0!==e&&QH(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},tB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:a,qWidth:s}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=GH(n,BH),l=Math.max(i-s,0);return{startTop:l,endTop:l+Math.min(a+BH,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=eB({startTop:i,endTop:o,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===IF.Backward?Math.max(0,i-25):o,u=Math.min(r+25,e.rowsOnCurrentPage),c=eB({startTop:r,endTop:u,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...c]}return l},nB=async(e,t,n,r,i,o,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:u,gridWidth:c,gridHeight:d}=i;let p=[],f=[];o.current!==IF.None&&(p=tB({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),a.current!==IF.None&&(f=JH({pageInfo:r,measureData:n,scrollDirection:a,layoutService:t,viewService:i})),o.current===IF.None&&a.current===IF.None&&(p=eB({measureData:n,pageInfo:r,qLeft:l,qWidth:c,startTop:u,endTop:u+d}));const h=e.fetchPages([...p,...f]);s.isDownloadedAsPDForImage&&s.waitForPromise(h)},rB=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(nB,100),iB=j_(nB,75),oB=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),aB=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:a})=>{const{direction:s}=n$(),{styleService:{grid:{border:l,divider:u}}}=l$();return io.jsx("div",{style:{...e,...ZF,...nz(n,r,l,s,i),...iz({bottomDivider:a&&o,rightDivider:a&&!o,borderColor:u})},"data-testid":"empty-cell","data-index":t})},sB=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=l$(),a=i&&o;return io.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},lB=e=>{const{type:t,imageSize:n}=e;return t!==mF.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},uB=e=>"number"==typeof e&&!Number.isNaN(+e),cB=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,dB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})})),pB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})})),fB=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M3 9v6.5a.5.5 0 1 1-1 0V.5a.5.5 0 0 1 1 0V1q2.441.639 3.667.639c1.225 0 1.774-.995 3.87-1.196q1.972-.19 3.297.47A.3.3 0 0 1 14 1.18v7.344a.3.3 0 0 1-.417.277q-1.338-.565-3.045-.416c-1.98.172-2.083 1.107-3.871 1.253Q4.879 9.785 3 9"}),io.jsx("use",{fillRule:"evenodd"})]})),hB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13.9 7.4c-1 1.3-.6 1.5-1.5 4.1-.5 1.8-1.2 2.9-1.7 3.6q-.45.6-.9.9H4.2c-1 0-1.6-.5-1.9-1-.2-.3-.3-.6-.3-1V4.2c0-.4.3-.7.7-.7s.7.3.7.7v3.6l.9-.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v5.1l1.1-.2V.7C6.7.3 7 0 7.4 0s.7.3.7.7v5.9l1.1.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v7.7s.1 0 .1-.2l.6-1.4c1.1-2.1 3.1-1.1 2.6-.3"})})),mB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M5 13h6v1.5c0 .3-.2.5-.5.5H10v.5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5V15h-.5c-.3 0-.5-.2-.5-.5zm0-1c0-2-3-3-3-7 0-3 3-5 6-5s6 2 6 5c0 4-3 4-3 7H5m-.5-7c.3 0 .5-.2.5-.5s.2-.7.5-1 .6-.5 1-.5c.3 0 .5-.2.5-.5S6.8 2 6.5 2c-.6 0-1.2.3-1.7.8S4 3.9 4 4.5c0 .3.2.5.5.5"})})),gB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8m4.5 9c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6h-9c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7z"})})),vB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M2 7.5h12v1H2z"})})),yB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9 7h7a7.004 7.004 0 0 0-7-7zm1-5.917A6.005 6.005 0 0 1 14.917 6H10zM14 9H7V2a7.002 7.002 0 0 0 0 14 7 7 0 0 0 7-7m-8 1h6.917A6.002 6.002 0 0 1 1 9a6 6 0 0 1 5-5.917z"})})),bB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9 9h3.5c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6H9V3.5c0-.25-.3-.5-.6-.5h-.7c-.4 0-.7.25-.7.5V7H3.5c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7H7v3.5c0 .25.3.5.6.5h.8c.3 0 .6-.25.6-.5zM8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})})),xB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m8.418 1.007.042.08 1.788 4.217 4.571.388a.5.5 0 0 1 .348.811l-.063.065-3.472 3.008 1.043 4.47a.5.5 0 0 1-.664.581l-.081-.04L8 12.217l-3.93 2.372a.5.5 0 0 1-.757-.453l.012-.089 1.043-4.47L.896 6.568a.5.5 0 0 1 .196-.86l.089-.016 4.571-.388L7.54 1.086a.5.5 0 0 1 .878-.08Z"})})),SB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1"})})),wB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})})),CB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M2.4 4h11.2a.2.2 0 0 1 .16.32l-5.6 7.467a.2.2 0 0 1-.32 0L2.24 4.32A.2.2 0 0 1 2.4 4"})})),EB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M11 2.4v11.2a.2.2 0 0 1-.32.16l-7.467-5.6a.2.2 0 0 1 0-.32l7.467-5.6a.2.2 0 0 1 .32.16"})})),IB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M4 13.6V2.4a.2.2 0 0 1 .32-.16l7.467 5.6a.2.2 0 0 1 0 .32l-7.467 5.6A.2.2 0 0 1 4 13.6"})})),DB={m:wB,"ï":xB,R:x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})})),S:CB,T:EB,U:IB,P:bB,Q:gB,"è":x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M14.98 15H1.04c-1.002 0-1.303-.7-.802-1.5l6.82-11.9c.5-.8 1.303-.8 1.804 0l6.92 11.9c.501.8.1 1.5-.803 1.5M8.5 5h-1c-.3 0-.5.2-.5.5V9c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5V5.5c0-.3-.2-.5-.5-.5m-1 6c-.3 0-.5.2-.5.5v1c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5v-1c0-.3-.2-.5-.5-.5z"})})),"¢":hB,"©":fB,"23F4":mB,2013:SB,"&":yB,add:dB,"minus-2":vB,dot:pB},PB=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&DB[t];return i&&io.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:io.jsx(i,{style:{height:e}})})},RB=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),MB=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},LB=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,u=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-u}:{color:l.color,t:u-.5}:a.gradient?{color:s.color,t:1-(.5+u/2)}:o.gradient?{color:l.color,t:u/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return bN(e.localPaletteColors[t].color??"").blend(bN(s.color??""),s.t)},AB=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort((e,t)=>e.value-t.value),e.limits=n.map(e=>({...e,value:RB(t,e.value)}))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map((e,t)=>({color:MB(r,t,n)}))),r},kB=(e,t,n,r)=>{const i=AB(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=LB(e,a,t);break}r=o}return n})(i,t);return a},OB=(e,t)=>{const n=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),r=n.some(e=>!uB(e));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!uB(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},qB=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=OB(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!uB(t))return 0;let a=n&&uB(n)?Math.min(n,t):0;const s=r.sort((e,t)=>e.value-t.value),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},TB=e=>"flex-start"===e?"flex-end":"flex-start",NB=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=qB(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return MB(i,n.limitPaletteColorIndex,r);const a=RB(n.limitRange,t);return kB(i,a,n.limitRange,r)})(i,t,o,r),s=i.segments.paletteColors[o?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let u=l?.position||"right";return"rtl"===n&&(u="right"===u?"left":"right"),{color:a,iconKey:s,position:u}},_B=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=l$(),{theme:i}=o$(),{direction:o}=n$(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:u}=s??{},c=NB(e,t,o,i),{fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m},v=parseInt(d||VF,10),{iconKey:y,color:b,position:x}=c||{},S={display:"flex",paddingTop:2};return l?io.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:u?b:n?.color},children:["left"===x&&PB({size:v,iconKey:y,color:b,pvStyle:S}),io.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&PB({size:v,iconKey:y,color:b,pvStyle:S})]}):(S.paddingTop=5,PB({size:v,iconKey:y,color:b,pvStyle:S}))},jB=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},FB=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},zB=(e,t,n,r,i)=>{if(i)return;const o=e.representation,a=_V({isLeftColumn:n,layoutService:t,representation:o}),s=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===mF.Image)return a&&l&&"center"!==l&&"rtl"===r?TB(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return jB(n,s,r)}const{textAlign:u}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return jB(u,s,r)},WB=e=>!!e.target?.getAttribute("class")?.includes(yT),$B=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},VB=e=>null!==e.target?.closest("[data-prevent-selection]"),HB=e=>"A"===e.target?.tagName,BB=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const GB=u({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),UB=()=>h(GB),YB=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=n$(),n=e.isActive(),[r,i]=c($B,{engineSelectedCells:null,selectedField:null,activeSelection:null});d(()=>{const n=()=>{i({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}},[e,t]);const o=f(async()=>{if(!r.activeSelection)return;var t,n;1===r.activeSelection.clientSelectedCells.size&&(t=r.engineSelectedCells,(n=r.activeSelection).clientSelectedCells.forEach((e,r)=>{t?.has(r)&&(n.clientSelectedCells.delete(r),t.delete(r))}));const o=new Map([...r.engineSelectedCells??new Map,...r.activeSelection.clientSelectedCells]);try{i({type:"mouseup",payload:{engineSelectedCells:o}}),await e.select({method:"selectPivotCells",params:[d$,Array.from(o,([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x}))]})}catch(e){console.error(e),i({type:"mouseup",payload:{engineSelectedCells:r.engineSelectedCells}})}},[r,e]);d(()=>{if(r.activeSelection)return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}},[o,r.activeSelection]);const a=f((e,t)=>n=>{const r=t(e);WB(n)||VB(n)||HB(n)||!(e=>1===e.buttons)(n)||!r||i(BB({startIndex:e,getCellFromIndex:t,cell:r}))},[]),s=f(t=>async()=>{r.activeSelection&&(e.isActive()||await e.begin([d$]),i({type:"mouseover",payload:{index:t}}))},[r.activeSelection,e]),l=f((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);WB(n)||VB(n)||HB(n)||!r||(i(BB({startIndex:e,getCellFromIndex:t,cell:r})),o())},[o]),u=f(e=>!(!r.engineSelectedCells?.size&&!r.activeSelection?.clientSelectedCells.size||!r.selectedField||e.selectionCellType===r.selectedField.selectionCellType&&("L"===e.selectionCellType?r.selectedField.index===e.x:r.selectedField.index===e.y)),[r.activeSelection?.clientSelectedCells.size,r.engineSelectedCells?.size,r.selectedField]),p=f(e=>!u(e)&&(r.engineSelectedCells?.has(e.ref.qElemNo)||!!r.activeSelection?.clientSelectedCells.has(e.ref.qElemNo)),[u,r.activeSelection?.clientSelectedCells,r.engineSelectedCells]);return v(()=>({isSelected:p,isActive:n,isLocked:u,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:l}),[p,n,u,a,s,l])}(t);return io.jsx(GB.Provider,{value:n,children:e})},KB=e=>"fill"===e.representation.imageSize,XB=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&KB(e)&&t&&(n="center"),e.representation.type!==mF.Image||KB(e)?n:e.representation.resolvedImagePosition?.vertical};var JB=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(JB||{});const ZB={brighter:.5,darker:.3,opacity:.03},QB=(e,{cell:t,styleService:n})=>{if(e===JB.Background||e===JB.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.nullValues[e]:t.isPseudoDimension?n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},eG=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=QB(JB.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?QB(JB.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${Y_(o=i,ZB)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},tG=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:QB(JB.Color,{cell:e,styleService:t}),nG=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=QB(JB.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?BF:i},rG=({cell:e,styleService:t})=>QB(JB.FontStyle,{cell:e,styleService:t}),iG=({cell:e,styleService:t})=>QB(JB.TextDecoration,{cell:e,styleService:t}),oG=e=>e?"pointer":"default",aG=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},sG=(e,t)=>{if(!e.isLeftColumn||e.representation.type===mF.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},lG=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=l$(),{interactions:o}=o$(),{isActive:a}=UB(),{dataModel:s}=AV();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||a||!s,u=tG({cell:e,styleService:r,isCellSelected:n}),c=a?.4:1,d=e.ref.qCanExpand?fW:pW;let p;p=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const f=_V({isLeftColumn:t,layoutService:i,representation:e.representation});return io.jsx(d,{opacity:c,color:u,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...sG(e,r),...f&&{alignSelf:XB(e)}},onClick:l?void 0:aG({cell:e,expandOrCollapse:p})})},uG=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},cG=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},dG=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},pG=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=o,l=_V({isLeftColumn:r,layoutService:o,representation:e}),u=t?21:0,c=e.imageBox?.width??24;let d=`calc(100% - ${u}px)`,p=i.headerCellHeight;r&&l&&(d=c),(a||r)&&(p=i.contentCellHeight);let f=p;switch(r&&void 0!==n&&!s&&(f=p*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:f,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:f};case"fitHeight":return{height:f,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:f,width:d};default:return{width:d,height:p}}},fG=e=>{if("alwaysFit"===e)return"contain"},hG=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),mG=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:cG(e,n,r),height:uG(e),objectFit:fG(e),objectPosition:dG(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),gG=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=l$(),t=l(null),{promise:n,resolve:r}=v(()=>fz(),[]);return d(()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()}),[t,e,n,r]),{onLoad:f(()=>{r()},[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=l$(),{url:a,text:s,imageSize:u,resolvedImagePosition:c}=e,{overflow:p,...h}=t;return io.jsx("img",{src:a,alt:s,style:{...mG({imageSize:u,resolvedImagePosition:c,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...h},onLoad:i,ref:r})},vG=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=l$(),{resolvedImagePosition:u}=e;return io.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:u?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...pG({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:s,layoutService:l,isLeftColumn:i,isMeasureCell:a})},children:io.jsx(gG,{representation:e,textStyle:t,isMeasureCell:!0})})},yG={display:"flex",flexDirection:"row",alignItems:"center"},bG={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},xG=(e,t,n,r)=>t?{...bG,...e.nullValues}:n?{...yG,color:e.totalValues.color,background:r??e.totalValues.background}:{...yG,color:e.measureValues.color,background:r??e.measureValues.background},SG=(e,t,n,r,i)=>{const{fontFamily:o,fontSize:a}=e.measureValues,s={...QF,...!n&&ez(e.grid.lineClamp),...t&&{color:t},fontFamily:o,fontSize:a};if(i){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.nullValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}if(r){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.totalValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}const{fontWeight:l,fontStyle:u,textDecoration:c}=e.measureValues;return{...s,fontWeight:void 0===l?BF:l,fontStyle:u,textDecoration:c}},wG=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i})=>{const{layoutService:o,styleService:a}=l$(),{isIndentModeEnabled:s}=o,l=e.isNull?o.getNullValueText():t.text,u=t.type===mF.Image,c=t.type===mF.Indicator,d=uB(cB(l)),p=SG(a,n,d,r,e.isNull);if(!s&&u&&!e.isNull||s&&u&&!e.isNull)return io.jsx(vG,{isMeasureCell:!0,textStyle:p,representation:t,imageContainerHorizontalAlignment:i});const f=cB(e.isNull?t.text:e.ref.qNum);return c&&uB(f)?io.jsx(_B,{representation:t,cellValue:f,textStyle:p}):io.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...p},children:l})},CG=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,EG="flex-start",IG=(e,t)=>e.isNull?EG:t.type===mF.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:EG,DG=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=o$(),{pageInfo:o,direction:a}=n$(),{styleService:s,layoutService:l}=l$(),{attrExprInfoIndexes:u,gridSectionsData:{measureData:c,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:h,visibleTopDimensionInfo:m}}=AV(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=l$(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=AV(),o=r.length,a=i.length;return f((r,i)=>!(!n.grid.at(a-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal),[n,t,o,a,e])})(),v=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=AV(),n=t.length;return f(t=>{const r=e.grid.at(n-1)?.[t];return oB(r,e.totalDividerIndex)},[e,n])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=l$(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=AV(),r=n.length;return f(n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return oB(o,t.totalDividerIndex,e)},[t,e,r])})(),{showLastBorder:b}=r,x=p.grid.at(m.length-1),S=d.grid.at(h.length-1),{background:w}=s.measureValues,C=c[t]?.[e],E=t===o.rowsOnCurrentPage-1,I=e===l.size.x-1;if(!C)return io.jsx(aB,{style:{...n,background:w},isLastRow:E,isLastColumn:I,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const D=l.hasPseudoDimOnLeft?CG(S,t):CG(x,e),P=l.visibleMeasureInfo[D],R=uV({cell:C.ref,representationProperties:P.representation,attrExprInfoIndex:u.measures[D],env:i,direction:a,conditionalColoring:P.conditionalColoring,enabledFeatures:{[mF.Image]:!0,[mF.Indicator]:!0}}),M=!C.isNull&&g(e,t),L=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+L),k=cV(u.measures[D],C.ref),O=((e,t,n,r,i)=>{const{textAlign:o}=t,a=r?"flex-end":"center";return e.isNull||n.type!==mF.Image?jB(o,a,i):n.resolvedImagePosition?.horizontal??"center"})(C,P,R,A,a),q={...xG(s,C.isNull,M,k.background),...nz(E,I,s.grid.border,a,b),...iz({bottomDivider:y(t),rightDivider:v(e),borderColor:s.grid.divider}),...ZF,padding:"0px 4px",display:"flex",justifyContent:O};return io.jsx("div",{className:gT,title:L,style:{...q,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:io.jsx(sB,{width:lB(R),verticalAlign:IG(C,R),children:io.jsx(wG,{cell:C,representation:R,isTotalValueCell:M,color:k.color,cellHorizontalAlignment:O})})})};var PG=n.memo(DG,HH);const RG=(e,t)=>t.list[e]?.id??e.toString(),MG=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,LG=e=>({...JF,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),AG=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:u}=n$(),{layoutService:c,styleService:{grid:{divider:d},contentCellHeight:p}}=l$(),{dataModel:h,gridSectionsData:{measureData:m}}=AV(),v={...LG(u),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},y=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=n$(),{downloadService:r,viewService:i,layoutService:o}=l$(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:u}}=AV(),c=s.columnCount,d=l.rowCount;return f(async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:p,overscanRowStopIndex:f})=>{i.gridColumnStartIndex=s,i.gridRowStartIndex=p,i.gridWidth=l-s+1,i.gridHeight=f-p+1;const h=i.gridWidth+c+(t.current===IF.None?0:BH),m=i.gridHeight+d+(e.current===IF.None?0:BH);let g=rB;m*h>1500&&(g=iB),g(a,o,u,n,i,e,t,r)},[i,o,a,u,e,t,n,c,d,r])})({verticalScrollDirection:a,horizontalScrollDirection:s});return Lz(()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)},[e,h,m]),g(()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})},[r,t,e,p,u]),0===c.size.x?null:io.jsx(kH,{"data-section-id":"DATA_GRID",ref:e,style:v,columnCount:c.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:m},onItemsRendered:y,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:MG,direction:u,children:PG})};var kG=b(AG);const OG=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),io.jsx("use",{fillRule:"evenodd"})]})),qG=e=>{const[t,n]=m(!1);return Lz(()=>{n(!1)},e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},TG=()=>{const[e,t]=m(!1),{dataModel:n}=AV(),{interactions:r}=o$(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=qG([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||WB(e)||i||t(!0)},setIsAdjustingWidth:o}};function NG(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===YF.Transparent?oN.WHITE:r,o=bN(e.grid.border),a=bN(i);return a.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return bN(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(a,o,o.a).getRGB()}const _G=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:a})=>{const{direction:s}=n$(),{interactions:l,translator:u}=o$(),{isActive:c}=UB(),{dataModel:d}=AV(),{styleService:p}=l$(),[,f]=m({});if(!(e.canBeResized&&!!l.active&&!c))return null;const h=NG(p,e);return io.jsx(Nz,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:h,updateWidthCallback:t=>{f({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*TV,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:u,columnLabel:e.label??""},direction:s})},jG=fl(Qu,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})(({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}})),FG=fl("div",{shouldForwardProp:e=>!["direction"].includes(e)})(({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0})),zG=fl("div",{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({...XF,justifyContent:e??XF.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8})),WG=fl("div")(()=>({...XF})),$G=fl("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})(({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i})),VG=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),HG=fl(bp,{shouldForwardProp:e=>!["isActive"].includes(e)})(({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}})),BG=fl("span")({textOverflow:"ellipsis",overflow:"hidden"}),GG=fl("div",{shouldForwardProp:e=>"visible"!==e})(({visible:e})=>({opacity:e?1:0,width:OV,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})),UG=fl("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})(({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0}));let YG=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const KG=(e,t)=>({qExcludeList:t===YG.Expand,qPos:{qDimName:e,qElemNo:[]}}),XG=`${d$}/qExpansionState`,JG=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex(t=>t.qPos?.qDimName===e);return{expansionData:KG(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=XG,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${XG}/-`,t=JSON.stringify(i)):(n=`${XG}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},ZG=({model:e,effectivePropertiesService:t,cell:n})=>{if(void 0===n.qEffectiveDimensionName)return;const r={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:JG({...r,action:YG.Expand}),collapseCallback:JG({...r,action:YG.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},QG={[SW.Sorting]:!0,[SW.Selections]:!0,[SW.Searching]:!0},eU=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:u,shouldApplyIndentModeColumnWidth:c,tableWidth:d})=>{const p=l(null),{styleService:f,layoutService:h,effectivePropertiesService:m}=l$(),{app:g,interactions:v,embed:y,translator:b,model:x}=o$(),{fontSize:S,fontFamily:w,fontStyle:C,fontWeight:E,textDecoration:I,color:D,background:P,hoverBackground:R,activeBackground:M}=f.header,L=l(null),{shouldShowLockIcon:A,shouldShowMenuIcon:k}=a,{open:O,setOpen:q,handleOpenMenu:T,setIsAdjustingWidth:N}=TG(),{direction:_}=n$(),j={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},F={embed:y,listboxRef:p,sortCriteria:h.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},z={app:g,qStateName:h.layout.qStateName},{labelTextAlign:W}=h.getDimensionInfo(e.dimensionInfoIndex)??{},$=jB(W,"flex-start",_);return io.jsxs(jG,{className:gT,title:e.label,interactions:v,background:O?M:P,hoverBackground:R,shouldShowMenuIcon:k,isDimension:e.isDim,style:{...t,...ZF,...rz(e,i,n,r,f.grid.border,_),color:D},"data-testid":"title-cell",onClick:T,children:[io.jsxs(zG,{children:[A?io.jsx(WG,{children:io.jsx(OG,{height:12})}):null,io.jsx($G,{fontFamily:w,fontSize:S,fontStyle:C,fontWeight:E,textDecoration:I,justifyContent:$,children:io.jsx("span",{style:QF,children:e.label})})]}),e.isDim?io.jsxs(io.Fragment,{children:[io.jsx(EW,{headerData:e,translator:b,anchorRef:L,open:O,setOpen:q,interactions:v,menuAvailabilityFlags:QG,sortRelatedArgs:j,searchRelatedArgs:F,selectionRelatedArgs:z,expandOrCollapseArgs:ZG({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:k,model:x&&"setActiveField"in x?x:void 0,direction:_,isAccessibleHeader:!0}),io.jsx(FG,{ref:p,direction:_}),io.jsx(FG,{ref:L,direction:_})]}):null,io.jsx(_G,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:r,overrideLeftGridWidth:u,setIsAdjustingWidth:N,shouldApplyIndentModeColumnWidth:c,tableWidth:d})]})},tU=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=l$(),{direction:r}=n$();return e>0&&t>0?io.jsx("div",{style:{...JF,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},nU=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})})),rU=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),io.jsx("use",{fillRule:"evenodd"})]})),iU=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=n$(),{styleService:i}=l$(),{interactions:o,translator:a}=o$(),{isActive:s}=UB(),{dataModel:l}=AV(),{setIsAdjustingWidth:u}=qG([l]);if(!(!!o.active&&!s))return null;const c=NG(i,{isLeftColumn:!0});return io.jsx(Nz,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:c,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*TV))},confirmWidthCallback:r=>{if(r.type===xT.FitToContent)return void l.applyIndentModeColumnWidth({type:xT.Auto});const i=Math.min(r.pixels??t,e*TV);n(i),l.applyIndentModeColumnWidth({type:xT.Pixels,pixels:i})},setIsAdjustingWidth:u,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:r})},oU=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})})),aU=({cell:e,changeSortOrder:t})=>{const n=l(null),r=l(null),{app:i,interactions:o,embed:a,translator:s,model:u}=o$(),{layoutService:c,effectivePropertiesService:d}=l$(),{open:p,setOpen:f,handleOpenMenu:h}=TG();return io.jsxs(HG,{onClick:h,isActive:p,children:[io.jsx(BG,{children:e.label}),io.jsxs(GG,{className:"indent-mode-dropdown-more",visible:p,children:[io.jsx(oU,{}),e.isDim?io.jsxs(io.Fragment,{children:[io.jsx(EW,{headerData:e,translator:s,anchorRef:n,open:p,setOpen:f,interactions:o,menuAvailabilityFlags:QG,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:a,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:c.layout.qStateName},expandOrCollapseArgs:ZG({model:u,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:u&&"setActiveField"in u?u:void 0}),io.jsx(FG,{ref:r}),io.jsx(FG,{ref:n})]}):null]})]})},sU=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===f$,o=e+1<n.length&&n[e+1]?.id===f$;return!(r&&i&&o)&&(t?.id!==f$&&e<n.length-1)},lU=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=l$(),{interactions:a,translator:s}=o$(),{dataModel:u,gridSectionsData:{headersData:c}}=AV(),[d,p]=m(!1),f=l(null),{headerCellHeight:h}=o,{color:g,background:v,hoverBackground:y,activeBackground:b,fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E}=o.header,{isAdjustingWidth:I}=qG([u]),D=e=>{e.stopPropagation()},P={height:h,gridColumn:`1 / span ${c.size.x}`,gridRow:c.size.y,zIndex:c.size.x-0};return io.jsxs(jG,{isDimension:!0,background:d?b:v,interactions:a,hoverBackground:y,style:{...P,...ZF,color:g},onClick:e=>{!a.active||WB(e)||I||p(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[io.jsxs(zG,{justifyContent:"flex-start",children:[io.jsx($G,{fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E,justifyContent:"flex-start",children:io.jsx("span",{style:QF,children:s.get("SNPivotTable.IndentMode.Rows")})}),d?io.jsx(rU,{}):io.jsx(nU,{}),io.jsx(FG,{ref:f})]}),io.jsx(VG,{open:d,anchorEl:f.current,disableEnforceFocus:!0,children:e.map((n,r)=>[n&&n.id!==f$&&io.jsx("li",{role:"presentation",onClick:D,onKeyDown:D,children:io.jsx(aU,{cell:n,changeSortOrder:t})}),sU({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===c.size.y})&&io.jsx(Wz,{"data-testid":"group-divider",variant:"middle"})])}),io.jsx(iU,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},uU=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,cU={display:"grid",width:"fit-content"},dU=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=l$(),{gridSectionsData:{headersData:u}}=AV();return io.jsxs("div",{"data-testid":"HEADER_GRID",style:{...cU,gridTemplateColumns:n.map(e=>`${e}px`).join(" "),gridTemplateRows:u.data.map(()=>`${r}px`).join(" "),height:a},children:[u.size.y>1&&io.jsx(tU,{columnSpan:u.size.x-1,rowSpan:u.size.y-1}),u.data.map((a,c)=>{let d=[];if(uU({layoutService:l,headersData:u,topRowIndex:c})){const n=a.at(0);return Array.isArray(n)&&d.push(io.jsx(lU,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=a.reduce((t,a,d)=>{if(a&&!Array.isArray(a)){const p=o(d,a.isLocked,a.label),f=l.isIndentModeEnabled&&1===u.size.x;t.push(io.jsx(eU,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&u.size.x>1?2:d+1,gridRow:c+1,zIndex:u.size.x-d},isLastRow:c===u.size.y-1,isFirstColumn:0===d,isLastColumn:d===u.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:p,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:f,tableWidth:e},a.id))}return t},[]),d})]})};var pU=b(dU);const fU=(e,t,n,r)=>{const{layoutService:i}=l$();g(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!0))},[e,t,n,r,i])},hU=(e,t)=>{Lz(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!1))},[e,t])},mU=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},gU=()=>{},vU=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:u,index:c})=>{const{styleService:d,layoutService:p}=l$(),{interactions:f}=o$(),{direction:h}=n$(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:v,createPointerUpHandler:y}=UB(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,S=!(x||!f.active||!f.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||u),w=S?g(c,e=>mU(e,r)):void 0,C=S?v(c):void 0,E=S?y(c,e=>mU(e,r)):void 0,I=_V({isLeftColumn:s,layoutService:p,representation:n.representation});return io.jsx("div",{className:gT,title:f.passive?n.representation.text:void 0,style:{...t,...nz(o,a,d.grid.border,h,b),...iz({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:d.grid.divider}),...ZF,padding:"rtl"===h?"0px 0px 0px 4px":"0px 4px",cursor:oG(S),background:eG({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:s?void 0:p.size.x-n.x,justifyContent:zB(n,p,s,h,I),display:"flex",...p.isIndentModeEnabled&&s&&{["rtl"===h?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:FB(n,p)},"aria-hidden":"true",onMouseDown:w,onMouseOver:C,onPointerUp:E,onKeyUp:gU,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},yU=e=>{e.stopPropagation()},bU=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:yU,color:oN.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),xU=({href:e,text:t,interactions:n,color:r})=>io.jsx(bd,{...bU({href:e,text:t,interactions:n,color:r}),children:t}),SU=Y();SU.use(U),SU.renderer.prio(["canvas"]);const wU=(e,t)=>e&&"center"!==e&&"rtl"===t?TB(e):e,CU=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=l$(),{direction:a}=n$();return io.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[io.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:XB(e),alignItems:wU(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:io.jsx(gG,{representation:t,textStyle:n})}),io.jsx(UG,{padding:4/(o<=2?2:1),alignSelf:XB(e,!0),children:!!t.labelStructure&&hG(t.labelStructure)})]})},EU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,IU=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>io.jsxs("span",{children:[io.jsx(bd,{...bU({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&EU(n)]}),DU=({children:e,textStyle:t,shouldEnableStickyText:n})=>io.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),PU=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,RU=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=n$(),{isActive:i}=UB(),{layoutService:o,styleService:a}=l$(),{interactions:s}=o$(),l=n&&o.isIndentModeEnabled;let u=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const c=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...QF,...ez(PU({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:tG({cell:e,styleService:t,isCellSelected:n}),fontWeight:nG({cell:e,styleService:t}),fontStyle:rG({cell:e,styleService:t}),textDecoration:iG({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===mF.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?CU:vG;return io.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:c,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:zB(e,o,n,r)})}if(e.representation.type===mF.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?IU:xU;u=io.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return io.jsx(DU,{shouldEnableStickyText:l,textStyle:{...c,...e.representation.type===mF.Image&&e.isNull?{alignSelf:XB(e)}:{}},children:u})},MU=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=l$(),{isSelected:o}=UB(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:u,totalDividerIndex:c}=n,{isAdjustingWidth:d,setIsAdjustingWidth:p}=qG([n]),f=mU(e,n),h=a?e===l-1:u,m=a?u:e===l-1,g=oB(f,c,i.isIndentModeEnabled);if(void 0===f){const{background:n}=r.dimensionValues;return io.jsx(aB,{style:{...t,background:n},index:e,isLastRow:h,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const v=o(f);return io.jsxs(vU,{reactWindowStyle:t,isLeftColumn:a,isLastRow:h,isLastColumn:m,isCellSelected:v,showTotalCellDivider:g,cell:f,data:n,isAdjustingWidth:d,index:e,children:[io.jsxs(sB,{verticalAlign:XB(f),width:lB(f.representation),right:f.isLeftColumn?void 0:4,isLeftColumn:a,children:[io.jsx(lG,{isLeftColumn:a,isCellSelected:v,cell:f}),io.jsx(RU,{isLeftColumn:a,isCellSelected:v,cell:f})]}),io.jsx(_G,{cellInfo:{...f,columnWidthLocation:f.isPseudoDimension?wF.Measures:wF.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var LU=n.memo(MU,HH);const AU=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},kU=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},OU=(e,t)=>n=>{e.current&&(e.current[t]=n)},qU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...JF},TU={overflow:"hidden",willChange:"auto",flexShrink:0},NU=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=n$(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:u}}}=l$(),{qSize:c}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:p}}=AV();hU(e,d),fU(e,t,n,l);const f=o.rowsOnCurrentPage*l,h={...qU,borderColor:u,width:r.reduce((e,t)=>e+t,0)};return io.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:d.grid.map((t,u)=>{const h=u===d.columnCount-1,m=h$(p[u]),{itemCount:g,estimatedItemSize:v,listValues:y}=kU(t,f,o.rowsOnCurrentPage,h),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,y,l,h,c.qcy);return io.jsx(zH,{ref:OU(e,u),style:{...TU,flexGrow:h?1:0,direction:a},height:n,width:r[u],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:g,showLastBorder:i,listValues:y,totalDividerIndex:d.totalDividerIndex},itemKey:RG,estimatedItemSize:v,children:LU},m)})})};var _U=b(NU);const jU={overflow:"hidden",willChange:"auto"},FU=e=>({...JF,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),zU=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=n$(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:u}}=l$(),{gridSectionsData:{headersData:c,topDimensionData:d}}=AV(),p={...FU(a),borderColor:l,height:r};hU(e,d),fU(e,n,r,u);const f=s.size.x*o();return 0===d.rowCount?io.jsx("div",{style:{width:n,height:r,...FU(a)}}):io.jsx("div",{style:p,"data-section-id":"TOP_GRID",children:d.grid.map((r,l)=>{const u=l===d.rowCount-1,{itemCount:p,estimatedItemSize:h,listValues:m}=kU(r,f,s.size.x,u),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=uU({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:c,topRowIndex:l}),v=g?h$(g):`empty ${l}`;return io.jsx(zH,{ref:OU(e,l),style:jU,height:t(),width:n,itemCount:p,itemSize:AU({list:r,listValues:m,isLastRow:u,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:u,itemCount:p,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:RG,estimatedItemSize:h,direction:a,children:LU},v)})})};var WU=b(zU);const $U=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=l$(),n=iH(),r=(()=>{const{model:e}=o$(),t=f(async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}},[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:c},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:h},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:v}}=rH(),{leftGridWidth:y,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:S,showLastRightBorder:w,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:E,overrideLeftGridWidth:I}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=l$(),{gridSectionsData:{headersData:o}}=AV(),{measureText:a}=Dz(i.header,{allowLineBreaks:!1}),s=KV({tableWidth:e}),l=XV({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,c=f((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let u=!1,c=!1,d=a(n)+qV;return t&&d+OV<=l&&(c=!0,d+=OV),d+OV<=l&&(u=!0),{shouldShowMenuIcon:u,shouldShowLockIcon:c}},[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return d(()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()},[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:c}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:v}),{gridScaffoldDimensions:D,headerGridDims:P,topGridDims:R,leftGridDims:M,dataGridDims:L,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:k}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=iH(),{pageInfo:l}=n$(),{gridSectionsData:{headersData:u,topDimensionData:c}}=AV(),d=Math.min(s.height*TV,Math.max(s.height*TV-25,s.height-t-a)),p=s.width*TV,f=l.rowsOnCurrentPage*t,h=Math.max(u.size.y,c.rowCount,1),m=e*h,g=e*h,v=Math.min(p,n),y=s.width-p,b=Math.max(y,s.width-v),x=Math.min(d,m,g),{availableHeight:S,everyThingFitsInTableRectHeight:w,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+f+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,v,b),E=S-d,I=Math.max(E,S-x),D=Math.min(I,f),P=Math.min(I,f),R=m+1+f,{visibilityStatus:M,metadata:{hasLeftGridOverflowX:L,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,u=s>r,c=o>t,d=a>n,p=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:u?"scroll":"hidden"},leftGrid:{overflowX:c?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:u,hasLeftGridOverflowX:c,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:v,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:I}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${v}px ${b}px`,gridTemplateRows:`${x}px ${I}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:v,height:R-g+(!L&&A?a:0)},stickyWrapper:{width:v,height:I-1-a},self:{width:v,height:Math.max(t,D-(w?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:R-g+(!A&&L?a:0)},stickyWrapper:{width:b-1-o,height:I-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,P-(w?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:w,scrollbarsVisibilityStatus:M}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:y,leftGridOriginalWidth:b,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=f(()=>e,[e]),q=f(()=>t,[t]);return(()=>{const{downloadService:e}=l$();d(()=>{e.notifyIsDoneRendering()})})(),io.jsxs(aH,{style:D,children:[io.jsx("div",{style:{overflow:"hidden"},ref:i,children:io.jsx(pU,{tableWidth:n.width,leftGridWidth:y,columnWidths:x,getHeaderCellsIconsVisibilityStatus:E,rowHight:e,height:P.height,changeSortOrder:r,overrideLeftGridWidth:I})}),io.jsx(uH,{style:k.topGrid,origin:EF.TopGrid,ref:o,children:io.jsx(oH,{style:R.fullSizeWrapper,children:io.jsx(cH,{style:R.stickyWrapper,children:io.jsx(WU,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:w,bottom:!1},getRightGridColumnWidth:C})})})}),io.jsx(uH,{style:k.leftGrid,origin:EF.LeftGrid,ref:a,children:io.jsx(oH,{style:M.fullSizeWrapper,children:io.jsx(cH,{style:M.stickyWrapper,children:io.jsx(_U,{leftGridRef:u,...M.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),io.jsx(uH,{style:k.dataGrid,origin:EF.DataGrid,ref:s,children:io.jsx(oH,{style:L.fullSizeWrapper,children:io.jsx(cH,{style:L.stickyWrapper,children:io.jsx(kG,{dataGridRef:c,rowHightCallback:q,...L.self,showLastBorder:{right:w,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:h})})})})]})},VU=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=o$(),{pageInfo:i,updatePageInfo:o,rect:a}=n$(),{layoutService:s}=l$(),{layout:l,hasData:u}=s;return io.jsxs(io.Fragment,{children:[u?io.jsx($U,{}):null,io.jsx(c$,{}),io.jsx(e$,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const HU=(e,{selections:t,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){const t=kS();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ls({...t,direction:e})}(r.direction);e.render(io.jsx(n.StrictMode,{children:io.jsx(ml,{theme:a,children:io.jsx(a$,{...o,children:io.jsx(r$,{...r,children:io.jsx(YB,{selections:t,children:io.jsx(u$,{...i,children:io.jsx(kV,{children:io.jsx(VU,{})})})})})})})}))};var BU=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(BU||{}),GU=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(GU||{}),UU=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(UU||{}),YU=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(YU||{});const KU=e=>e?`${parseInt(e,10)}px`:void 0,XU=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?YF.Transparent:n}},JU=(e,t)=>+(parseInt(e,10)*UF*t+8).toFixed(2),ZU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?BF:"normal",QU=e=>e?.some(e=>"italic"===e)?"italic":"normal",eY=e=>e?.some(e=>"underline"===e)?"underline":"none",tY=document.createElement("textarea");function nY(e){tY.value=e,document.body.appendChild(tY),tY.select(),tY.setSelectionRange(0,tY.value.length),document.execCommand("copy"),document.body.removeChild(tY)}tY.style.position="absolute",tY.style.left="-9999px",tY.setAttribute("readonly","");function rY(e){T?.((t,n)=>{const r=n.target,i=r?.closest(`.${gT}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>{nY(t)}):nY(t))})(i)}}),e?.forEach(e=>{e(t,n,i)})})}const iY=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>hz((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:c}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(d$,0,0,!0),await e.expandLeft(d$,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:JG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:YG.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:u,label:c,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(d$,0,0,!0),await e.collapseLeft(d$,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:JG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:YG.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:u,label:c,translator:r}))},[e,t,n]),oY=(e,t)=>R(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,u=r?.content?.rowsPerPage??15e3,c={x:Math.min(e.qHyperCube.qSize.qcx,GF),y:Math.min(e.qHyperCube.qSize.qcy,u)},d=o.slice(0,i),p=e=>d.some(t=>t===e),f=p(p$),h=new Map(o.map(e=>[s[e]??p$,e])),m=a.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(f)return 0;const n=e%m.length;return t?n:a.findIndex(e=>e===m[n])},getDimensionInfo:e=>e===p$?void 0:s.at(e),getDimensionInfoIndex:e=>h.get(e)??-1,size:c,isSnapshot:l,hasLimitedData:!l&&c.x<e.qHyperCube.qSize.qcx,hasData:c.x>0&&c.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:f,leftDimensionInfoIndexes:d,isLeftDimension:p,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:xT.Auto,pixels:bT.PixelsDefault,percentage:bT.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),aY=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=gz(e);return t.current=e,t})(IV(i));return wz(async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:u}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,u)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,u))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(GF,n.qcx);if(n.qcy<a)return null;let u=0,c=a;if(e){u=t.gridColumnStartIndex,c=a+t.gridRowStartIndex;const e=c+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(c=Math.max(0,s-i)),n>l&&(u=Math.max(0,l-o))}return{qLeft:u,qTop:c,qWidth:Math.min(l-u,o),qHeight:Math.min(s-c,i)}})(s,n,o.qHyperCube.qSize,r,i,u);return t?e.getHyperCubePivotData(d$,DV(t)):[]}return t.qPivotDataPages},[o,a,e,n,r.page,r.rowsPerPage,l,s])},sY=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),lY=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:sY({rowsPerPage:n,totalRowCount:e,page:t})}),uY=15,cY=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=M();return N(async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,u=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-uY,0),u=Math.max(s+i-uY,s,0),c=GF-l,d=s+t.rowsOnCurrentPage-u;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=IV(n);return{qLeft:l,qTop:u,qWidth:Math.min(c,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:u,qWidth:Math.min(c,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),c=DV(u),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(d$,[d,...c]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o}),_(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)}),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var dY={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const pY=()=>{const e=j(),t=e.language();return R(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(dY).forEach(t=>{e.add(dY[t])})}(e)},[e]),{translator:e,language:t}},fY=e=>{const{flags:t}=e,n=F(),r=(e=>{const t=R(()=>Pz(e),[e]);return k(()=>()=>{t.unmount()},[t]),t})(n),i=z(),o=W(),a=$(),s=V(),l=H(),u=(()=>{const{viewState:e}=M(),t=gz(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=R(()=>fz(),[]),o=hz(e=>{t.current.add(e)},[t]),a=hz(j_(async()=>{await Promise.all(t.current),t.current.clear(),i()},1e3),[i,t]);return L(async()=>{await r},[r]),R(()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:a,waitForPromise:o}),[a,n,e,o])})(),c=((e,t)=>{const[n]=wz(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]);return R(()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[n])})(o,i),d=oY(i,t),p=(e=>{const t=q();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),f=B(),h=Sz(i,n),{translator:m,language:g}=pY(),{pageInfo:v,updatePageInfo:y}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=A(()=>{const a=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...lY(r.qcy,a,o)}}),l=e.layout.qHyperCube.qSize.qcy;return k(()=>{s(t=>({...t,...lY(l,t.page,o),shouldShowPagination:l>e.size.y&&!i}))},[l,e.size.y,s,i,o]),k(()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=sY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}},[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:sY({...a,...e})})}}})(d,u),b=((e,t,n)=>R(()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData),[n,e.page,t.snapshotData]))(v,i,u),x=cY({rect:G(),layoutService:d,viewService:b,model:o,pageInfo:v}),[S,w]=aY({model:o,layoutService:d,viewService:b,pageInfo:v,rect:x}),C=R(()=>((e,t)=>{const n=t.layout.components?.find(e=>"theme"===e.key),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,u=n?.grid,c=(t,n,r)=>e.getStyle(t,n,r),d=+(u?.[BU.LineClamp]??c(GU.Grid,UU.Grid,YU.LineClamp)??1),p=+(u?.[BU.ColumnLineClamp]??c(GU.Grid,UU.Grid,YU.ColumnLineClamp)??1),f=XU(e,r?.[BU.Background])??c(GU.Dimension,UU.LabelName,YU.BackgroundColor)??YF.Transparent,h={header:{fontSize:KU(r?.[BU.FontSize])??c(GU.Dimension,UU.LabelName,YU.FontSize)??VF,fontFamily:r?.[BU.FontFamily]??c(GU.Dimension,UU.LabelName,YU.FontFamily)??HF,fontWeight:ZU(r?.[BU.FontStyle],BF),fontStyle:QU(r?.[BU.FontStyle]),textDecoration:eY(r?.[BU.FontStyle]),color:XU(e,r?.[BU.FontColor])??c(GU.Dimension,UU.LabelName,YU.FontColor)??oN.TEXT,background:f,hoverBackground:Y_(f,ST),activeBackground:Y_(f,wT)},dimensionValues:{fontSize:KU(i?.[BU.FontSize])??c(GU.Dimension,UU.LabelValue,YU.FontSize)??VF,fontFamily:i?.[BU.FontFamily]??c(GU.Dimension,UU.LabelValue,YU.FontFamily)??HF,fontWeight:ZU(i?.[BU.FontStyle],void 0),fontStyle:QU(i?.[BU.FontStyle]),textDecoration:eY(i?.[BU.FontStyle]),color:XU(e,i?.[BU.FontColor])??c(GU.Dimension,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,i?.[BU.Background])??c(GU.Dimension,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},measureValues:{fontSize:KU(o?.[BU.FontSize])??c(GU.Measure,UU.LabelValue,YU.FontSize)??VF,fontFamily:o?.[BU.FontFamily]??c(GU.Measure,UU.LabelValue,YU.FontFamily)??HF,fontWeight:ZU(o?.[BU.FontStyle],"normal"),fontStyle:QU(o?.[BU.FontStyle]),textDecoration:eY(o?.[BU.FontStyle]),color:XU(e,o?.[BU.FontColor])??c(GU.Measure,UU.LabelValue,YU.FontColor)??YF.FontSecondary,background:XU(e,o?.[BU.Background])??c(GU.Measure,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},measureLabels:{fontWeight:ZU(a?.[BU.FontStyle],"normal"),fontStyle:QU(a?.[BU.FontStyle]),textDecoration:eY(a?.[BU.FontStyle]),color:XU(e,a?.[BU.FontColor])??c(GU.Measure,UU.LabelName,YU.FontColor)??YF.FontSecondary,background:XU(e,a?.[BU.Background])??c(GU.Measure,UU.LabelName,YU.BackgroundColor)??YF.Transparent},totalValues:{fontWeight:ZU(s?.[BU.FontStyle],BF),fontStyle:QU(s?.[BU.FontStyle]),textDecoration:eY(s?.[BU.FontStyle]),color:XU(e,s?.[BU.FontColor])??c(GU.Total,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,s?.[BU.Background])??c(GU.Total,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},nullValues:{fontWeight:ZU(l?.[BU.FontStyle],"normal"),fontStyle:QU(l?.[BU.FontStyle]),textDecoration:eY(l?.[BU.FontStyle]),color:XU(e,l?.[BU.FontColor])??c(GU.Null,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,l?.[BU.Background])??c(GU.Null,UU.LabelValue,YU.BackgroundColor)??YF.NullValueBackground},grid:{columnLineClamp:p,lineClamp:d,border:XU(e,u?.[BU.Border])??c(GU.Grid,UU.Grid,YU.BorderColor)??YF.DividerLight,divider:XU(e,u?.[BU.Divider])??c(GU.Grid,UU.Divider,YU.BorderColor)??YF.DividerDark,background:XU(e,u?.[BU.Background])??c(GU.Grid,UU.Grid,YU.BackgroundColor)??YF.Transparent},selectedColors:U_(e)};return h.headerCellHeight=Math.max(JU(h.header.fontSize,p),JU(h.dimensionValues.fontSize,p),32),h.contentCellHeight=Math.max(JU(h.measureValues.fontSize,d),JU(h.dimensionValues.fontSize,d),24),h.dimensionValueTextHeight=JU(h.dimensionValues.fontSize,1),h})(h,d),[h,d]),E=((e,t,n)=>{const[,r,i]=wz(async()=>{const t=TN(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,Mz].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(h,i,e),{direction:I}=M();rY([iY({model:o,layoutService:d,effectivePropertiesService:c,translator:m})]),k(()=>{!w&&o&&!!S&&E&&HU(r,{selections:f,baseObjects:{rect:x,pageInfo:v,qPivotDataPages:S,updatePageInfo:y,direction:I},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:h,keyboard:l,translator:m,interactions:p},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:u,effectivePropertiesService:c}})},[o,a,x,p,f,b,d,u,w,S,C,r,E,m,g,v,y,c,s,l,h,e,I])},hY={version:"7.17.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]},mY=()=>({...hY,qHyperCubeDef:{...hY.qHyperCubeDef,qIndentMode:!1}})}}});
102
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,p=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=p-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,p):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,p=d.length,b=0;b<p;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},q_({exports:{}});const G_=(e,t=oN.TEXT,n=oN.WHITE)=>{const r=bN(e??""),i=bN(t),o=bN(n);return r.isInvalid()?t:function(e,t,n){const r=xN(e,t),i=xN(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},U_=e=>{const t=e.getStyle("","","dataColors.selected")||oN.SELECTED,n=function(e,t){const n=bN("#FFFFFF"),r=bN(e),i=bN(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=xN(n,r),a=xN(i,r),s=o>a||o>4.5;return!s&&a>3?i.getHex():s?"#FFFFFF":"#000000"}(t,oN.TEXT);return{background:t,color:n}},Y_=(e,t)=>{const n=bN(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},K_=e=>{const t=bN(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},X_=e=>{e.stopPropagation(),e.preventDefault()},J_=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,Z_=(e,t)=>{const n=e.closest(".exploration-list"),r=n?.nextElementSibling||n?.parentElement?.nextElementSibling;if(null===r||!r){if(t===vT.Tab)return;return n?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]}return r.getElementsByClassName("exploration-section-header")[0]},Q_=e=>{const{currentTarget:t}=e,n=J_(t);let r=t.closest("li")?.previousElementSibling?.getElementsByClassName(n)[0];if(!r){const e=t.closest(".exploration-list"),i=e?.querySelector(".exploration-section-header");if(i)return i;if(r=((e,t)=>{const n=e.closest(".exploration-list"),r=n?.previousElementSibling;if(null===r||!r)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const i=r.getElementsByClassName(t);return i.length>0?i[i.length-1]:void 0})(t,n),!r){const e=t.closest(".exploration-panel")?.getElementsByClassName(n)[1];return e??null}}return r},ej=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},tj=e=>{const t=e.key===vT.Down?(e=>{const{currentTarget:t,key:n}=e,r=J_(t),i=t.closest("li");let o=i?.nextElementSibling?.getElementsByClassName(r)[0];return o||(o=Z_(t,n),o)?o:t.closest(".exploration-panel")?.getElementsByClassName(r)[0]})(e):Q_(e);t&&ej(t)},nj=(e,t)=>{const{key:n}=e;switch(n){case vT.Tab:if(e.shiftKey)e.preventDefault(),((e,t)=>{const{currentTarget:n}=e,r=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if(n===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=r&&r[t.itemIndex];return void(e&&ej(e))}const n=Q_(e);n&&ej(n)}if(n===t.items.explorationItemFocusRef.current){const t=n.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void ej(t);const r=Q_(e);r&&ej(r)}})(e,t);else{const n=((e,t)=>{const{currentTarget:n,key:r}=e;if(e.shiftKey)return!0;if(n===t.items.explorationItemFocusRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];return e&&ej(e),!0}if(n===t.items.draggableIconRef.current){const e=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const n=e&&e[t.itemIndex+1];return n&&ej(n),!0}const i=Z_(n,r);if(!i)return!1;ej(i)}return!0})(e,t);n?e.preventDefault():e.stopPropagation()}break;case vT.Down:case vT.Up:X_(e),tj(e);break;case vT.Enter:case vT.Space:X_(e),((e,t)=>{const{currentTarget:n}=e;if(n===t.items.draggableIconRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-item")[0];return void(e&&ej(e))}if(n===t.items.explorationItemRef.current){const e=n.getElementsByClassName("exploration-draggable-icon")[0];return void ej(e)}n===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id)})(e,t)}},rj=(e,t)=>{const{key:n,currentTarget:r}=e;if(r===t.current&&n===vT.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:n}=e;if(n!==t.current)return;const r=n.closest('[role="region"]')?.getElementsByTagName("button")[0];r&&ej(r)})(e,t);else{const e=r.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&ej(e)}},ij=(e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=t.sectionIndex??2;if(0===r)return void((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel")?.getElementsByTagName("input")[0];r&&ej(r)})(e,t);const i=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[r-1],o=i?.getElementsByClassName("exploration-item-focus").length??0;if(o>0){const e=i?.getElementsByClassName("exploration-draggable-icon")[o-1];e&&ej(e)}},oj=(e,t)=>{const{key:n}=e;switch(n){case vT.Tab:X_(e),e.shiftKey?ij(e,t):((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-list"),i=r?.getElementsByClassName("exploration-item-focus")[0];if(!i){const e=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[2].getElementsByClassName("exploration-section-header")[0];return void(e&&ej(e))}ej(i)})(e,t);break;case vT.Down:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a+1<i?r?.getElementsByClassName("exploration-section-header")[a+1]:r?.getElementsByClassName("exploration-section-header")[0],o&&ej(o)})(e,t);break;case vT.Up:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a-1>=0?r?.getElementsByClassName("exploration-section-header")[a-1]:r?.getElementsByClassName("exploration-section-header")[i-1],o&&ej(o)})(e,t);break;case vT.Enter:case vT.Space:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(e.preventDefault(),n!==t.ref.current)return;const r="all"!==t.checkState;t.toggleAllCheckboxes(r)})(e,t)}},aj=({children:e})=>io.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),sj=({children:e,sectionIndex:t})=>{const r=Dw(void 0!==t?NT(t):tN),i=Pw(void 0!==t?_T(t):nN),o=n.useRef(null),a={ref:o,toggleAllCheckboxes:i,checkState:r,sectionIndex:t};return io.jsxs(Qu,{ref:o,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{oj(e,a)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"12px","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsx(Ic,{disabled:"disabled"===r,checked:"all"===r,indeterminate:"some"===r,onChange:e=>{i(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),io.jsx(aj,{children:e})]})},lj=({sectionIndex:e})=>{const t=Dw(OT(e));return io.jsx(sj,{sectionIndex:e,children:t})},uj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M.5 4.774v6.452a2 2 0 0 0 1.154 1.813l5.5 2.566a2 2 0 0 0 1.692 0l5.5-2.566a2 2 0 0 0 1.154-1.813V4.774a2 2 0 0 0-1.154-1.813L8.846.395a2 2 0 0 0-1.692 0l-5.5 2.566A2 2 0 0 0 .5 4.774m1 0v-.032l6 2.428v7.493l-5.423-2.53a1 1 0 0 1-.577-.907zm.545-.89.032-.016 5.5-2.567a1 1 0 0 1 .846 0l5.5 2.567.032.015L8 6.293zm12.455.858v6.484a1 1 0 0 1-.577.906L8.5 14.663V7.17z"})})),cj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M5.5 1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm0 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM5 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 1.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM9.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"})})),dj=fl("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),pj=fl(cj)(()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}})),fj=({children:e})=>io.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),hj=({icon:e,title:t,...r})=>{const[i,o]=Rw(hC),a=Dw(Hw),s=n.useRef(null),l=n.useRef(null),u=n.useRef(null),c={id:r.id,itemIndex:r.itemIndex,toggleCheckedById:o,items:{explorationItemRef:s,explorationItemFocusRef:l,draggableIconRef:u}};return io.jsxs(Qu,{ref:s,className:"exploration-item",onClick:e=>{e.stopPropagation(),o(r.id)},onKeyDown:e=>{nj(e,c)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"12px"},title:t,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsxs(Qu,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{nj(e,c)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${$T} inset`}},children:[io.jsx(Ic,{checked:i.has(r.id),"aria-label":a("ChartExploration.ListItem.Label",t),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===r.id?"hidden":"visible"}}),io.jsx(e,{height:"12px",style:{flexShrink:0}}),io.jsx(fj,{children:t})]}),io.jsx(pj,{ref:u,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{nj(e,c)}})]})},mj=e=>{const t=Dw(kT(e))??"";return io.jsx(hj,{title:t,icon:uj,...e})},gj=()=>{const e=Dw(qT),t=Dw(TT),n=Dw(UT),r=Pw(jT);return io.jsx(fT,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:KT,headerRenderer:lj,itemRenderer:mj})},vj=({itemIndex:e})=>{const t=Dw(ZT(e));return io.jsx(YT,{children:t})},yj=()=>{const e=Dw(Hw);return io.jsx(sj,{children:e("Common.Values")})},bj=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"}),io.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"})]})),xj=e=>{const{itemIndex:t}=e,n=Dw(ZT(t));return io.jsx(hj,{title:n,icon:bj,...e})},Sj=()=>{const e=Dw(QT),t=Dw(eN),n=Dw(GT),r=Pw(rN);return io.jsx(Qu,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:io.jsx(fT,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:vj,headerRenderer:yj,itemRenderer:xj})})},wj=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014zM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0m-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6 6 0 0 1-1.413 1.415"})})),Cj=()=>{const[e,t]=Rw(Bw),r=Dw(Hw),i=n.useRef(null),[o]=Dw(eN),[a=0,s=0]=Dw(TT),l=f(e=>{t(e.target.value)},[t]),u=0===e.length||0===a&&0===s&&0===o?r("Common.Search.NoResultsAvailable"):r("ChartExploration.Pivot.Search.ResultsFound",a.toString(),s.toString(),o.toString());return io.jsxs(Qu,{ref:i,onKeyDown:e=>{rj(e,i)},style:{position:"sticky",top:0,zIndex:10,width:"calc(100% - 16px)",backgroundColor:"var(--sprout-common-background-color-weak)",paddingTop:2,paddingRight:8,paddingLeft:8,paddingBottom:8},children:[io.jsx(dj,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:u}),io.jsx(Np,{size:"small",fullWidth:!0,"data-testid":"chart-exploration-search-input","aria-label":r("Common.Search.AccessibilityLabel"),type:"search",defaultValue:e,placeholder:r("Common.Search"),onChange:l,startAdornment:io.jsx(pd,{position:"start",children:io.jsx(wj,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},Ej=e=>{const t=Ls(Ef());return io.jsx(ml,{theme:t,children:io.jsx(xw,{children:io.jsx(mC,{props:e,children:io.jsxs(Qu,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[io.jsx(Cj,{}),io.jsx(gj,{}),io.jsx(Sj,{})]})})})})},Ij=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:Ej,classification:{tags:["exploration"],exclusive:!0}}};var Dj=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(Dj||{}),Pj=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(Pj||{}),Rj=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(Rj||{}),Mj=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(Mj||{});const Lj=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,Aj=e=>{if(!Array.isArray(e))return"";let t="{<";const n=[];if(e.forEach(e=>{let t=`[${e.field}]${e.exclude?"-":""}={`,r="}",i="";switch(e.type){case Rj.SEARCH:i=(e=>{let t="",n="";const r=e.options?.mode;if(!r)return"";switch(r){case Dj.BEGINNING_OF_WORD:t="*^",n="*";break;case Dj.ENDS_WITH:t="*";break;case Dj.STARTS_WITH:n="*";break;case Dj.MATCHES_EXACTLY:break;case Dj.CONTAINS:default:t="*",n="*"}const i=e.options.values?.[0]??"";return""!==i?`"${t}${i}${n}"`:""})(e);break;case Rj.CONDITION:i=(e=>{const{options:t}=e,n=t?.mode===Pj.GENERAL,r=t?.modifier?.type===Mj.FIXED_VALUE,i=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===i.length||!r&&(!t.firstValue?.aggregator||!t.firstValue?.field)||r&&!t.firstValue?.fixedValue||n&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let o,a,s="=";n&&r?(o=`${t.conditionField?.aggregator}(${Lj(t.conditionField?.field)})`,a=`${t.firstValue?.fixedValue}`):!n&&r?(o="",a=`${t.firstValue?.fixedValue}`,s=""):n||r?(o=`${t.conditionField?.aggregator}(${Lj(t.conditionField?.field)})`,a=`${t.firstValue?.aggregator}(${Lj(t.firstValue?.field)})`):(o=`${Lj(e.field)}`,a=`${t.firstValue?.aggregator}(total ${Lj(t.firstValue?.field)})`);const l=`${s}${o}${i[0]}${a}`;let u="";if(i.length>1){if(!r&&(!t.secondValue?.aggregator||!t.secondValue?.field)||r&&!t.secondValue?.fixedValue)return"";let e,a;n&&r?(e=`${t.secondValue?.fixedValue}`,a=` and ${o}`):!n&&r?(e=`${t.secondValue?.fixedValue}`,a=""):n||r?(e=`${t.secondValue?.aggregator}(${Lj(t.secondValue?.field)})`,a=` and ${o}`):(e=`${t.secondValue?.aggregator}(total ${Lj(t.secondValue?.field)})`,a=` and ${o}`),u=`${a}${i[1]}${e}`}return`"${l}${u}"`})(e);break;case Rj.CLEAR_SELECTION:i=`[${e.field}]=`,t="",r="";break;case Rj.VALUES:default:i=e.options?.values?e.options.values.map(e=>`'${e.replace(/'/g,"''")}'`).join(","):""}""!==i&&n.push(`${t}${i}${r}`)}),0===n.length)return;return t+=`${n.join(",")}>}`,t},kj=[];for(let e=0;e<256;++e)kj.push((e+256).toString(16).slice(1));let Oj;const qj=new Uint8Array(16);var Tj={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Nj(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!Oj){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Oj=crypto.getRandomValues.bind(crypto)}return Oj(qj)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(kj[e[t+0]]+kj[e[t+1]]+kj[e[t+2]]+kj[e[t+3]]+"-"+kj[e[t+4]]+kj[e[t+5]]+"-"+kj[e[t+6]]+kj[e[t+7]]+"-"+kj[e[t+8]]+kj[e[t+9]]+"-"+kj[e[t+10]]+kj[e[t+11]]+kj[e[t+12]]+kj[e[t+13]]+kj[e[t+14]]+kj[e[t+15]]).toLowerCase()}(r)}const _j=()=>crypto?.randomUUID?.()??function(e){return Tj.randomUUID&&!e?Tj.randomUUID():Nj(e)}(),jj=1e3,Fj=1e3,zj=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,n=((e,t)=>{const n=new Set;for(const t of e){if(n.has(t))return!0;n.add(t)}const r=e.includes(-1),i=e.filter(e=>-1!==e);if(t){const n=r?t.length+1:t.length;if(e.length!==n)return!0}const o=[...i].sort((e,t)=>e-t);for(let e=0;e<o.length;e++)if(o[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);n&&(e.qInterColumnSortOrder=((e,t)=>{const n=[];if(t)for(let e=0;e<t.length;e++)n.push(e);return e.qMeasures.length>=2&&n.push(-1),n})(e,t))},Wj=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},$j=e=>{if(!e)return;zj(e);const t=e.qDimensions,{qInterColumnSortOrder:n}=e;((e,t=[])=>{const n=t.filter(e=>-1!==e);for(let r=0;r<n.length;r++)if(-1!==n[r]&&n[r]!==r){const i=n[r],o=n.indexOf(r),a=n[o];Wj(n,r,o),Wj(e,r,o),Wj(t,t.indexOf(i),t.indexOf(a))}})(t,n)},Vj=P;class Hj extends Vj{#u;constructor(e,t){super(e),this.path=e.path,this.#u=t}async addDimension(e,t,n,r){if(!e||this.#c(e))return;const i=t??!1;if(e.qDef.cId||(e.qDef.cId=_j()),r)return this.addAlternativeDimension(e,i,n);if(this.getDimensions().length<this.maxDimensions()){const t=await(async(e,t,n,r)=>{const i=e.getDimensions(),o=e.hcProperties.qNoOfLeftDims;return await e.autoSortDimension(t),$j(e.hcProperties),(-1===o||Number.isNaN(+o))&&(e.hcProperties.qNoOfLeftDims=i.length),n?((e,t,n,r)=>{if(!e)return;const{qInterColumnSortOrder:i,qNoOfLeftDims:o}=e,a=t.length,s=i.indexOf(-1),l=-1!==s,u=void 0!==r?r+(o||0):void 0;if(l&&void 0!==u&&s>=u?((e,t,n)=>{t.splice(n,1),t.push(e),t.splice(n+1,0,-1)})(a,i,s):i.push(a),void 0===r)t.push(n);else if(void 0!==u){const e=l&&u>s?u-1:u;t.splice(e,0,n)}})(e.hcProperties,i,t,r):((e,t,n,r)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const i=e.qNoOfLeftDims,{qInterColumnSortOrder:o}=e,a=t.length,s=o.indexOf(-1),l=-1!==s&&i>0&&s<i;if(o.push(a),l)void 0===r?t.splice(i-1,0,n):s<r?t.splice(r-1,0,n):(t.splice(r,0,n),o.splice(s,1),o.splice(s+1,0,-1));else{const e=r??i;t.splice(e,0,n),-1!==s&&(o.splice(s,1),o.splice(s+1,0,-1))}e.qNoOfLeftDims++})(e.hcProperties,i,t,r),t})(this,e,i,n);return this.#d({section:i?"columns":"rows",cId:e.qDef.cId,addLast:void 0===n}),t}}async addDimensions(e,t,n){const r=[];for await(const i of e){const e=await this.addDimension(i,n,void 0,t);e&&r.push(e)}return r}addAlternativeDimension(e,t,n){if(!e||this.#c(e))return;const r=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=r.length);let i=n;return i=void 0===i?t?r.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+i:Math.min(i,this.hcProperties.excludedNoOfLeftDims),r.splice(i,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#d({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),e}async addFieldDimension(e,t,n,r={}){const i=this.createFieldDimension(e,t,n);return this.addDimension(i,r.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const n=e.map(e=>this.createFieldDimension(e.field,e.label,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const n=e.map(e=>this.createLibraryDimension(e.id,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}reinsertDimension(e,t,n){e.qDef.cId||(e.qDef.cId=_j());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,n);return this.reinsertAlternativeDimension(e,n,t)}reinsertAlternativeDimension(e,t,n){const r=this.getDimensions(),i=this.getAlternativeDimensions();if(r.length>=jj)return Promise.resolve();const o="number"==typeof t?t:i.length;return i.splice(o,0,e),this.#d({section:n?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,n){return Promise.all([...e].reverse().map(e=>this.removeDimension(e,t,n)))}async removeDimension(e,t,n){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!n&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#p({cId:t.qDef.cId,section:n?"columns":"rows"}),t}const r=this.getDimensions(),i=this.properties.qHyperCubeDef.qNoOfLeftDims,o=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof o&&"number"==typeof i&&o+1<=i&&this.properties.qHyperCubeDef.qNoOfLeftDims--;const a=this.properties.qHyperCubeDef.columnWidths?this.properties.qHyperCubeDef.columnWidths[1]:void 0;Array.isArray(a)&&a.length>e&&a.splice(e,1);const s=r.splice(e,1).at(0);if(s)return((e,t)=>{if(!e)return-1;const n=e.indexOf(t);if(-1===n)return-1;for(let n=0;n<e.length;++n)e[n]>t&&e[n]--;e.splice(n,1)})(this.hcProperties.qInterColumnSortOrder,e),$j(this.hcProperties),this.#p({cId:s.qDef.cId,section:n?"columns":"rows"}),s}#c(e){return!(!e||void 0===e.qDef.cId)&&[...this.getDimensions(),...this.getAlternativeDimensions()].some(t=>t.qDef.cId===e.qDef.cId)}async addMeasures(e,t=!1){const n=[];for await(const r of e){const e=await this.addMeasure(r,t,void 0,!0);e&&n.push(e)}return n}addAlternativeMeasures(e,t){if(this.#f(e))return;const n=this.getAlternativeMeasures(),r=void 0===t?n.length:t,i=n.splice(r,0,e);return this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),i}async addMeasure(e,t,n,r){if(this.#f(e))return;if(e.qDef.cId||(e.qDef.cId=_j()),t)return this.addAlternativeMeasures(e,n);r||delete e.qDef.qNumFormat;const i=this.getMeasures();if(i.length<this.maxMeasures()){const t=1===i.length;return void 0!==n&&n>=0?i.splice(n,0,e):i.push(e),this.autoSortMeasure(e).then(()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#h({cId:e.qDef.cId,addLast:void 0===n}),e))}return i.length<Fj?(this.getAlternativeMeasures().push(e),this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const n=this.getMeasures(),r=this.getAlternativeMeasures(),i=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=_j()),t=void 0!==t?t:n.length,n.length<this.maxMeasures()){if(n.splice(t,0,e),2===n.length){-1===i.indexOf(-1)&&i.push(-1)}this.#h({cId:e.qDef.cId})}else n.length<Fj&&(t=r.length,r.splice(t,0,e),this.#h({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#p({cId:t.qDef.cId,section:"measures"}),t}const n=this.getMeasures();let r,i,o;if("number"==typeof e&&e<n.length){r=2===n.length,i=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;r&&(o=t.indexOf(-1),t.splice(o,1),this.hcProperties.qNoOfLeftDims&&o+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(i=this.getAlternativeMeasures().splice(e-n.length,1)[0]);if(i)return this.#p({cId:i.qDef.cId,section:"measures"}),i}async removeMeasures(e,t){return await Promise.all([...e].reverse().map(e=>this.removeMeasure(e,t))),e}#f(e){return!(!e||void 0===e.qDef.cId)&&[...this.getMeasures(),...this.getAlternativeMeasures()].some(t=>t.qDef.cId===e.qDef.cId)}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#m("rows"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getColumnDimensions(){const e=this.#m("columns"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#g(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#v(e){return[...this.#g(e)]}#y(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#b(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#x(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#m(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:n}=this.hcProperties;if(this.#S())return"columns"===e?t:[];switch(e){case"rows":return-1===n?t:t.slice(0,n);case"columns":return-1===n?[]:t.slice(n);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#S(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#w(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#S())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#C(e,t=!0){const n=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(n);const r=this.#m(e),i=this.getDimensions(),o=r.map(e=>-1===e?-1:i[e]);switch(e){case"rows":return o.concat(t?this.getAlternativeRowDimensions():[]).map(n);case"columns":return o.concat(t?this.getAlternativeColumnDimensions():[]).map(n);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],n=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const r=t.filter((e,n)=>t.indexOf(e)!==n);return console.warn("Corrupt ranked list detected: duplicate ids",{duplicates:r,section:e,chartId:n}),!0}const r=this.#C(e);if(t.length!==r.length)return console.warn("Corrupt ranked list detected: length mismatch",{section:e,chartId:n,fieldIds:r,rankedList:t,diff:new Set(r).symmetricDifference(new Set(t))}),!0;const i=r.filter(e=>!t.includes(e));if(i.length>0)return console.warn("Corrupt ranked list detected: missing ids",{missingIds:i,section:e,chartId:n}),!0;const o=this.#C(e,!1),a=t.filter(e=>o.includes(e)),s=o.filter((e,t)=>e!==a[t]);return s.length>0&&(console.warn("Corrupt ranked list detected: main field order mismatch",{section:e,chartId:n,orderMismatchIds:s}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#E({section:e});case"measures":return this.#I();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#E({section:e}){const t=this.getDimensions(),n=this.#m(e),r="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),i=n.map(e=>-1===e?-1:t[e].qDef.cId);return i.push(...r.map(e=>e.qDef.cId)),this.#y(e,i)}#I(){if(void 0!==this.hcProperties.rankedList?.measures)return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map(e=>e.qDef.cId);return this.#y("measures",e)}#D({section:e,cId:t,fields:n,addLast:r}){const i=this.#g(e),o=n.findIndex(e=>e.qDef.cId===t),a=n[o+1]?.qDef.cId,s=n[o-1]?.qDef.cId;if(r)i.push(t);else if(o>=0)if(a){const e=i.indexOf(a);i.splice(e,0,t)}else if(s){const e=i.indexOf(s);i.splice(e+1,0,t)}else i.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#d({section:e,cId:t,alternative:n=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#E({section:e});let i=[];return i="columns"===e?n?this.getAlternativeColumnDimensions():this.getColumnDimensions():n?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#D({section:e,cId:t,fields:i,addLast:r})}#h({cId:e,alternative:t=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#I();const r=t?this.getAlternativeMeasures():this.getMeasures();return this.#P(),this.#D({section:"measures",cId:e,fields:r,addLast:n})}#P(){const e=this.#g("rows"),t=this.#g("columns");this.#w("rows")&&!e.includes(-1)?e.push(-1):this.#w("columns")&&!t.includes(-1)&&t.push(-1)}#R(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#g("rows"),t=this.#g("columns"),n=e.indexOf(-1),r=t.indexOf(-1);-1!==n&&e.splice(n,1),-1!==r&&t.splice(r,1)}#p({cId:e,section:t}){const n=this.#g(t),r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.#R())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex(t=>t.qDef.cId===e),n=this.#v("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t);if(void 0===i)return;const o=n.slice(r+1).find(e=>this.getAlternativeMeasures().some(t=>t.qDef.cId===e)),a=this.getAlternativeMeasures().findIndex(e=>e.qDef.cId===o);await this.addAlternativeMeasures(i,-1===a?void 0:a),this.#y("measures",n)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex(t=>t.qDef.cId===e),n=this.#v("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t,!0);if(void 0===i)return;const o=this.getMeasures().map(e=>e.qDef.cId),a=n.slice(r+1).find(e=>o.includes(e)),s=o.findIndex(e=>e===a);await this.addMeasure(i,!1,-1===s?void 0:s),this.#y("measures",n)}async moveDimensionToAlternative(e){const t=this.#b(e),n=this.getDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#v(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!1,o);if(void 0===a)return;const s=r.slice(i+1).find(e=>this.getAlternativeDimensions().some(({qDef:t})=>t.cId===e));let l=this.getAlternativeDimensions().findIndex(({qDef:e})=>e.cId===s);l=-1===l?void 0:l;void 0!==this.addAlternativeDimension(a,o,l)&&this.#y(t,r)}async moveDimensionFromAlternative(e){const t=this.#b(e),n=this.getAlternativeDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#v(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!0,o);if(void 0===a)return;const s=this.#C(t,!1),l=r.slice(i+1).find(e=>s.includes(e));let u=s.findIndex(e=>e===l);u=-1===u?void 0:u;void 0!==await this.addDimension(a,o,u)&&this.#y(t,r)}movePseudoDimension({toIndex:e,toSection:t}){const n=this.#b(-1);if(null===n)return void console.error("Cannot move pseudo dimension, unable to find it in any section",{toIndex:e,toSection:t});const r="columns"===t,i=n===t,o=this.#v(t);if(i){const e=o.indexOf(-1);o.splice(e,1)}else{const i=this.#g(n),o=i.indexOf(-1);if(-1===o)return void console.error("Couldn't delete pseudo dimension from current section",{toIndex:e,toSection:t,fromSection:n});i.splice(o,1),this.hcProperties.qNoOfLeftDims=r?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const a=e-o.slice(0,e).filter(e=>this.#x(e)).length,s=r?this.hcProperties.qNoOfLeftDims+a:a,l=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(l,1),this.hcProperties.qInterColumnSortOrder.splice(s,0,-1),o.splice(e,0,-1),this.#y(t,o)}async moveDimension({cId:e,toIndex:t,toSection:n}){const r=this.#b(e),i=this.#x(e);if(null===r)return void console.error("Cannot move dimension, unable to find it in any section",{cId:e});const o=(i?this.getAlternativeDimensions():this.getDimensions()).findIndex(({qDef:t})=>t.cId===e);if(-1===o)return void console.error("Couldn't find dimension to move",{cId:e,toIndex:t,toSection:n});const a=this.#v(n),s=a.indexOf(e);-1!==s&&a.splice(s,1);const l=t-a.slice(0,t).filter(e=>this.#x(e)!==i).length,u="columns"===n,c="columns"===r,d=await this.removeDimension(o,i,c);if(void 0===d)return;void 0!==await this.addDimension(d,u,l,i)&&(a.splice(t,0,e),this.#y(n,a))}async moveMeasure({cId:e,toIndex:t}){const n=this.#x(e),r=(n?this.getAlternativeMeasures():this.getMeasures()).findIndex(t=>t.qDef.cId===e);if(-1===r)return void console.error("Cannot move measure, unable to find it in any section",{cId:e});const i=this.#v("measures"),o=i.indexOf(e);-1!==o&&i.splice(o,1);const a=t-i.slice(0,t).filter(e=>this.#x(e)!==n).length,s=await this.removeMeasure(r,n);if(void 0===s)return;void 0!==await this.addMeasure(s,n,a)&&(i.splice(t,0,e),this.#y("measures",i))}getLabels(){return this.getMeasures().filter(e=>!e.qLibraryId&&!!e.qDef.qLabel).map(e=>e.qDef.qLabel)}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find(t=>t.id===e)}addFilterField(e){const t=e.qTags??e.tags,n=Array.isArray(t)&&t.includes("$numeric"),r=e.isDerived,i=Array.isArray(this.properties.filters)?this.properties.filters:[],o={type:"values",field:r?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:_j(),qTags:Array.isArray(t)?t:[],isNumeric:n};return i.push(o),this.properties.filters=i,this.properties.qHyperCubeDef.qContextSetExpression=Aj(i),o}addFilters(e){const t=[];for(const n of e)t.push(this.addFilterField(n));return t}#M(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=Aj(t),t}removeFilters(e){if(0===e.length)return[];let t=[];const n=[...e].sort((e,t)=>t-e);t=this.getFilters().filter((t,n)=>e.includes(n));for(const e of n)this.#M(e);return t}getAddDimensionLabel(){return this.#u.get("Visualization.Requirements.AddDimension")}canColorBy(){return!1}}var Bj={exports:{}};!function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ae});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function v(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(v("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(v("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),p=c(r[1],i),f=h(0),m=h(1),g=y(d,f),v=y(p,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),p=h(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var I=t().bind(null,!0),D={},P=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function k(e,t){var n=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){k(e[r],t[r])||(n=!1)}),n);if(P(e)&&P(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?I({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||L(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):R(o)&&R(a)?r=r.concat(D.generate(a,o,s)):P(o)&&P(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(k(t,i))return r;if(!M(t[0])&&M(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){M(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},D.apply=function(e,t){t.forEach(function(t){var n,r,i=A(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(P(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(P(a)&&P(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(a)&&R(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]}),I(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=A(e,t.from);P(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(P(i)?i.splice(+o,1):delete i[o])})},D.clone=function(e){return I({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):I(e,t)};const O=D,q=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var T="accumulation";function N(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===T)return n[r]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===T)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),p=w.getAboveComp(n,l,c,d),f=w.getRangeComp("RangeSum",p);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(f,h,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=N(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=N(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(T))return!1;var o=N(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function $(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const H={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,p=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(r,u),h=w.getAboveComp(r,u,p,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:r,properties:i,layout:a})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=W(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=W(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var B="timeSeriesDecomposition";function G(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function U(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?w.generateTSDExpression(n,t,r):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=w.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(U(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(U(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=G(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=G(t,e);return n&&!n.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=G(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,c),p="".concat(c," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(p,f,h);p=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return p},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,p=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),d=ue(i,o,a),p=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(p,"))")}(c,d,n.field,n.value,p,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",pe="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,pe)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:pe},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ve="qDef.qDef",ye="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Ce="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Ie="qDef.qAggrFunc",De="qDef.base.qAggrFunc",Pe={initBase:function(e,t){(t||Pe.isValid(e))&&(n(e,ye,o(e,ve)),n(e,xe,o(e,be)),n(e,Ce,o(e,Se)),n(e,Ee,o(e,we)))},restoreBase:function(e){Pe.isValid(e)&&(n(e,ve,o(e,ye)),n(e,be,o(e,xe)),n(e,Se,o(e,Ce)),n(e,we,o(e,Ee)),o(e,Ie)&&o(e,De)&&n(e,Ie,o(e,De)),delete e.qDef.base)},isValid:function(e){var t=o(e,ye),n=o(e,xe);return void 0!==t||void 0!==n}};const Re=Pe;function Me(e){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(e)}var Le={accumulation:F,movingAverage:H,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ae={modifiers:Le,apply:Oe,applyModifiers:qe,cleanUpMeasure:Te,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:Ne,getActiveModifier:_e,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ue({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var ke={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;ke[n.id]=ke[n.id]||{isFirstTime:!0};var u=ke[n.id].isFirstTime;if(ke[n.id].isFirstTime=!1,r&&"object"===Me(r))return qe({model:n,properties:r});var c=n?n.layout:void 0,d=o(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var p=o(c,"qHyperCube.qMeasureInfo"),f=ke[n.id].lastReloadTime;if(ke[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Ne({measures:p,layout:c})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ge({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:p,layout:c,model:n,lastReloadTime:f});return h||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ue({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:p,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);$e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ke({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(n++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&He(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),qe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Me(e.base)})}(p)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Te(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function qe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),$e(i);var p=Qe(i);return et({model:n,libraryIds:p,masterItem:u}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Ne({measures:n,properties:r}))return n.forEach(function(e){return Te(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ue({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(n)||Re.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Te(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Te(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Ne(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:ze(e),properties:n,layout:r})})}function _e(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function je(e){var t=_e(e);return!t||Le[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function $e(e){Fe(e).forEach(function(e){return function(e){var n=_e(e);n&&(void 0!==n.outputExpression&&We(n)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function He(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=He(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,n=e.properties,r=e.layout;return!Be(t)&&Ue({modifiers:ze(t),properties:n,layout:r})}function Ue(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):q(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ue({modifiers:r,properties:e})){var o=Be(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>$e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var p=n(8),f=n.n(p);const h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},v=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},y=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),w=n.n(S);function C(e,t){var n=w()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function E(e,t){return w()(!0,{},t,e)}function I(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var D=Math.pow(2,53)-1;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const M=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},A=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},k=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},q=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=C(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=C(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},T=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=E(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=E(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},N=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=I(a.max,i.dimensions.length,D),l=I(a.min,i.dimensions.length,0);return{maxDimensions:I(o.max,s,D),minDimensions:I(o.min,l,0),maxMeasures:s,minMeasures:l}},_=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=w()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return P(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return R(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function H(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const B={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,v({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),y({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,p=void 0===d||d,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:u}),v=o.getValue(r,u||"").qHyperCubeDef,y=o.getValue(g,u||"").qHyperCubeDef,b=N({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,C=b.minMeasures,E=l.defaultDimension,I=void 0===E?k():E,D=l.defaultMeasure,P=void 0===D?O():D;y.qDimensions.length=0,y.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C})&&z({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C,newHyperCubeDef:y}),q({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:y,defaultDimension:I}),T({exportFormat:t,maxMeasures:w,minMeasures:C,newHyperCubeDef:y,defaultMeasure:P}),W({newProperties:g,dataDefinition:a,hypercubePath:u}),$({newProperties:g,dataDefinition:a,hypercubePath:u}),_({exportFormat:t,newHyperCubeDef:y}),L("qMaxStackedCells",v,y),L("qNoOfLeftDims",v,y),A("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",v,y,"S"),A("qReductionMode",v,y,"N"),A("qSortbyYValue",v,y),A("qIndentMode",v,y),A("qShowTotalsAbove",v,y),M(g,t,r),m.qProperty=g;var R=o.getValue(c||{},"support.modifiers");return V({measures:y.qMeasures,modifierTypes:R}),p&&H(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&H(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function Y(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!G[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(U(a,t,r,i),Y(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),p=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:p});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:p})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},pe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},he=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ve={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=B.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=B.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,p=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ue(d,p),v=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:v,properties:d})&&he(d):me(d),v&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),pe(f),c}};var ye=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?H(n,"unsupportedAutoMinMax")||w()(n.measureAxis,t.measureAxis):H(n,"supportedAutoMinMax")||w()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ye.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&w()(s,n.properties.measureAxes[t[0].axis])):w()(s,n.properties.measureAxes[0])}},Se=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},we={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ve.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ve.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Ce(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Ce(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ie(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Ce(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var De="qHyperCubeDef.qMeasures",Pe="conditionalColoring",Re="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ee({properties:e,arrayPath:De,quarantineName:Pe,arrayName:Re,itemPath:Me})},unquarantine:function(e){Ie({properties:e,arrayPath:De,itemPath:Me,arrayName:Re,quarantineName:Pe})}};var Ae="qHyperCubeDef.qMeasures",ke="measures",Oe="qHyperCubeDef.qDimensions",qe="dimensions",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Ne="alternativeMeasures",_e="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const We={quarantine:function(e){Ee({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ee({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},unquarantine:function(e){Ie({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ie({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ee({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Ie({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ie({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})}},$e={hypercube:B,colorChart:ve,axisChart:we,quarantineProperty:x,unquarantineProperty:H,quarantineArrayProp:Ee,unquarantineArrayProp:Ie,conditionalColoring:Le,conditionalShow:We}})(),r.default})()}(Bj);var Gj=Er(Bj.exports);const Uj="qHyperCubeDef.qMeasures",Yj="measures",Kj="qHyperCubeDef.qDimensions",Xj="dimensions",Jj="qDef.representation",Zj="tableRepresentation",Qj="qDef.conditionalColoring",eF="conditionalColoring",tF="qMiniChartDef",nF="miniChartDef",rF=e=>{Gj.unquarantineArrayProp({properties:e,arrayPath:Kj,itemPath:Jj,arrayName:Xj,quarantineName:Zj}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Jj,arrayName:Yj,quarantineName:Zj}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Qj,arrayName:Yj,quarantineName:eF}),Gj.unquarantineArrayProp({properties:e,arrayPath:Uj,itemPath:tF,arrayName:Yj,quarantineName:nF})},iF=e=>{Gj.quarantineArrayProp({properties:e,arrayPath:Kj,itemPath:Jj,arrayName:Xj,quarantineName:Zj}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Jj,arrayName:Yj,quarantineName:Zj}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:Qj,arrayName:Yj,quarantineName:eF}),Gj.quarantineArrayProp({properties:e,arrayPath:Uj,itemPath:tF,arrayName:Yj,quarantineName:nF})};function oF(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(i)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}const aF="qHyperCubeDef.qDimensions",sF="dimensions",lF="qOtherTotalSpec.qTotalMode",uF="totalMode",cF={quarantine(e){Gj.quarantineArrayProp({properties:e,arrayPath:aF,quarantineName:uF,arrayName:sF,itemPath:lF})},unquarantine(e){Gj.unquarantineArrayProp({properties:e,arrayPath:aF,quarantineName:uF,arrayName:sF,itemPath:lF})}};function dF(e){const t=oF(e);return(e,n,r,i)=>{const o=Gj.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),a=o.qProperty.qHyperCubeDef.qDimensions.length,s=o.qProperty.qHyperCubeDef.qMeasures.length;let l,u=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,c=!0;a+s===u.length&&N_(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",u.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(u=d,l=[...d],N_(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",u),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):u.length=0;const p=+(u.indexOf(-1)>-1),f=a+p;if(f>u.length)for(let e=u.length;e<f;e++)u.indexOf(e)<0&&u.push(e-p);for(let e=u.length-1;e>=0;e--)u[e]>=a&&u.splice(e,1);s>1&&u.indexOf(-1)<0?u.push(-1):s<2&&u.indexOf(-1)>-1&&u.splice(u.indexOf(-1),1);const h=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===h&&N_(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===u.length){for(let e=0;e<l.length;e++)if(l[e]!==u[e]){c=!1;break}c&&(Gj.unquarantineProperty(o.qProperty,"noOfLeftDims"),Gj.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return Gj.unquarantineProperty(o.qProperty,"rankedList"),Gj.conditionalShow.unquarantine(o.qProperty),cF.unquarantine(o.qProperty),rF(o.qProperty),Gj.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function pF(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=Gj.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=o.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let u=a.qInterColumnSortOrder;N_(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),Gj.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims,Gj.quarantineProperty(o.properties,"qHyperCubeDef.rankedList","rankedList"),delete o.properties.qHyperCubeDef.rankedList;const c=o.properties.qLayoutExclude.quarantine?.interColSortOrder;c&&(u=c,N_(o,"properties.qHyperCubeDef.qInterColumnSortOrder",u),N_(o,"data.0.interColumnSortOrder",u),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=u.length;e<s+l;e++)u.length<=e&&u.push(e);return Gj.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),Gj.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),Gj.conditionalShow.quarantine(o.properties),cF.quarantine(o.properties),iF(o.properties),o}const fF=e=>({dimensions:{min:1,max:1e3,description(t,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(i)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),hF={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let mF=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e}({}),gF=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const vF=e=>{switch(e?.type){case"url":return mF.Link;case"image":return mF.Image;case"indicator":return mF.Indicator;case"miniChart":return mF.MiniChart;default:return mF.Text}},yF=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),bF=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>vF(e.qDef.representation)===mF.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:a}=n.properties.qHyperCubeDef;let s=!1;r?.indexOf(-1);const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},xF=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:yF({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>vF(e.qDef.representation)===mF.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>vF(e.qDef.representation)===mF.Link&&e.qDef.representation?.urlPosition===gF.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>vF(e.qDef.representation)===mF.Link&&e.qDef.representation?.urlPosition===gF.Attribute},...bF(n)}},SF=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[mF.Image],o=!r?.("qMiniChartDef")&&t[mF.MiniChart],a=!r?.("tableIndicators")&&t[mF.Indicator],s=i&&t[mF.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&s)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>vF(e.qDef.representation)===mF.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:a?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let wF=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),CF=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),EF=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),IF=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const DF="image",PF=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},RF=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:xT.Auto,translation:"Common.Auto"},{value:xT.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:xT.Pixels,translation:"Object.Table.Column.Pixels"},{value:xT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:xT.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PixelsDefault,show:e=>e.qDef.columnWidth?.type===xT.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PercentageDefault,show:e=>e.qDef.columnWidth?.type===xT.Percentage}}),MF=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==DF},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==DF)}}},LF="TOTAL_OFF",AF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:CF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:CF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},kF="TOTAL_OFF",OF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:CF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:CF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:CF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},qF=e=>{const{translator:t,anything:n,flags:r}=e,i=(e=>{const{translator:t,anything:n}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:LF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:LF,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&PF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==LF&&PF(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:AF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...xF(e),...RF()}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:AF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...SF(e,{[mF.Image]:!0,[mF.Indicator]:!0}),...RF()}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e);return r.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?i:{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Property.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:kF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:kF,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&PF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==kF&&PF(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:OF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...xF(e),...RF()}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:OF,...MF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...MF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...SF(e,{[mF.Image]:!0,[mF.ImagesInIndentMode]:!0,[mF.Indicator]:!0}),...RF()}},filters:{type:"items",translation:"SimpleProperties.Filters.Filters",ref:"filters",allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:"properties.filters.add",grouped:!0,items:{filter:{type:"object",component:"filter-item",ref:"filter"}}}}}},TF=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,a=i.theme.current(),s=n(a,o);return{color:"transparent"===s?"none":s}}}),NF=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},_F=({ref:e,themeAccessor:t,translator:n,flags:r})=>({component:"dropdown",ref:e,options:(e,i,o)=>{const a=o.theme.current();return((e,t,n,r)=>{const i=t.fontFamily??"Source Sans Pro, sans-serif",o=t.fontFamilies??[],a=Array.from(new Set([e,i,...o])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...a.sort().map(e=>NF(e,!0))],l=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...TN(r).filter(e=>!a.includes(e)).map(e=>NF(e,!0))];return[...s,...l.length>1?l:[]]})(t(a),a,n,r)},defaultValue:(e,n,r)=>t(r.theme.current())}),jF=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],FF=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),a=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>NF(e,!1))],s=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...jF.filter(e=>!o.includes(e)).map(e=>NF(e,!1))];return[...a,...s.length>1?s:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),zF=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:a})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:_F({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n,flags:r}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:FF({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:TF(`${e}.fontColor`,void 0,t=>i(t,e,"color")??t.color)}},background:TF(`${e}.background`,"properties.background",(t,n)=>{const r=n?oN.WHITE:oN.TRANSPARENT;return i(t,e,"backgroundColor")??r},a)}}}}),WF=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r})=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:TF(`${e}.fontColor`,void 0,t=>r(t,e,"color")??t.color)}},background:TF(`${e}.background`,"properties.background",t=>r(t,e,"backgroundColor")??n??"transparent")}}}}),$F=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map(e=>({value:e+1,translation:e+1})),defaultValue:1}),VF="12px",HF="Source Sans Pro, sans-serif",BF="600",GF=15e3,UF=4/3;let YF=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),KF=function(e){return e.Solid="solid",e.None="none",e}({});const XF={display:"flex",justifyContent:"center",alignItems:"center"},JF={borderStyle:"solid"},ZF={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},QF={lineHeight:UF,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},ez=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),tz=(e,t)=>e>0?`${e}px ${KF.Solid} ${t}`:KF.None,nz=(e,t,n,r,i)=>{const o=Number(!t||i?.right),a=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?tz(o,n):KF.None,borderBottom:tz(a,n),borderLeft:"rtl"===r?tz(o,n):KF.None,borderTop:KF.None}},rz=(e,t,n,r,i,o,a)=>{const s=nz(t,r,i,o,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=tz(2,i)),n||(s.borderLeft="rtl"!==o?tz(1,i):"none",s.borderRight="rtl"===o?tz(1,i):"none")),s},iz=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=tz(1,n)),t&&(r.borderRight=tz(1,n)),r},oz=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},az=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:zF({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:oz}),dimensionValueSection:zF({section:"dimensionValues",translator:e,flags:t,getThemeValue:oz}),measureValueSection:zF({section:"measureValues",translator:e,flags:t,getThemeValue:oz}),measureLabelSection:WF({section:"measureLabels",getThemeValue:oz}),totalValuesSection:WF({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:oz}),nullValuesSection:WF({section:"nullValues",fallbackBackground:YF.NullValueBackground,getThemeValue:oz}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:$F("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:$F("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:TF("grid.border","properties.border",e=>e.object?.pivotTableV2?.grid?.borderColor??YF.DividerLight),divider:TF("grid.divider","properties.pivot.divider",e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??YF.DividerDark),background:TF("grid.background","properties.background",e=>e.object?.pivotTableV2?.grid?.backgroundColor??YF.Transparent)}}}}}}]}),sz=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},lz=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[az(e,t),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:xT.Auto,translation:"Common.Auto"},{value:xT.Pixels,translation:"Object.Table.Column.Pixels"},{value:xT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:xT.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===xT.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:bT.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===xT.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some(e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode)}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}]},...sz(t)}}),uz="auto",cz={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:uz,translation:"Object.Table.SortingInSearch",options:[{value:uz,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function dz(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:qF(e),sorting:cz,addons:hF,settings:lz(t,n)}}}function pz(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:dz(e),importProperties:dF(e),exportProperties:pF,exploration:Ij(e),data:fF(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new Hj(t,e.translator):void 0}}const fz=()=>{let e;return{promise:new Promise(t=>{e=t}),resolve:e}};function hz(e,t){return R(()=>e,t)}const mz={},gz=e=>{const t=R(()=>({current:mz}),[]);return t.current=t.current===mz?e:t.current,t},vz=e=>!!e&&0===bN(e).a,yz="#grid",bz=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},xz=(e,t,n,r,i)=>{const o=bz(".qv-object .qv-inner-object",n),a=bz(".qv-panel-sheet",n),s=bz(yz,n)??a,l=(e=>{const t=e.components?.find(e=>"general"===e.key),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return K_(n);if("none"===r)return"transparent";if(void 0===r)return;const o=bN(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),u=r?.(t),c=i?.(t),d=l||u||o||c,p=vz(d),f=!vz(h=p?s:d)&&G_(h,oN.TEXT,oN.DARK_MODE_TEXT)===fN(oN.DARK_MODE_TEXT);var h;const m=((e,t,n,r=oN.WHITE)=>e&&!vz(e)?e:vz(t)?n&&!vz(n)?n:r:t)(l,d,s);return{color:d,headerColor:m,isDark:f}},Sz=(e,t,n,r)=>{const i=O(),o=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[n,r]=A([]);return k(()=>{let n;return e&&(n=new MutationObserver(e=>{r(e)}),n.observe(e,t)),()=>{n?.disconnect()}},[e,t]),n})(t.closest(yz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter(({oldValue:e})=>e?.includes("background")).map(({oldValue:e})=>e).join(",");return R(()=>({...i,background:xz(e,i,t,n,r)}),[i.name(),t,n,r,e,o])};function wz(e,t){const n=R(()=>({isLoading:!0}),t),[r,i]=L(async()=>{try{return await e()}finally{n.isLoading=!1}},t);return[r,n.isLoading,i]}const Cz=3,Ez=/\n/g;function Iz(e,t,n){let r=0,i=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),a=e.slice(0,o),s=e.slice(0,o-1),l=n(a),u=n(s);if(l>t&&u<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function Dz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=Cz,allowLineBreaks:a=!0}=i??{},{estimateWidth:s,measureText:l,estimateLineCount:u}=v(()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i)=>{const{maxNbrLinesOfText:o=Cz,allowLineBreaks:a=!0}=i??{};return()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const s=i.measureText.bind(i),l=__(e=>{if(void 0===e)return 0;if(a){const t=e.split(Ez).map(e=>s(e).width);return t.reduce((e,t)=>t>e?t:e,0)}const t=e.replace(Ez," ");return s(t).width}),u=e=>+l(e).toFixed(2),c=__(({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;const r=a?e.split(Ez):[e];let i=0;for(const e of r){let n=e;do{i+=1,n=Iz(n,t,u)}while(null!==n&&i<o);if(i>=o)break}return i},({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`);return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:c}}})({fontStyle:n,fontWeight:r,fontSize:e,fontFamily:t},{maxNbrLinesOfText:o,allowLineBreaks:a})(),[n,r,e,t,o,a]);return{estimateWidth:s,measureText:l,estimateLineCount:u}}var Pz,Rz=E;Pz=Rz.createRoot,Rz.hydrateRoot;const Mz="Source Sans Pro, sans-serif";function Lz(e,t){const[n,r]=m(t);n.some((e,n)=>e!==t[n])&&(r(t),e())}var Az={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const kz=({translator:e})=>(v(()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(Az).forEach(t=>{e.add(Az[t])})}}(e)},[e]),e),Oz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},qz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},Tz=fl("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...Oz},"&::-moz-range-track":{...Oz},"&::-ms-track":{...Oz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...qz},"&::-moz-range-thumb":{...qz},"&::-ms-thumb":{...qz},"&:hover:not(:focus, :active)":{"&::after":{backgroundColor:t||"#D9D9D9","@media (hover: none)":{backgroundColor:"none"}}},"&:focus-visible, &:active":{"&::after":{backgroundColor:"#177fe6",borderLeft:"1px solid #fff",borderRight:e?void 0:"1px solid #fff"}},"&::after":{content:'""',height:"100%",width:"3px",position:"absolute"}})),Nz=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:u,isLeftColumn:c,accessibilityRelatedArgs:d,direction:p="ltr"})=>{const f=kz({translator:d.translator}),h=l({initWidth:e,columnWidth:e,initX:0}),m=n?0:1,g=r&&!c,v=()=>g?h.current.columnWidth-m:"100%",y={left:"rtl"!==p?v():void 0,right:"rtl"===p?v():void 0},b=t=>{h.current={initWidth:e,columnWidth:e,initX:t??h.current.initX}};Lz(()=>{g&&b()},[e]);const x=e=>{const t=Math.max(e,bT.PixelsMin);h.current.columnWidth=t,o(t)},S=()=>{if(h.current.columnWidth!==h.current.initWidth){const e={type:xT.Pixels,pixels:h.current.columnWidth};a(e)}u?.(!1)},w=e=>{const t="rtl"===p?h.current.initWidth+h.current.initX-e.clientX:h.current.initWidth+e.clientX-h.current.initX;x(t)},C=e=>{X_(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S()},E=e=>{const t="rtl"===p?h.current.initWidth+-h.current.initX-e.touches[0].clientX:h.current.initWidth+e.touches[0].clientX-h.current.initX;x(t)},I=e=>{X_(e),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",I),S()},D=!r&&s?e=>{if(e.key===vT.Left||e.key===vT.Right){X_(e);const t=5,n=e.key===vT.Left?t:-t,r="rtl"===p?n:-n;u?.(!0),x(h.current.columnWidth+r)}else e.key===vT.Space||e.key===vT.Enter?(X_(e),s(e),u?.(!1),S()):e.key===vT.Esc&&(X_(e),s(e),u?.(!1),x(h.current.initWidth))}:void 0,P=f.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return io.jsx(Tz,{style:y,hoverColor:i,isLastColumn:n,className:yT,"data-testid":yT,onMouseDown:e=>{X_(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:xT.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(X_(e),document.addEventListener("touchmove",E),document.addEventListener("touchend",I),u?.(!0),b(e.touches[0].clientX))},onKeyDown:D,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":P,"aria-valuemin":bT.PixelsMin,"aria-valuemax":bT.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:p},t)},_z=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})})),jz=fl(Qu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"})),Fz=fl(_z,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),zz=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),Wz=fl(Uc)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),$z=fl(bp)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),Vz=fl(bp,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"})),Hz=fl("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),Bz=fl("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),Gz=fl(mu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),Uz=fl(Wd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),Yz=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})})),Kz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?Kz(t):t:e.parentElement?.children?.[0]},Xz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?Xz(t):t},Jz=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===vT.Down||t===vT.Up){const n=e=>t===vT.Down?Kz(e):Xz(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},Zz=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(n)}}:{}}))})));let Qz={};const eW=({autoFocus:e,id:t,onClick:r,itemTitle:i,icon:o,enabled:a,subMenus:s,isSubMenu:l,isActive:u,direction:c,isPagination:d})=>{const[p,h]=m(!1),g=n.useRef(null),v=f(e=>{e.stopPropagation(),h(!1)},[h]);return io.jsxs(io.Fragment,{children:[io.jsxs(Vz,{ref:s?g:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(r&&(await r(e),Qz={}),s?.length&&(h(!0),Qz[i]=h,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!u,onKeyDown:Jz,children:[u?io.jsx(Hz,{direction:c,isPagination:d}):null,io.jsxs(Bz,{children:[io.jsx(Uz,{direction:c,isPagination:d,children:io.jsx(o,{})}),io.jsx(Gz,{variant:"body2",children:i})]}),s?.length?io.jsx(Yz,{}):null]},t),s?.length?io.jsx(iW,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:v,menuGroups:Zz(s,Qz),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:d}):null]})},tW=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(e=>[[e.groupHeading&&io.jsx($z,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>io.jsx(eW,{...e,isSubMenu:t,direction:n,isPagination:r},e.id))].filter(Boolean)]),nW=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((i,o)=>[tW({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?io.jsx(Wz,{"data-testid":"group-divider",variant:"middle"}):void 0]),rW={appear:0,enter:0,exit:0},iW=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?io.jsx(zz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:rW,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:nW({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,oW=(e,t)=>e.some(e=>t[e]>0),aW={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},sW=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=m(null),[a,s]=m(aW);return Lz(()=>{e||(s(aW),o(null))},[e]),d(()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),u=await r.createSessionObject(e),c=await u.getLayout(),{qStateCounts:d}=c.qListObject?.qDimensionInfo??{};i=c.qInfo?.qId,a?l():(o(u),d&&s((e=>({canSelectAll:oW(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:oW(["qSelected"],e),canSelectPossible:oW(["qOption"],e),canSelectAlternative:oW(["qAlternative"],e),canSelectExcluded:oW(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},lW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3.5 1.793 6.207 4.5l-.707.707-1.5-1.5V14H3V3.707l-1.5 1.5L.793 4.5zM8 4h5v1H8zm0 3h6v1H8zm0 3h7v1H8z"})})),uW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm9 1.5H6v-1h4zm5.354-8.646L12.707 10l2.646 2.646-.707.707L12 10.708l-2.646 2.646-.708-.707L11.293 10 8.646 7.354l.708-.708L12 9.293l2.646-2.647zM1 10H0V6h1zm2-9H1.5a.5.5 0 0 0-.5.5V3H0V1.5A1.5 1.5 0 0 1 1.5 0H3zm11.5-1A1.5 1.5 0 0 1 16 1.5V3h-1V1.5a.5.5 0 0 0-.5-.5H13V0zM10 1H6V0h4z"})})),cW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3.914 8h8.207L10.5 6.379l.707-.708L14.036 8.5l-2.829 2.828-.707-.707L12.12 9H3.914l1.621 1.621-.707.707L2 8.5l2.828-2.828.707.707zM15 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 13V2h-2v3h-1V2H4v3H3V2H1v12h2v-2h1v2h8v-2h1v2z"})})),dW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 2h1v10.293l1.5-1.5.707.707L3.5 14.207.793 11.5l.707-.707 1.5 1.5zm12 2H8v1h7zM8 7h6v1H8zm5 3H8v1h5z"})})),pW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8z"})})),fW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8zM8.5 4v8h-1V4z"})})),hW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7"})})),mW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9.057 11.164a6 6 0 1 1 2.112-2.116 1 1 0 0 1 .052.044l4.176 4.08a1 1 0 0 1 .009 1.422l-.707.707a1 1 0 0 1-1.406.008l-4.185-4.087a1 1 0 0 1-.05-.058ZM10.5 6a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0"})})),gW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 4v1H1v10h10v-2h1v2a1 1 0 0 1-.883.993L11 16H1a1 1 0 0 1-.993-.883L0 15V5a1 1 0 0 1 .883-.993L1 4zm12-4a1 1 0 0 1 .993.883L16 1v10a1 1 0 0 1-.883.993L15 12H5a1 1 0 0 1-.993-.883L4 11V1a1 1 0 0 1 .883-.993L5 0zm0 1H5v10h10zm-2.36 2.653.72.694L9.143 8.72 6.64 6.125l.72-.694L9.143 7.28z"})})),vW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8l8-8zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),yW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 3h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),bW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8h8V4zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})})),xW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})}));let SW=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const wW="/qListObjectDef",CW=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:u,focusColumnAdjuster:c,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(n[SW.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:lW,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:dW,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:hW,subMenus:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:uj,isActive:e.groupDimensionPos===n}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&o?.select){const i=[];n[SW.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:mW,enabled:!0}]}]),!e.isLocked&&n[SW.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:xW,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(wW))},icon:gW,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(wW))},icon:bW,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(wW))},icon:vW,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(wW))},icon:yW,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(wW))},icon:uW,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.expandCallback()},icon:fW,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.collapseCallback()},icon:pW,enabled:!0}]}]),i.length>0&&f.push(...i)}return n[SW.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),c?.(u)},icon:cW,enabled:!0}]}]),f},EW=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:u,searchRelatedArgs:c,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:h,model:m,direction:g="ltr",isPagination:v,isAccessibleHeader:y,iconSize:b=hT})=>{const x=l(null),S=kz({translator:i}),{qLibraryId:w,fieldId:C,headTextAlign:E}=r,I=d?.app,{fieldInstance:D,selectionActionsEnabledStatus:P}=sW({open:e,headerData:r,app:I,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:r}),M=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>f(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}},[e,t,n,r?.qStateName,i,o]))({qLibraryId:w,fieldId:C,searchRelatedArgs:c,selectionRelatedArgs:d,direction:g}),L=f(e=>{e.stopPropagation(),t(!1)},[t]),A=f(e=>{e.stopPropagation(),t(e=>!e)},[t]);return o.active?io.jsxs(jz,{rightAligned:"right"===E,shouldShowMenuIcon:s,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===y?A:void 0,ref:x,isAccessibleHeader:y,children:[s?io.jsx(Fz,{height:b,className:mT,"data-testid":mT,isInteractionsActive:o.active??!1,children:io.jsx(_z,{})}):null,io.jsx(iW,{open:e,anchorEl:!1===y?x.current:n.current,onClose:L,menuGroups:CW({headerData:r,translator:S,menuAvailabilityFlags:a,setOpen:t,...u,embedListbox:M,interactions:o,fieldInstance:D,selectionActionsEnabledStatus:P,anchorRef:n,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:h}),direction:g,isPagination:v})]}):null},IW=e=>e.isDark?{background:e.color,borderColor:oN.DARK_MODE_BORDER,color:oN.DARK_MODE_TEXT,disabledColor:oN.DARK_MODE_DISABLED,iconColor:oN.DARK_MODE_TEXT}:{background:e.color,borderColor:oN.BORDER_MEDIUM,color:oN.TEXT,disabledColor:oN.DISABLED},DW=fl(Qu,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",padding:t.spacing(0,1,0,1),color:e.color,background:e.background,borderTop:`1px solid ${e.borderColor}`})),PW=fl(Qp,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),RW=fl(uc,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)})),MW=fl(mu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),LW=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=v(()=>IW(r.background),[r]);if(!n.active)return null;const a=i?io.jsx(DW,{footerStyle:o,children:e}):null;return t?E.createPortal(e,t):a},AW=u({}),kW=()=>h(AW),OW=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(c)?0:-1,b=v(()=>IW(p.background),[p]),x=i?i.getBoundingClientRect().width:h.width,S=kz({translator:d}),w=v(()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:S,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:x,visibilityThreshold:g}),[t,n,r,i,o,a,s,l,u,c,S,p,f,h,m,b,y,x,g]);return io.jsx(AW.Provider,{value:w,children:e})};let qW=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),TW=function(e){return e[e.DisplayedRowsLabel=250]="DisplayedRowsLabel",e[e.FirstPage=350]="FirstPage",e[e.LastPage=350]="LastPage",e[e.RowsPerPage=550]="RowsPerPage",e[e.SelectPage=700]="SelectPage",e}({});const NW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})),_W=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})})),jW=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})})),FW={FirstPage:_W,PreviousPage:NW,NextPage:Yz,LastPage:jW,FirstPageRTL:jW,PreviousPageRTL:Yz,NextPageRTL:NW,LastPageRTL:_W},zW=({disabledCondition:e,pageNumber:t,type:n})=>{const{direction:r,footerStyle:i,handleChangePage:o,translator:a,interactions:s,tabIndex:l}=kW(),u=n.concat("rtl"===r?"RTL":""),c=FW[u];return{styledProps:{footerStyle:i,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:l,onClick:e?void 0:()=>{o(t)}},IconComponent:c}},WW=()=>{const{pageInfo:e,width:t,interactions:n,visibilityThreshold:r}=kW(),i=0===e.page,{IconComponent:o,styledProps:a}=zW({type:qW.FirstPage,disabledCondition:i,pageNumber:0});return t<=(r?.firstPage||TW.FirstPage)?null:io.jsx(RW,{...a,disabled:!n.active,children:io.jsx(o,{height:hT})})},$W=(e,t,n=!1)=>{n&&e.key===vT.Tab&&!e.shiftKey&&(X_(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},VW=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o,visibilityThreshold:a}=kW(),s=e.page>=n-1,{IconComponent:l,styledProps:u}=zW({type:qW.LastPage,disabledCondition:s,pageNumber:n-1}),c=t.enabled?e=>{$W(e,t,r)}:void 0;return i<=(a?.lastPage||TW.LastPage)?null:io.jsx(RW,{...u,onKeyDown:c,disabled:!o.active,children:io.jsx(l,{height:hT})})},HW=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o}=kW(),a=e.page>=n-1,{IconComponent:s,styledProps:l}=zW({type:qW.NextPage,disabledCondition:a,pageNumber:e.page+1}),u=!(i>TW.FirstPage&&i>TW.LastPage)&&t.enabled?e=>{$W(e,t,r)}:void 0;return io.jsx(RW,{...l,onKeyDown:u,disabled:!o.active,children:io.jsx(s,{height:hT})})},BW=()=>{const{pageInfo:e,interactions:t}=kW(),n=0===e.page,{IconComponent:r,styledProps:i}=zW({type:qW.PreviousPage,disabledCondition:n,pageNumber:e.page-1});return io.jsx(RW,{...i,disabled:!t.active,children:io.jsx(r,{height:hT})})},GW=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=kW(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||TW.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return io.jsx(MW,{variant:"caption",dir:"ltr",children:s})},UW=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=kW(),u=i.qInfo.qId,c=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${u}`,f={tabIndex:s,id:`${d}-${u}`,"data-testid":d,"aria-labelledby":p};return io.jsxs(io.Fragment,{children:[io.jsxs(MW,{variant:"caption",id:p,children:[c,":"]}),io.jsx(PW,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:f,disabled:!l.active,children:n})]})},YW=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=kW();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||TW.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=io.jsx(io.Fragment,{children:e.rowsPerPageOptions.map(e=>io.jsx("option",{value:e,children:e},e))});return io.jsx(UW,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},KW=1e3,XW="…",JW=({totalPages:e,page:t})=>{const n=Math.min(e,KW),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-KW):0,a=Array.from(Array(n).keys()).map(e=>{const t=e+o;return io.jsx("option",{value:t,children:t+1},t)});return o>0&&a.unshift(io.jsx("option",{value:XW,disabled:!0,children:XW},"startMoreOptions")),i<e-1&&a.push(io.jsx("option",{value:XW,disabled:!0,children:XW},"endMoreOptions")),io.jsx(io.Fragment,{children:a})},ZW=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=kW(),{page:o}=e;if(t<=(i?.selectPage||TW.SelectPage))return null;const a=io.jsx(JW,{totalPages:n,page:o});return io.jsx(UW,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})};var QW=b(e=>io.jsxs(OW,{...e,children:[io.jsx(YW,{}),io.jsx(ZW,{}),io.jsx(GW,{}),io.jsx(WW,{}),io.jsx(BW,{}),io.jsx(HW,{}),io.jsx(VW,{})]}));const e$=e=>io.jsx(LW,{...e,children:io.jsx(QW,{...e})}),t$=u({}),n$=()=>h(t$),r$=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const a=v(()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i}),[e,t,n,r,i]);return io.jsx(t$.Provider,{value:a,children:o})},i$=u({}),o$=()=>h(i$),a$=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:a,env:s,children:l})=>{const u=v(()=>({model:t,app:e,interactions:a,embed:r,theme:n,keyboard:i,env:s,translator:o}),[e,a,t,r,n,i,s,o]);return io.jsx(i$.Provider,{value:u,children:l})},s$=u({}),l$=()=>h(s$),u$=({children:e,...t})=>io.jsx(s$.Provider,{value:t,children:e}),c$=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=o$(),{layoutService:n}=l$(),r=e.getStyle("","","fontFamily")??HF;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:io.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:io.jsx("span",{style:{...QF,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},d$="/qHyperCubeDef",p$=-1,f$="PSEUDO-DIM",h$=e=>e===p$?f$:(({cId:e})=>e??_j())(e),m$=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===p$?n.columnWidthLocation=wF.Measures:n.isLeftDimension?n.columnWidthLocation=wF.Dimension:t.at(-1)===p$?n.columnWidthLocation=wF.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=wF.Pivot))},g$=(e,t,n,r)=>{const i=h$(n),o=e.getDimensionInfoIndex(n),a=e.isLeftDimension(o);return n===p$?{id:i,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:wF.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:i,colIdx:0,label:n.qFallbackTitle??"",qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===CT.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:wF.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName}},v$=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})=>{let i=r;var o;n.length>0&&(i=(o=r).at(-1)===p$?o.slice(0,-1):o);const a=i.length+(n.length?1:0),s=Math.max(1,n.length),l=((e,t)=>Array(e).fill(null).map(()=>Array.from({length:t},()=>null)))(a,s);return n.forEach((n,r,i)=>{const o=r===i.length-1;l[a-1][r]=g$(e,t,n,o)}),i.forEach((n,r,i)=>{const o=r===i.length-1;l[r][s-1]=g$(e,t,n,o)}),l},y$=(e,t,n,r)=>{const i=((e,t,n,r)=>{let i;return i=0===n.length||n.includes(p$)?v$({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n}):(e=>e[0].map((t,n)=>e.map(e=>e[n])))(v$({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})),e.isIndentModeEnabled&&i[i.length-1].length>1&&(i[i.length-1]=[i.at(-1),...new Array(i[0]?i[0].length-1:0).fill(null)]),i.length&&i.at(-1)?.forEach((t,n)=>{Array.isArray(t)?t.forEach((t,n)=>{m$({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}):m$({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}),i})(e,t,n,r);return{data:i,size:{x:i[0]?.length??0,y:i.length}}};var b$={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:S$(e),value:S$(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}},x$=b$;function S$(e){try{return decodeURIComponent(e)}catch{return e}}function w$(e){if(!(this instanceof w$))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>x$.fromSearchString(t.search)}})}function C$(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/shouldNotDecodePlus/gi,"%2B")}w$.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},w$.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=C$(t.key),t.value?n+=`=${C$(t.value)}`:n+=t.useEqualSign?"=":"";return n};var E$=w$;var I$,D$=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},P$=class{decode(e){let t="";const n=new D$(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},R$=e=>e>=0&&e<=1114111,M$=e=>e.match(/[\s]/),L$=class extends P${decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!M$(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return R$(a)?String.fromCharCode(a):"�"}},A$=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,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},k$=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;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,r)}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 A$.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return A$.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||A$.newInstanceIfNeeded(e,t,this._value)}},O$=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 k$);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},q$=(()=>{const e=[],t=[],n=new O$;let r,i,o;for(r 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[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})(),T$=class extends P${decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,q$.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=q$.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&R$(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&R$(r)?String.fromCharCode(r):null}},N$=class extends P${decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),R$(o))?String.fromCharCode(o):(e.reset(),null)}},_$=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,j$=5e6,F$=5e5,z$=(e,t)=>{const{maxByteSizeSvg:n=F$,maxByteSizeImage:r=j$}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=_$.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r};"undefined"!=typeof document&&(I$=document.createElement("div"));var W$=Array.prototype.indexOf,$$=[",",".","_"," "],V$=[",",".","-","_"," "],H$={width:["%"],height:["%"]},B$={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},G$={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":B$.image,"background-color":B$.color,"border-color":B$.color,"border-image":B$.image,color:B$.color,icon:B$.image,"list-style-image":B$.image,"outline-color":B$.color},U$={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function Y$(e,t,n){let r;if(t){if(W$)return W$.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function K$(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return I$.appendChild(n),t=I$.innerHTML,I$.removeChild(n),t}function X$(e,t,n){let r,i,o,a,s,l,u,c,d;for(e=Z$(e).toLowerCase(),t=Z$(t),o=0;o<U$.attr_name.length;o++)if(e.match(U$.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<U$.attr_val.length;o++)if(t.toLowerCase().match(U$.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=H$[e],r||(r=V$),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&Y$(u,r)<0?(d=c.toString(16),i+=`&#x${d};`):i+=u;return n||(i+='"'),i}function J$(e,t,n){let r,i,o,a,s,l,u,c,d,p;if(e=Z$(e).toLowerCase(),t=Z$(t),Y$(e,U$.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<U$.css_val.length;r++)if(t.toLowerCase().indexOf(U$.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=G$[e],i||(i=B$.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&Y$(u,i)<0?(d=c.toString(16),p="000000".substr(d.length),o+=`\\${p}${d}`):o+=u;return o}function Z$(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new T$,new N$,new L$];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}var Q$=[];for(let e=0;e<255;e++)Q$[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var eV={html:e=>K$(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=J$(t,n[t],!0),o+=J$(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=X$(e,t[e],!0),i+=X$(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function tV(e,t){throw new Error(t)}var nV={canonicalize:Z$,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?eV.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&tV(this,"Invalid parameter type"),eV.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&tV(this,"Invalid parameter type"),eV.attr(e)):void tV(this,"Invalid parameter type")},encodeForAttr:X$,encodeForAttr2:function(e){return X$("nonsens",e,!0)},encodeForCSS:J$,encodeForHref:function(e){Z$(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new E$(e),n=E$.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+E$.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=$$),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),Y$(i,t)>=0||null==Q$[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:K$,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=Z$(t).toLowerCase():tV(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:z$,validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const rV=(e,t)=>t.qAttrExps?.qValues?.[e],iV=(e,t)=>{switch(e){case"topLeft":default:return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-start"};case"centerLeft":return{horizontal:"center",vertical:"flex-start"};case"bottomLeft":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-start"};case"topCenter":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"center"};case"centerCenter":return{horizontal:"center",vertical:"center"};case"bottomCenter":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"center"};case"topRight":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-end"};case"centerRight":return{horizontal:"center",vertical:"flex-end"};case"bottomRight":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-end"}}},oV=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>!r||t&&(t.toLowerCase().includes("javascript:")||!nV.isSafeDataURL(t))?{type:mF.Text,url:void 0,text:e,labelStructure:i}:{type:mF.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:iV(r,a),labelStructure:i,imageBox:o},aV=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:mF.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:mF.MiniChart,text:r,miniChart:a}},sV=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===gF.Attribute?void 0:n?.urlLabel},lV=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:mF.Link,url:nV.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:mF.Text,url:void 0,text:t,labelStructure:e}}},uV=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:u})=>{const c=vF(t),d=s(e);return c===mF.Image&&u[mF.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:u,imageBox:c}=t??{};if("url"===l){const t=rV(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),oV({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return oV({text:u||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i});const l=rV(n.imageLabel??-1,e)?.qText??r;return oV({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:c,direction:i})}return{type:mF.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,a):c===mF.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===gF.Attribute){const o=sV(n.url??-1,e,t);return lV({labelStructure:r,text:i||o||"",url:o})}if(o===gF.Dimension){const o=sV(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),lV({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:mF.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,a,d):c===mF.Indicator&&u[mF.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:mF.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):c===mF.MiniChart&&u[mF.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?aV(e,t,o,d):{type:mF.Text,url:void 0,text:d,labelStructure:a}},cV=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?K_(i):null,a=r?K_(r):null,s=((e,t)=>e||!t?null:G_(t))(a,o);return{color:s??a,background:o}},dV=(e,t)=>t.qSubNodes.reduce((e,t)=>0===t.qSubNodes.length?e+1:dV(e,t),e),pV=(e,t,n,r,i,o)=>{const a=i?o.rowsPerPage-n:GF-r;let s=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;s=e.qDown+n}return Math.min(a,dV(s,e))},fV=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:u=!0,isIndentModeEnabled:c=!1,indentLevel:d,labelStructure:p,env:f,pageInfo:h,direction:m="ltr"})=>{const g=(!c||!u)&&"P"===e.qType,v=((e,t)=>{if(e!==p$){if(t){const t=vF(e.representation);return t===mF.Link||t===mF.Image?e.representation:{type:mF.Text}}return e.representation}})(s,c),y=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let a=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:s}=r;a=i===mF.Link?"P"===e.qType?o:t:`${t} ${!s||!t&&s?"":n} ${s}`.trim()}return a})({node:e,isLeftColumn:u,isIndentModeEnabled:c,labelStructure:p,representationType:vF(v),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),b=uV({cell:{...e,qText:y},representationProperties:v,attrExprInfoIndex:l,env:f,labelStructure:p,direction:m,enabledFeatures:{[mF.Image]:!0,[mF.Indicator]:!0}}),x={id:_j(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:u?o:r,isLeftColumn:u,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:pV(e,i,o,r,u,h),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof s||!s.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:g,expressionColor:cV(l,e),selectionCellType:u?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!u,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},hV=(e,t,n,r,i,o,a,s,l)=>{const{isIndentModeEnabled:u}=i;if(!t.length)return e;let c=0;return function t(d,p,f,h=0,m=-1){e[h]||(e[h]={}),u&&m++;const g=i.leftDimensionInfoIndexes.indexOf(p$);f.forEach((f,v)=>{const y={originalValue:f.qText??"",maskedValue:"",delimeter:"-",suffix:""};c+=0===v?0:1;const b=n.qTop-r.page*r.rowsPerPage,x=Math.max(0,b+c-f.qUp),S=n.qTop+c-f.qUp;if(u){if(i.hasPseudoDimOnLeft&&m<=g)if(y.originalValue=f.qText??"",y.maskedValue=f.qText??"","N"===f.qType||"U"===f.qType||"T"===f.qType)"U"===f.qType&&(y.originalValue=i.getNullValueText()),m<g&&(y.suffix=i.visibleMeasureInfo[0].qFallbackTitle??"");else if("P"===f.qType){y.originalValue=(p||d)?.representation.labelStructure?.originalValue??"",y.maskedValue=(p||d)?.representation.labelStructure?.originalValue??"",y.suffix=f.qText??"";const e=f.qSubNodes;f={...(p||d)?.ref,...f.qText?{qText:f.qText}:{},qSubNodes:e},m=(p||d)?.indentLevel??0}"U"===f.qType&&(y.originalValue=i.getNullValueText())}let w=h;u&&(w=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===f.qSubNodes.length&&(w=0));const C=e.at(h)?.[x],E=u&&void 0===C?.ref.qText||!C?fV({node:f,parent:p,root:d,x:w,y:S,pageY:x,layoutService:i,dimensionInfo:o[w],attrExprInfoIndex:a[w],isLeftColumn:!0,...u&&{isIndentModeEnabled:u,indentLevel:m},env:s,pageInfo:r,labelStructure:y,direction:l}):e[h][x];if(e[h][x]=E,f.qSubNodes.length){const e=u?0:h+1;t(d||E,E,f.qSubNodes,e,m)}})}(null,null,t,0,-1),e},mV=(e,t)=>{e.slice(0,-1).forEach(e=>{Object.values(e).forEach((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)})})},gV=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],a=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},vV=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:a,direction:s})=>{const{qLeft:l,qArea:u}=t;if(!l.length)return e;const c=hV(e.grid,l,u,n,r,i,o,a,s);mV(c,n.rowsOnCurrentPage);const d=gV(c,r);return{...e,grid:c,columnCount:c.length,totalDividerIndex:d}},yV=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach((t,n)=>{t.forEach((t,o)=>{const a=e.qTop-r.page*r.rowsPerPage+n,s=e.qLeft+o;Array.isArray(i[a])||(i[a]=[]);const l="U"===t.qType;i[a][s]=i[a][s]??{id:_j(),ref:t,isNull:l}})}),i},bV=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?yV({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},xV=(e,t,n,r,i,o,a,s,l,u)=>{const{isIndentModeEnabled:c}=r;if(!t.length)return e;let d=0;!function t(a,p,f,h=0){e[h]||(e[h]={}),f.forEach((f,m)=>{d+=0===m?0:1;const g=n.qLeft+d-f.qUp,v=e[h][g]??fV({node:f,parent:p,root:a,x:g,y:h,pageY:h,layoutService:r,dimensionInfo:i[h],attrExprInfoIndex:o[h],isLeftColumn:!1,...c&&{isIndentModeEnabled:c},env:s,pageInfo:l,direction:u});e[h][g]=v,f.qSubNodes.length&&t(a||v,v,f.qSubNodes,h+1)})}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},SV=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:a,pageInfo:s,direction:l})=>{const{qTop:u,qArea:c}=t;if(!u.length)return e;const d=xV(e.grid,u,c,n,r,i,o,a,s,l);mV(d,n.size.x);const p=gV(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:p}},wV=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},n)=>(e[t]=n,e),{}),CV=(e,t)=>{const{env:n}=o$(),{direction:r}=n$(),{layoutService:i,effectivePropertiesService:o}=l$(),{qPivotDataPages:a,pageInfo:s}=n$(),[l,u]=m(null),c=((e,t,n)=>v(()=>({left:e.map(wV),top:t.map(wV),measures:n.map(wV)}),[n,e,t]))(e,t,i.visibleMeasureInfo),d=v(()=>y$(i,o,t,e),[i,o,t,e]),p=f(()=>a.slice(1).reduce((e,t)=>bV({prevData:e,dataPage:t,pageInfo:s}),((e,t)=>{const{qData:n,qArea:r}=e;return yV({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(a[0],s)),[a,s]),h=f(()=>a.slice(1).reduce((e,o)=>SV({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r}),((e,t,n,r,i,o,a,s)=>{const{qArea:l,qTop:u}=e,c=xV([],u,l,t,n,r,i,o,a,s);mV(c,t.size.x);const d=gV(c);return{grid:c,rowCount:c.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],i,t,c.top,d.size.y,n,s,r)),[a,i,t,c.top,d.size.y,n,s,r]),g=f(()=>a.slice(1).reduce((t,o)=>vV({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:n,direction:r}),((e,t,n,r,i,o,a)=>{const{qArea:s,qLeft:l}=e,u=hV([],l,s,n,t,r,i,o,a);mV(u,n.rowsOnCurrentPage);const c=gV(u,t);return{grid:u,columnCount:u.length,layoutSize:t.size,totalDividerIndex:c}})(a[0],i,s,e,c.left,n,r)),[a,i,s,e,c,n,r]),[y,b]=m(()=>p()),[x,S]=m(()=>h()),[w,C]=m(()=>g());Lz(()=>{b(p())},[p]),Lz(()=>{S(h())},[h]),Lz(()=>{C(g())},[g]),Lz(()=>{l&&l.forEach(o=>{b(e=>bV({prevData:e,dataPage:o,pageInfo:s})),S(e=>SV({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r})),C(t=>vV({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:n,direction:r}))})},[l]);const E=f(e=>{u(e)},[]);return{headersData:d,measureData:y,topDimensionData:x,leftDimensionData:w,attrExprInfoIndexes:c,nextPageHandler:E}},EV=Math.sqrt(1e4),IV=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/bT.PixelsMin)}),DV=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/EV),r=Math.ceil(e.qHeight/EV);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*EV,qTop:e.qTop+n*EV,qWidth:Math.min(EV,e.qWidth-i*EV),qHeight:Math.min(EV,e.qHeight-n*EV)});return t};function PV({nextPageHandler:e}){const{model:t}=o$(),{pageInfo:n}=n$(),{layoutService:r}=l$(),i=(e=>{const t=l(e);return t.current=e,t})(n.page),o=t,a=f(async(e,t)=>{await(o?.collapseLeft(d$,e,t,!1))},[o]),s=f(async(e,t)=>{await(o?.collapseTop(d$,e,t,!1))},[o]),u=f(async(e,t)=>{await(o?.expandLeft(d$,e,t,!1))},[o]),c=f(async(e,t)=>{await(o?.expandTop(d$,e,t,!1))},[o]),d=f(async t=>{if(o?.getHyperCubePivotData&&0!==t.length)try{const r=await o.getHyperCubePivotData(d$,t.reduce((e,t)=>[...e,...DV(t)],[]));i.current===n.page&&e(r)}catch(e){console.error(e)}},[o,e,n,i]),p=f((e,{dimensionInfoIndex:n,isLeftColumn:i,x:o=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:u}=r.layout.qHyperCube;let c=[];switch(a){case wF.Dimension:c=[{qPath:`${d$}/qDimensions/${n}/qDef/columnWidth`,oldValue:l[n].columnWidth}];break;case wF.Measures:if(i)c=s.map((e,t)=>({qPath:`${d$}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth}));else{const e=r.getMeasureInfoIndexFromCellIndex(o);c=[{qPath:`${d$}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case wF.Pivot:c=[{qPath:`${d$}/topHeadersColumnWidth`,oldValue:u}]}const d=c.map(t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}});t?.applyPatches(d,!0)},[t,r]),h=f(async e=>{await(o?.applyPatches([{qPath:`${d$}/indentModeColumnWidth`,qOp:r.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...r.indentModeColumnWidth,...e})}],!0))},[o,r]);return v(()=>({collapseLeft:a,collapseTop:s,expandLeft:u,expandTop:c,applyColumnWidth:p,applyIndentModeColumnWidth:h,fetchPages:d}),[a,s,u,c,p,h,d])}const RV=(e,t,n)=>(r,i)=>{if("P"===r)return p$;const o=t[n+i];return e[o]},MV=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach(e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)})};return n(e),t},LV=u({}),AV=()=>h(LV),kV=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=l$(),{qPivotDataPages:r}=n$();return v(()=>{const i=MV(r[0]?.qLeft??[]),o=MV(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(RV(n,t,0)),visibleTopDimensionInfo:o.map(RV(n,t,e))}},[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=CV(t,n),u=PV({nextPageHandler:l}),c=v(()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:a,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:s,dataModel:u}),[t,n,r,i,o,a,s,u]);return io.jsx(LV.Provider,{value:c,children:e})},OV=20,qV=18,TV=.75,NV=e=>-1!==e&&e?.representation?.type===mF.Image,_V=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===mF.Image,jV=e=>void 0===e?BF:e,FV=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const n=+e;return n>=0?n:t}return t},zV=e=>FV(e,bT.PixelsDefault),WV=(e,t)=>FV(e,bT.PercentageDefault)*t/100,$V=(e,t,n)=>{switch(t?.type){case xT.Pixels:return zV(t.pixels);case xT.Percentage:return WV(t.percentage,e);case xT.FitToContent:case xT.Auto:default:return n}},VV=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:a})=>e.reduce((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:u,qDimensionInfo:c}}}=t,{id:d,colIdx:p,qApprMaxGlyphCount:f,isLeftDimension:h}=s,m=c.find(e=>e.cId===d),g={width:24,...m?.representation?.imageBox};if(!h)return e+0;if(d===f$)return e+0;const v=_V({isLeftColumn:h,layoutService:t,representation:m?.representation||{type:mF.Text}})?g.width+8+4:r(f),y=!n.qAlwaysFullyExpanded&&p<u-1?21:0;let b=0;if(i&&o&&a){b=o("- ")+a}return Math.max(e,24*l+qV+y+v+b)},0),HV=(e,t,n)=>e.reduce((e,r)=>{const i=(n?0:1)*qV;return Math.max(e,i+t(r.qFallbackTitle??""))},0),BV=(e,t,n,r)=>{const i=100*e/t,o=r*TV*(i/100),a=i/100*+n;return Math.min(a,o)},GV=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),UV=(e,t)=>e.some(e=>e>=t*TV),YV=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:u})=>{let c=[];const d=i*TV,p=n.data[n.data.length-1][0];if(!Array.isArray(p))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const f=Math.min(d,r.at(-1)),h=Math.min(d,VV({headers:p,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,HV(e.visibleMeasureInfo,a));let g=0;const v=p.findIndex(e=>e.id===f$),y=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===xT.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+qV+16:24})({layoutService:e,measureTextForHeader:a,translator:u,headersData:n});if(e.hasPseudoDimOnLeft)if(0===v){const e=Math.max(f,h,m);c=[Math.max(y,e-f),f]}else{const n=Math.min(d,HV(e.visibleMeasureInfo,l,!0));g=Math.min(d,VV({headers:p.slice(0,v),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:n}));const r=Math.max(f,h,g);c=[Math.max(y,r-f),f]}else c=[Math.max(y,h-f),f];const b=Math.min(d,c.reduce((e,t)=>e+t,0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=xT.Pixels,x.pixels=o);return[xT.Pixels,xT.Percentage].includes(x.type)||UV(c,i)?((e,t,n,r)=>{let i=e[0],o=e[1],a=[];const s=e.reduce((e,t)=>e+t,0),{type:l,pixels:u,percentage:c}=t,d=FV(u,bT.PixelsDefault),p=FV(c,bT.PercentageDefault),f=UV(e,n);l===xT.Auto&&f&&(i>o?i-=o:o-=i),l===xT.Pixels&&d&&(i=BV(e[0],s,d,n),o=BV(e[1],s,d,n)),l===xT.Percentage&&p&&(i=GV(e[0],s,p,n),o=GV(e[1],s,p,n));let h=0;o<=r&&(h=i-5,h>0&&(i-=h,o+=h)),h=o-r,h>0&&(i+=h,o-=h),a=[i,o];const m=a.reduce((e,t)=>e+t,0);return{leftGridColumnWidths:a,leftGridWidth:m,leftGridFullWidth:m}})(c,x,i,f):{leftGridWidth:b,leftGridColumnWidths:c,leftGridFullWidth:b}};function KV({tableWidth:e}){const t=e*TV,{styleService:n,layoutService:r,effectivePropertiesService:i}=l$(),{translator:o}=o$(),{gridSectionsData:{headersData:a}}=AV(),{measureText:s}=Dz(n.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:u}=Dz({...n.dimensionValues,fontWeight:jV(n.dimensionValues.fontWeight)}),{measureText:c}=Dz({...n.dimensionValues,...n.measureLabels}),d=f((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:p,topHeadersColumnWidth:f}},visibleMeasureInfo:h,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,v=(t=0)=>h.reduce((n,{qFallbackTitle:r,columnWidth:i})=>{const o=c(r)+qV,a=Math.max(o,t);return Math.max(n,m?a:$V(e,i,a))},0),y=e=>a.data.reduce((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===f$)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?OV:0;return qV+s(t)+OV+r})(r);return Math.max(i,t)},0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const S=x.map((o,s)=>{let u=qV;if(m&&1!==a.size.x||!n||void 0===d||d!==o.colIdx){let t;o.columnWidthLocation===wF.Pivot?t=m?void 0:f:o.columnWidthLocation===wF.Dimension&&({columnWidth:t}=o);let n=0;if(o.isLeftDimension)if(o.id===f$)n=v();else{const e=y(s),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:a}=e,s=r.getDimensionInfo(a);if(NV(s))return bT.PixelsDefault;const u=!i.qAlwaysFullyExpanded&&o&&t<p-1?21:0;return qV+l(n)+u})(o,s);n=Math.max(e,t),m&&!g&&s+1===p&&o.columnWidthLocation===wF.Dimension&&a.size.x>1&&(n=e)}else n=y(s),o.columnWidthLocation===wF.Measures&&(n=v(n));m&&1===a.size.x&&(t=r.indentModeColumnWidth),u=m&&!g&&a.size.x>1?n:$V(e,t,n)}else u=m?Math.min(t,n):n;return b+=u,u});return m&&a.size.x>1?YV({layoutService:r,effectivePropertiesService:i,headersData:a,columnWidths:S,tableWidth:e,widthOverride:n,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:u,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:S,leftGridFullWidth:b}},[e,a,r,t,s,c,l,u,o,i]),[p,h]=m(d);Lz(()=>{h(d())},[d]);const g=f((e,t)=>{h(d(e,t))},[d]);return{...p,overrideLeftGridWidth:g}}function XV({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=l$(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=AV(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:u}=i,{estimateWidth:c,measureText:d}=Dz(r.measureValues,{allowLineBreaks:!1}),{estimateWidth:p}=Dz({...r.dimensionValues,fontWeight:jV(r.dimensionValues.fontWeight)},{allowLineBreaks:!1}),h=e-n-1,m=o.at(-1),g=m===p$,y=s.length-a>o.length?21:0,b=v(()=>{const e=g?u:[m],t=l.x/e.length,n=[],r=[];let i=h;const o=(e,r)=>{n[e]=Math.min(bT.PixelsMax,Math.max(bT.PixelsMin,r)),i-=n[e]*t};if(e.forEach((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(n){case xT.Pixels:o(t,zV(i));break;case xT.Percentage:o(t,WV(a,h));break;case xT.FitToContent:o(t,((e,t,n)=>n?bT.PixelsDefault:qV+(g?Math.max(c(e),d(t)):Math.max(Math.max(...u.map(e=>c(e.qApprMaxGlyphCount))),p(e)+y)))(s,l??"",NV(e)));break;case xT.Auto:default:r.push(t)}}else r.push(t)}),r.length){const e=r.length*t,o=i/e;r.forEach(e=>{n[e]=Math.max(bT.AutoMinPivot,o)})}return n},[g,u,m,l.x,h,c,d,p,y]),x=v(()=>{if(g){return u.reduce((e,t,n)=>e+b[n],0)/u.length}return b[0]},[g,b,u]),S=parseFloat((t/i.size.x).toFixed(12)),w=f(e=>(g&&void 0!==e?b[i.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-S,[g,b,i,x,S]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,h),getRightGridColumnWidth:w}}const JV=`scrollable-container--${EF.TopGrid}`,ZV=`scrollable-container--${EF.LeftGrid}`,QV=`scrollable-container--${EF.DataGrid}`,eH=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},tH=(e,t)=>e>t?IF.Forward:e<t?IF.Backward:IF.None,nH=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{const{direction:s}=n$();d(()=>{const{headerGridWrapperElement:l,topGridWrapperElement:u,leftGridWrapperElement:c,dataGridWrapperElement:d}=r(),p=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},f=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},h=r=>{const a=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(a,s);n.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),u.scrollLeft=l,e.current?.forEach(e=>{e?.scrollTo(l)}),c.scrollTop=d.scrollTop,t.current?.forEach(e=>{e?.scrollTo(a.scrollTop)}),o(r),i?.(r)};return c.addEventListener("scroll",p),u.addEventListener("scroll",f),d.addEventListener("scroll",h),a.scroll||setTimeout(()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)},0),()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)}},[o,i,a,e,t,n,r,s])},rH=()=>{const{interactions:e}=o$(),t=l(null),n=l(null),r=l(null),i=l(null),o=l([]),a=l([]),s=l(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c},resetHorizontalScrollbarHeight:p}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const[r,i]=m(0),[o,a]=m(0);return g(()=>{if(e.current||n.current){const t=Math.max(eH(e.current).width,eH(n.current).width);r!==t&&i(t)}}),g(()=>{if(t.current||n.current){const e=Math.max(eH(t.current).height,eH(n.current).height);o!==e&&a(e)}}),{scrollbarsDimensions:{verticalScrollbarWidth:r,horizontalScrollbarHeight:o},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:a}})=>{const{pageInfo:s}=n$(),{downloadService:l,viewService:u,layoutService:c}=l$(),d=f(()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)},[e,t,n,r]);g(()=>{d()},[s.page,d]),g(()=>{c.triggerdByExpandOrCollapse||d()},[c,d]),g(()=>{if(c.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach(e=>{e?.scrollTo(t)}),i.current?.forEach(t=>{t?.scrollTo(e)}),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}},[c,r,a,o,i]),g(()=>{(l.isDownloadedAsPDForImage||c.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=u.scrollTop,r.current.scrollLeft=u.scrollLeft,n.current.scrollLeft=u.leftGridScrollLeft,t.current.scrollTop=u.topGridScrollTop)},[u,l,c,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s}});const{trackScrollDirection:h,scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y}}=(()=>{const e=l(IF.None),t=l(IF.None),n=l({prevScrollTop:0,prevScrollLeft:0}),r=f(r=>{if(r instanceof WheelEvent&&(e.current=tH(r.deltaY,0),t.current=tH(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=tH(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=tH(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}},[e,t,n]);return{trackScrollDirection:r,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=l$();return f(t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===ZV&&(e.leftGridScrollLeft=r.scrollLeft),i===QV&&(e.scrollLeft=r.scrollLeft),i===JV&&(e.topGridScrollTop=r.scrollTop),i!==ZV&&i!==QV||(e.scrollTop=r.scrollTop)},[e])})(),x={gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},getWrapperElements:f(()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current}),[t,n,r,i]),updateViewService:b,trackScrollDirection:h,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{d(()=>{const{headerGridWrapperElement:i,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:u}=r(),c=e=>{e.ctrlKey||(e.preventDefault(),i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,s.scrollTop=i.scrollTop,o(e))},d=e=>{e.ctrlKey||(e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach(e=>{e?.scrollTo(l.scrollTop)}),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,u.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e))},p=t=>{t.ctrlKey||(t.preventDefault(),s.scrollLeft+=t.deltaX,e.current?.forEach(e=>{e?.scrollTo(s.scrollLeft)}),i.scrollTop+=t.deltaY,s.scrollTop=i.scrollTop,u.scrollLeft=s.scrollLeft,n.current?.scrollTo({scrollLeft:s.scrollLeft}),o(t))},f=r=>{r.ctrlKey||(r.preventDefault(),u.scrollLeft+=r.deltaX,u.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:u.scrollLeft,scrollTop:u.scrollTop}),s.scrollLeft=u.scrollLeft,e.current?.forEach(e=>{e?.scrollTo(u.scrollLeft)}),l.scrollTop=u.scrollTop,t.current?.forEach(e=>{e?.scrollTo(u.scrollTop)}),o(r))};return i.addEventListener("wheel",c),l.addEventListener("wheel",d),s.addEventListener("wheel",p),u.addEventListener("wheel",f),a.scroll||setTimeout(()=>{i.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)},0),()=>{i.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)}},[o,i,a,e,t,n,r])})(x),nH(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c,resetHorizontalScrollbarHeight:p}}},iH=()=>{const{layoutService:e}=l$(),{rect:t,pageInfo:n}=n$();return v(()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}},[t,e,n.shouldShowPagination])},oH=({children:e,style:t})=>io.jsx("div",{"data-testid":"fullSize",style:t,children:e}),aH=({children:e,style:t})=>{const{direction:n}=n$();return io.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},sH=e=>e&&`scrollable-container--${e}`,lH=({children:e,style:t,origin:n},r)=>{const{interactions:i}=o$(),o=i.scroll?t:{overflow:"hidden"};return io.jsx("div",{"data-testid":"scrollable","data-key":sH(n),style:o,ref:r,children:e})};var uH=n.forwardRef(lH);const cH=({children:e,style:t})=>{const{direction:n}=n$();return io.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};var dH=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function pH(e,t){return e===t||!(!dH(e)||!dH(t))}function fH(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!pH(e[n],t[n]))return!1;return!0}function hH(e,t){var n;void 0===t&&(t=fH);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}var mH="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function gH(e){cancelAnimationFrame(e.id)}function vH(e,t){var n=mH();var r={id:requestAnimationFrame(function i(){mH()-n>=t?e.call(null):r.id=requestAnimationFrame(i)})};return r}var yH=-1;function bH(e){if(void 0===e&&(e=!1),-1===yH||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),yH=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return yH}var xH=null;function SH(e){if(void 0===e&&(e=!1),null===xH||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?xH="positive-descending":(t.scrollLeft=1,xH=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),xH}return xH}var wH=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function CH(e){var t,n=e.getColumnOffset,i=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,u=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,d=e.getRowHeight,p=e.getRowOffset,f=e.getRowStartIndexForOffset,h=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=m(r.props,ql(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:ql(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=hH(function(e,t,n,i,o,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),r._callOnScroll=void 0,r._callOnScroll=hH(function(e,t,n,i,o){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})}),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var i,o=r.props,s=o.columnWidth,l=o.direction,u=o.rowHeight,c=r._getItemStyleCache(g&&s,g&&l,g&&u),f=e+":"+t;if(c.hasOwnProperty(f))i=c[f];else{var h=n(r.props,t,r._instanceProps),m="rtl"===l;c[f]=i={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:p(r.props,e,r._instanceProps),height:d(r.props,e,r._instanceProps),width:a(r.props,t,r._instanceProps)}}return i},r._getItemStyleCache=void 0,r._getItemStyleCache=hH(function(e,t,n){return{}}),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState(function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=r.props.direction,u=o;if("rtl"===t)switch(SH()){case"negative":u=-o;break;case"positive-descending":u=l-i-o}u=Math.max(0,Math.min(u,l-i));var c=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:u,scrollTop:c,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&gH(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=vH(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}El(t,e),t.getDerivedStateFromProps=function(e,t){return EH(e,t),v(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,a=o.columnCount,d=o.height,p=o.rowCount,f=o.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,v=bH();void 0!==r&&(r=Math.max(0,Math.min(r,a-1))),void 0!==i&&(i=Math.max(0,Math.min(i,p-1)));var y=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,x=y>d?v:0;this.scrollTo({scrollLeft:void 0!==r?u(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?c(this.props,i,n,g,this._instanceProps,b):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(SH()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&gH(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,n=e.className,i=e.columnCount,o=e.direction,a=e.height,u=e.innerRef,c=e.innerElementType,d=e.innerTagName,p=e.itemData,f=e.itemKey,h=void 0===f?wH:f,m=e.outerElementType,g=e.outerTagName,v=e.rowCount,y=e.style,b=e.useIsScrolling,x=e.width,S=this.state.isScrolling,w=this._getHorizontalRangeToRender(),C=w[0],E=w[1],I=this._getVerticalRangeToRender(),D=I[0],P=I[1],R=[];if(i>0&&v)for(var M=D;M<=P;M++)for(var L=C;L<=E;L++)R.push(r(t,{columnIndex:L,data:p,isScrolling:b?S:void 0,key:h({columnIndex:L,data:p,rowIndex:M}),rowIndex:M,style:this._getItemStyle(M,L)}));var A=s(this.props,this._instanceProps),k=l(this.props,this._instanceProps);return r(m||g||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},r(c||d||"div",{children:R,ref:u,style:{height:A,pointerEvents:S?"none":void 0,width:k}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],u=o[3],c=this._getVerticalRangeToRender(),d=c[0],p=c[1],f=c[2],h=c[3];this._callOnItemsRendered(a,s,d,p,l,u,f,h)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,v=m.scrollLeft,y=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(v,y,g,x,b)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,u=l.horizontalScrollDirection,c=l.isScrolling,d=l.scrollLeft,p=n||r||a||1;if(0===t||0===s)return[0,0,0,0];var f=i(this.props,d,this._instanceProps),h=o(this.props,f,d,this._instanceProps),m=c&&"backward"!==u?1:Math.max(1,p),g=c&&"forward"!==u?1:Math.max(1,p);return[Math.max(0,f-m),Math.max(0,Math.min(t-1,h+g)),f,h]},y._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,u=a.scrollTop,c=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=f(this.props,u,this._instanceProps),p=h(this.props,d,u,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,c),g=s&&"forward"!==l?1:Math.max(1,c);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,p+g)),d,p]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var EH=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},IH=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},DH=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},PH=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var u=a+1;u<=n;u++){var c=o(u);i[u]={offset:s,size:c},s+=c}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},RH=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?MH(e,t,n,o,0,r):LH(e,t,n,Math.max(0,o),r)},MH=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=PH(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},LH=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&PH(e,t,r,n).offset<i;)r+=a,a*=2;return MH(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},AH=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=PH(e,t,n,o),u="column"===e?DH(t,o):IH(t,o),c=Math.max(0,Math.min(u-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=c+s?"auto":"center"),r){case"start":return c;case"end":return d;case"center":return Math.round(d+(c-d)/2);default:return i>=d&&i<=c?i:d>c||i<d?d:c}},kH=CH({getColumnOffset:function(e,t,n){return PH("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return RH("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=PH("column",e,t,r),s=n+o,l=a.offset+a.size,u=t;u<i-1&&l<s;)u++,l+=PH("column",e,u,r).size;return u},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:IH,getEstimatedTotalWidth:DH,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return AH("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return AH("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return PH("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return RH("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=PH("row",e,t,r),s=n+o,l=a.offset+a.size,u=t;u<i-1&&l<s;)u++,l+=PH("row",e,u,r).size;return u},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),OH=function(e,t){return e};function qH(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=u(r.props,ql(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:ql(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=hH(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=hH(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,s=i.itemSize,l=i.layout,u=r._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===l,h="rtl"===a,m=f?d:0;u[e]=t={position:"absolute",left:h?void 0:m,right:h?m:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=hH(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch(SH()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&gH(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=vH(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}El(t,e),t.getDerivedStateFromProps=function(e,t){return TH(e,t),d(e),null};var p=t.prototype;return p.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?bH():0:l.scrollHeight>l.clientHeight?bH():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(SH()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&gH(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,u=e.innerTagName,c=e.itemCount,d=e.itemData,p=e.itemKey,f=void 0===p?OH:p,h=e.layout,m=e.outerElementType,g=e.outerTagName,v=e.style,y=e.useIsScrolling,b=e.width,x=this.state.isScrolling,S="horizontal"===o||"horizontal"===h,w=S?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),E=C[0],I=C[1],D=[];if(c>0)for(var P=E;P<=I;P++)D.push(r(t,{data:d,key:f(P,d),index:P,isScrolling:y?x:void 0,style:this._getItemStyle(P)}));var R=i(this.props,this._instanceProps);return r(m||g||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},r(l||u||"div",{children:D,ref:s,style:{height:S?"100%":R,pointerEvents:x?"none":void 0,width:S?R:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var u=s(this.props,a,this._instanceProps),c=l(this.props,u,a,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),p=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,u-d),Math.max(0,Math.min(t-1,c+p)),u,c]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var TH=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},NH=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var u=r(l);i[l]={offset:a,size:u},a+=u}n.lastMeasuredIndex=t}return i[t]},_H=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=NH(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},jH=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&NH(e,n,t).offset<r;)n+=o,o*=2;return _H(e,t,Math.min(n,i-1),Math.floor(n/2),r)},FH=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},zH=qH({getItemOffset:function(e,t,n){return NH(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:FH,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===a||"horizontal"===l?u:s,d=NH(e,t,i),p=FH(e,i),f=Math.max(0,Math.min(p-c,d.offset)),h=Math.max(0,d.offset-c+d.size+o);switch("smart"===n&&(n=r>=h-c&&r<=f+c?"auto":"center"),n){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return r>=h&&r<=f?r:r<h?h:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?_H(e,t,i,0,n):jH(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,u="horizontal"===i||"horizontal"===s?l:o,c=NH(e,t,r),d=n+u,p=c.offset+c.size,f=t;f<a-1&&p<d;)f++,p+=NH(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function WH(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var $H=["style"],VH=["style"];function HH(e,t){var n=e.style,r=Oe(e,$H),i=t.style,o=Oe(t,VH);return!WH(n,i)&&!WH(r,o)}const BH=10,GH=(e,t)=>e.current===IF.Backward?t:0,UH=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},YH=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,KH=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(UH(t,e,n,r)){const t=a[a.length-1],i={qLeft:e,qTop:n+s,qWidth:1,qHeight:r};void 0!==t&&YH(t,i)?t.qWidth+=i.qWidth:a.push(i)}return a},XH=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=r,u=n.current===IF.Backward?Math.max(0,i-25):o,c=Math.min(u+25,a);return KH({pageInfo:e,measureData:t,startLeft:u,endLeft:c,pageTop:s,qHeight:l})},JH=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:a,pageTop:s,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=e.size.x,l=GH(n,BH),u=Math.max(r-l,0);return{startLeft:u,endLeft:u+Math.min(o+BH,s-u),pageTop:i,qHeight:a}})(r,i,n),u=KH({pageInfo:e,measureData:t,startLeft:o,endLeft:a,pageTop:s,qHeight:l});return u.length>0?[...u,...XH({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:a,columnEndIndex:r.size.x})]:u},ZH=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},QH=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,eB=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const a=[],s=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(ZH(i,n,o,r)){const e=a.at(-1),t={qLeft:n,qTop:o+s,qWidth:r,qHeight:1};void 0!==e&&QH(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},tB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:a,qWidth:s}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=GH(n,BH),l=Math.max(i-s,0);return{startTop:l,endTop:l+Math.min(a+BH,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=eB({startTop:i,endTop:o,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===IF.Backward?Math.max(0,i-25):o,u=Math.min(r+25,e.rowsOnCurrentPage),c=eB({startTop:r,endTop:u,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...c]}return l},nB=async(e,t,n,r,i,o,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:u,gridWidth:c,gridHeight:d}=i;let p=[],f=[];o.current!==IF.None&&(p=tB({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),a.current!==IF.None&&(f=JH({pageInfo:r,measureData:n,scrollDirection:a,layoutService:t,viewService:i})),o.current===IF.None&&a.current===IF.None&&(p=eB({measureData:n,pageInfo:r,qLeft:l,qWidth:c,startTop:u,endTop:u+d}));const h=e.fetchPages([...p,...f]);s.isDownloadedAsPDForImage&&s.waitForPromise(h)},rB=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(nB,100),iB=j_(nB,75),oB=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),aB=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:a})=>{const{direction:s}=n$(),{styleService:{grid:{border:l,divider:u}}}=l$();return io.jsx("div",{style:{...e,...ZF,...nz(n,r,l,s,i),...iz({bottomDivider:a&&o,rightDivider:a&&!o,borderColor:u})},"data-testid":"empty-cell","data-index":t})},sB=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=l$(),a=i&&o;return io.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},lB=e=>{const{type:t,imageSize:n}=e;return t!==mF.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},uB=e=>"number"==typeof e&&!Number.isNaN(+e),cB=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,dB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})})),pB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})})),fB=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M3 9v6.5a.5.5 0 1 1-1 0V.5a.5.5 0 0 1 1 0V1q2.441.639 3.667.639c1.225 0 1.774-.995 3.87-1.196q1.972-.19 3.297.47A.3.3 0 0 1 14 1.18v7.344a.3.3 0 0 1-.417.277q-1.338-.565-3.045-.416c-1.98.172-2.083 1.107-3.871 1.253Q4.879 9.785 3 9"}),io.jsx("use",{fillRule:"evenodd"})]})),hB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13.9 7.4c-1 1.3-.6 1.5-1.5 4.1-.5 1.8-1.2 2.9-1.7 3.6q-.45.6-.9.9H4.2c-1 0-1.6-.5-1.9-1-.2-.3-.3-.6-.3-1V4.2c0-.4.3-.7.7-.7s.7.3.7.7v3.6l.9-.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v5.1l1.1-.2V.7C6.7.3 7 0 7.4 0s.7.3.7.7v5.9l1.1.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v7.7s.1 0 .1-.2l.6-1.4c1.1-2.1 3.1-1.1 2.6-.3"})})),mB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M5 13h6v1.5c0 .3-.2.5-.5.5H10v.5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5V15h-.5c-.3 0-.5-.2-.5-.5zm0-1c0-2-3-3-3-7 0-3 3-5 6-5s6 2 6 5c0 4-3 4-3 7H5m-.5-7c.3 0 .5-.2.5-.5s.2-.7.5-1 .6-.5 1-.5c.3 0 .5-.2.5-.5S6.8 2 6.5 2c-.6 0-1.2.3-1.7.8S4 3.9 4 4.5c0 .3.2.5.5.5"})})),gB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8m4.5 9c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6h-9c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7z"})})),vB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:io.jsx("path",{d:"M2 7.5h12v1H2z"})})),yB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9 7h7a7.004 7.004 0 0 0-7-7zm1-5.917A6.005 6.005 0 0 1 14.917 6H10zM14 9H7V2a7.002 7.002 0 0 0 0 14 7 7 0 0 0 7-7m-8 1h6.917A6.002 6.002 0 0 1 1 9a6 6 0 0 1 5-5.917z"})})),bB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M9 9h3.5c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6H9V3.5c0-.25-.3-.5-.6-.5h-.7c-.4 0-.7.25-.7.5V7H3.5c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7H7v3.5c0 .25.3.5.6.5h.8c.3 0 .6-.25.6-.5zM8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})})),xB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m8.418 1.007.042.08 1.788 4.217 4.571.388a.5.5 0 0 1 .348.811l-.063.065-3.472 3.008 1.043 4.47a.5.5 0 0 1-.664.581l-.081-.04L8 12.217l-3.93 2.372a.5.5 0 0 1-.757-.453l.012-.089 1.043-4.47L.896 6.568a.5.5 0 0 1 .196-.86l.089-.016 4.571-.388L7.54 1.086a.5.5 0 0 1 .878-.08Z"})})),SB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1"})})),wB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})})),CB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M2.4 4h11.2a.2.2 0 0 1 .16.32l-5.6 7.467a.2.2 0 0 1-.32 0L2.24 4.32A.2.2 0 0 1 2.4 4"})})),EB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M11 2.4v11.2a.2.2 0 0 1-.32.16l-7.467-5.6a.2.2 0 0 1 0-.32l7.467-5.6a.2.2 0 0 1 .32.16"})})),IB=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M4 13.6V2.4a.2.2 0 0 1 .32-.16l7.467 5.6a.2.2 0 0 1 0 .32l-7.467 5.6A.2.2 0 0 1 4 13.6"})})),DB={m:wB,"ï":xB,R:x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})})),S:CB,T:EB,U:IB,P:bB,Q:gB,"è":x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M14.98 15H1.04c-1.002 0-1.303-.7-.802-1.5l6.82-11.9c.5-.8 1.303-.8 1.804 0l6.92 11.9c.501.8.1 1.5-.803 1.5M8.5 5h-1c-.3 0-.5.2-.5.5V9c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5V5.5c0-.3-.2-.5-.5-.5m-1 6c-.3 0-.5.2-.5.5v1c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5v-1c0-.3-.2-.5-.5-.5z"})})),"¢":hB,"©":fB,"23F4":mB,2013:SB,"&":yB,add:dB,"minus-2":vB,dot:pB},PB=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&DB[t];return i&&io.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:io.jsx(i,{style:{height:e}})})},RB=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),MB=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},LB=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,u=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-u}:{color:l.color,t:u-.5}:a.gradient?{color:s.color,t:1-(.5+u/2)}:o.gradient?{color:l.color,t:u/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return bN(e.localPaletteColors[t].color??"").blend(bN(s.color??""),s.t)},AB=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort((e,t)=>e.value-t.value),e.limits=n.map(e=>({...e,value:RB(t,e.value)}))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map((e,t)=>({color:MB(r,t,n)}))),r},kB=(e,t,n,r)=>{const i=AB(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=LB(e,a,t);break}r=o}return n})(i,t);return a},OB=(e,t)=>{const n=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),r=n.some(e=>!uB(e));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!uB(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},qB=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=OB(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!uB(t))return 0;let a=n&&uB(n)?Math.min(n,t):0;const s=r.sort((e,t)=>e.value-t.value),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},TB=e=>"flex-start"===e?"flex-end":"flex-start",NB=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=qB(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return MB(i,n.limitPaletteColorIndex,r);const a=RB(n.limitRange,t);return kB(i,a,n.limitRange,r)})(i,t,o,r),s=i.segments.paletteColors[o?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let u=l?.position||"right";return"rtl"===n&&(u="right"===u?"left":"right"),{color:a,iconKey:s,position:u}},_B=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=l$(),{theme:i}=o$(),{direction:o}=n$(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:u}=s??{},c=NB(e,t,o,i),{fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m},v=parseInt(d||VF,10),{iconKey:y,color:b,position:x}=c||{},S={display:"flex",paddingTop:2};return l?io.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:u?b:n?.color},children:["left"===x&&PB({size:v,iconKey:y,color:b,pvStyle:S}),io.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&PB({size:v,iconKey:y,color:b,pvStyle:S})]}):(S.paddingTop=5,PB({size:v,iconKey:y,color:b,pvStyle:S}))},jB=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},FB=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},zB=(e,t,n,r,i)=>{if(i)return;const o=e.representation,a=_V({isLeftColumn:n,layoutService:t,representation:o}),s=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===mF.Image)return a&&l&&"center"!==l&&"rtl"===r?TB(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return jB(n,s,r)}const{textAlign:u}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return jB(u,s,r)},WB=e=>!!e.target?.getAttribute("class")?.includes(yT),$B=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},VB=e=>null!==e.target?.closest("[data-prevent-selection]"),HB=e=>"A"===e.target?.tagName,BB=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const GB=u({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),UB=()=>h(GB),YB=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=n$(),n=e.isActive(),[r,i]=c($B,{engineSelectedCells:null,selectedField:null,activeSelection:null});d(()=>{const n=()=>{i({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}},[e,t]);const o=f(async()=>{if(!r.activeSelection)return;var t,n;1===r.activeSelection.clientSelectedCells.size&&(t=r.engineSelectedCells,(n=r.activeSelection).clientSelectedCells.forEach((e,r)=>{t?.has(r)&&(n.clientSelectedCells.delete(r),t.delete(r))}));const o=new Map([...r.engineSelectedCells??new Map,...r.activeSelection.clientSelectedCells]);try{i({type:"mouseup",payload:{engineSelectedCells:o}}),await e.select({method:"selectPivotCells",params:[d$,Array.from(o,([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x}))]})}catch(e){console.error(e),i({type:"mouseup",payload:{engineSelectedCells:r.engineSelectedCells}})}},[r,e]);d(()=>{if(r.activeSelection)return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}},[o,r.activeSelection]);const a=f((e,t)=>n=>{const r=t(e);WB(n)||VB(n)||HB(n)||!(e=>1===e.buttons)(n)||!r||i(BB({startIndex:e,getCellFromIndex:t,cell:r}))},[]),s=f(t=>async()=>{r.activeSelection&&(e.isActive()||await e.begin([d$]),i({type:"mouseover",payload:{index:t}}))},[r.activeSelection,e]),l=f((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);WB(n)||VB(n)||HB(n)||!r||(i(BB({startIndex:e,getCellFromIndex:t,cell:r})),o())},[o]),u=f(e=>!(!r.engineSelectedCells?.size&&!r.activeSelection?.clientSelectedCells.size||!r.selectedField||e.selectionCellType===r.selectedField.selectionCellType&&("L"===e.selectionCellType?r.selectedField.index===e.x:r.selectedField.index===e.y)),[r.activeSelection?.clientSelectedCells.size,r.engineSelectedCells?.size,r.selectedField]),p=f(e=>!u(e)&&(r.engineSelectedCells?.has(e.ref.qElemNo)||!!r.activeSelection?.clientSelectedCells.has(e.ref.qElemNo)),[u,r.activeSelection?.clientSelectedCells,r.engineSelectedCells]);return v(()=>({isSelected:p,isActive:n,isLocked:u,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:l}),[p,n,u,a,s,l])}(t);return io.jsx(GB.Provider,{value:n,children:e})},KB=e=>"fill"===e.representation.imageSize,XB=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&KB(e)&&t&&(n="center"),e.representation.type!==mF.Image||KB(e)?n:e.representation.resolvedImagePosition?.vertical};var JB=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(JB||{});const ZB={brighter:.5,darker:.3,opacity:.03},QB=(e,{cell:t,styleService:n})=>{if(e===JB.Background||e===JB.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.nullValues[e]:t.isPseudoDimension?n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},eG=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=QB(JB.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?QB(JB.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${Y_(o=i,ZB)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},tG=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:QB(JB.Color,{cell:e,styleService:t}),nG=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=QB(JB.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?BF:i},rG=({cell:e,styleService:t})=>QB(JB.FontStyle,{cell:e,styleService:t}),iG=({cell:e,styleService:t})=>QB(JB.TextDecoration,{cell:e,styleService:t}),oG=e=>e?"pointer":"default",aG=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},sG=(e,t)=>{if(!e.isLeftColumn||e.representation.type===mF.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},lG=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=l$(),{interactions:o}=o$(),{isActive:a}=UB(),{dataModel:s}=AV();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||a||!s,u=tG({cell:e,styleService:r,isCellSelected:n}),c=a?.4:1,d=e.ref.qCanExpand?fW:pW;let p;p=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const f=_V({isLeftColumn:t,layoutService:i,representation:e.representation});return io.jsx(d,{opacity:c,color:u,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...sG(e,r),...f&&{alignSelf:XB(e)}},onClick:l?void 0:aG({cell:e,expandOrCollapse:p})})},uG=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},cG=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},dG=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},pG=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=o,l=_V({isLeftColumn:r,layoutService:o,representation:e}),u=t?21:0,c=e.imageBox?.width??24;let d=`calc(100% - ${u}px)`,p=i.headerCellHeight;r&&l&&(d=c),(a||r)&&(p=i.contentCellHeight);let f=p;switch(r&&void 0!==n&&!s&&(f=p*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:f,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:f};case"fitHeight":return{height:f,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:f,width:d};default:return{width:d,height:p}}},fG=e=>{if("alwaysFit"===e)return"contain"},hG=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),mG=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:cG(e,n,r),height:uG(e),objectFit:fG(e),objectPosition:dG(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),gG=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=l$(),t=l(null),{promise:n,resolve:r}=v(()=>fz(),[]);return d(()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()}),[t,e,n,r]),{onLoad:f(()=>{r()},[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=l$(),{url:a,text:s,imageSize:u,resolvedImagePosition:c}=e,{overflow:p,...h}=t;return io.jsx("img",{src:a,alt:s,style:{...mG({imageSize:u,resolvedImagePosition:c,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...h},onLoad:i,ref:r})},vG=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=l$(),{resolvedImagePosition:u}=e;return io.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:u?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...pG({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:s,layoutService:l,isLeftColumn:i,isMeasureCell:a})},children:io.jsx(gG,{representation:e,textStyle:t,isMeasureCell:!0})})},yG={display:"flex",flexDirection:"row",alignItems:"center"},bG={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},xG=(e,t,n,r)=>t?{...bG,...e.nullValues}:n?{...yG,color:e.totalValues.color,background:r??e.totalValues.background}:{...yG,color:e.measureValues.color,background:r??e.measureValues.background},SG=(e,t,n,r,i)=>{const{fontFamily:o,fontSize:a}=e.measureValues,s={...QF,...!n&&ez(e.grid.lineClamp),...t&&{color:t},fontFamily:o,fontSize:a};if(i){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.nullValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}if(r){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.totalValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}const{fontWeight:l,fontStyle:u,textDecoration:c}=e.measureValues;return{...s,fontWeight:void 0===l?BF:l,fontStyle:u,textDecoration:c}},wG=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i})=>{const{layoutService:o,styleService:a}=l$(),{isIndentModeEnabled:s}=o,l=e.isNull?o.getNullValueText():t.text,u=t.type===mF.Image,c=t.type===mF.Indicator,d=uB(cB(l)),p=SG(a,n,d,r,e.isNull);if(!s&&u&&!e.isNull||s&&u&&!e.isNull)return io.jsx(vG,{isMeasureCell:!0,textStyle:p,representation:t,imageContainerHorizontalAlignment:i});const f=cB(e.isNull?t.text:e.ref.qNum);return c&&uB(f)?io.jsx(_B,{representation:t,cellValue:f,textStyle:p}):io.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...p},children:l})},CG=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,EG="flex-start",IG=(e,t)=>e.isNull?EG:t.type===mF.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:EG,DG=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=o$(),{pageInfo:o,direction:a}=n$(),{styleService:s,layoutService:l}=l$(),{attrExprInfoIndexes:u,gridSectionsData:{measureData:c,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:h,visibleTopDimensionInfo:m}}=AV(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=l$(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=AV(),o=r.length,a=i.length;return f((r,i)=>!(!n.grid.at(a-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal),[n,t,o,a,e])})(),v=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=AV(),n=t.length;return f(t=>{const r=e.grid.at(n-1)?.[t];return oB(r,e.totalDividerIndex)},[e,n])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=l$(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=AV(),r=n.length;return f(n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return oB(o,t.totalDividerIndex,e)},[t,e,r])})(),{showLastBorder:b}=r,x=p.grid.at(m.length-1),S=d.grid.at(h.length-1),{background:w}=s.measureValues,C=c[t]?.[e],E=t===o.rowsOnCurrentPage-1,I=e===l.size.x-1;if(!C)return io.jsx(aB,{style:{...n,background:w},isLastRow:E,isLastColumn:I,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const D=l.hasPseudoDimOnLeft?CG(S,t):CG(x,e),P=l.visibleMeasureInfo[D],R=uV({cell:C.ref,representationProperties:P.representation,attrExprInfoIndex:u.measures[D],env:i,direction:a,conditionalColoring:P.conditionalColoring,enabledFeatures:{[mF.Image]:!0,[mF.Indicator]:!0}}),M=!C.isNull&&g(e,t),L=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+L),k=cV(u.measures[D],C.ref),O=((e,t,n,r,i)=>{const{textAlign:o}=t,a=r?"flex-end":"center";return e.isNull||n.type!==mF.Image?jB(o,a,i):n.resolvedImagePosition?.horizontal??"center"})(C,P,R,A,a),q={...xG(s,C.isNull,M,k.background),...nz(E,I,s.grid.border,a,b),...iz({bottomDivider:y(t),rightDivider:v(e),borderColor:s.grid.divider}),...ZF,padding:"0px 4px",display:"flex",justifyContent:O};return io.jsx("div",{className:gT,title:L,style:{...q,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:io.jsx(sB,{width:lB(R),verticalAlign:IG(C,R),children:io.jsx(wG,{cell:C,representation:R,isTotalValueCell:M,color:k.color,cellHorizontalAlignment:O})})})};var PG=n.memo(DG,HH);const RG=(e,t)=>t.list[e]?.id??e.toString(),MG=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,LG=e=>({...JF,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),AG=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:u}=n$(),{layoutService:c,styleService:{grid:{divider:d},contentCellHeight:p}}=l$(),{dataModel:h,gridSectionsData:{measureData:m}}=AV(),v={...LG(u),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},y=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=n$(),{downloadService:r,viewService:i,layoutService:o}=l$(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:u}}=AV(),c=s.columnCount,d=l.rowCount;return f(async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:p,overscanRowStopIndex:f})=>{i.gridColumnStartIndex=s,i.gridRowStartIndex=p,i.gridWidth=l-s+1,i.gridHeight=f-p+1;const h=i.gridWidth+c+(t.current===IF.None?0:BH),m=i.gridHeight+d+(e.current===IF.None?0:BH);let g=rB;m*h>1500&&(g=iB),g(a,o,u,n,i,e,t,r)},[i,o,a,u,e,t,n,c,d,r])})({verticalScrollDirection:a,horizontalScrollDirection:s});return Lz(()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)},[e,h,m]),g(()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})},[r,t,e,p,u]),0===c.size.x?null:io.jsx(kH,{"data-section-id":"DATA_GRID",ref:e,style:v,columnCount:c.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:m},onItemsRendered:y,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:MG,direction:u,children:PG})};var kG=b(AG);const OG=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),io.jsx("use",{fillRule:"evenodd"})]})),qG=e=>{const[t,n]=m(!1);return Lz(()=>{n(!1)},e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},TG=()=>{const[e,t]=m(!1),{dataModel:n}=AV(),{interactions:r}=o$(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=qG([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||WB(e)||i||t(!0)},setIsAdjustingWidth:o}};function NG(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===YF.Transparent?oN.WHITE:r,o=bN(e.grid.border),a=bN(i);return a.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return bN(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(a,o,o.a).getRGB()}const _G=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:a})=>{const{direction:s}=n$(),{interactions:l,translator:u}=o$(),{isActive:c}=UB(),{dataModel:d}=AV(),{styleService:p}=l$(),[,f]=m({});if(!(e.canBeResized&&!!l.active&&!c))return null;const h=NG(p,e);return io.jsx(Nz,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:h,updateWidthCallback:t=>{f({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*TV,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:u,columnLabel:e.label??""},direction:s})},jG=fl(Qu,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})(({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}})),FG=fl("div",{shouldForwardProp:e=>!["direction"].includes(e)})(({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0})),zG=fl("div",{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({...XF,justifyContent:e??XF.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8})),WG=fl("div")(()=>({...XF})),$G=fl("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})(({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i})),VG=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),HG=fl(bp,{shouldForwardProp:e=>!["isActive"].includes(e)})(({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}})),BG=fl("span")({textOverflow:"ellipsis",overflow:"hidden"}),GG=fl("div",{shouldForwardProp:e=>"visible"!==e})(({visible:e})=>({opacity:e?1:0,width:OV,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})),UG=fl("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})(({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0}));let YG=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const KG=(e,t)=>({qExcludeList:t===YG.Expand,qPos:{qDimName:e,qElemNo:[]}}),XG=`${d$}/qExpansionState`,JG=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex(t=>t.qPos?.qDimName===e);return{expansionData:KG(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=XG,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${XG}/-`,t=JSON.stringify(i)):(n=`${XG}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},ZG=({model:e,effectivePropertiesService:t,cell:n})=>{if(void 0===n.qEffectiveDimensionName)return;const r={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:JG({...r,action:YG.Expand}),collapseCallback:JG({...r,action:YG.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},QG={[SW.Sorting]:!0,[SW.Selections]:!0,[SW.Searching]:!0},eU=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:u,shouldApplyIndentModeColumnWidth:c,tableWidth:d})=>{const p=l(null),{styleService:f,layoutService:h,effectivePropertiesService:m}=l$(),{app:g,interactions:v,embed:y,translator:b,model:x}=o$(),{fontSize:S,fontFamily:w,fontStyle:C,fontWeight:E,textDecoration:I,color:D,background:P,hoverBackground:R,activeBackground:M}=f.header,L=l(null),{shouldShowLockIcon:A,shouldShowMenuIcon:k}=a,{open:O,setOpen:q,handleOpenMenu:T,setIsAdjustingWidth:N}=TG(),{direction:_}=n$(),j={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},F={embed:y,listboxRef:p,sortCriteria:h.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},z={app:g,qStateName:h.layout.qStateName},{labelTextAlign:W}=h.getDimensionInfo(e.dimensionInfoIndex)??{},$=jB(W,"flex-start",_);return io.jsxs(jG,{className:gT,title:e.label,interactions:v,background:O?M:P,hoverBackground:R,shouldShowMenuIcon:k,isDimension:e.isDim,style:{...t,...ZF,...rz(e,i,n,r,f.grid.border,_),color:D},"data-testid":"title-cell",onClick:T,children:[io.jsxs(zG,{children:[A?io.jsx(WG,{children:io.jsx(OG,{height:12})}):null,io.jsx($G,{fontFamily:w,fontSize:S,fontStyle:C,fontWeight:E,textDecoration:I,justifyContent:$,children:io.jsx("span",{style:QF,children:e.label})})]}),e.isDim?io.jsxs(io.Fragment,{children:[io.jsx(EW,{headerData:e,translator:b,anchorRef:L,open:O,setOpen:q,interactions:v,menuAvailabilityFlags:QG,sortRelatedArgs:j,searchRelatedArgs:F,selectionRelatedArgs:z,expandOrCollapseArgs:ZG({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:k,model:x&&"setActiveField"in x?x:void 0,direction:_,isAccessibleHeader:!0}),io.jsx(FG,{ref:p,direction:_}),io.jsx(FG,{ref:L,direction:_})]}):null,io.jsx(_G,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:r,overrideLeftGridWidth:u,setIsAdjustingWidth:N,shouldApplyIndentModeColumnWidth:c,tableWidth:d})]})},tU=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=l$(),{direction:r}=n$();return e>0&&t>0?io.jsx("div",{style:{...JF,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},nU=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})})),rU=x((e,t)=>io.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[io.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),io.jsx("use",{fillRule:"evenodd"})]})),iU=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=n$(),{styleService:i}=l$(),{interactions:o,translator:a}=o$(),{isActive:s}=UB(),{dataModel:l}=AV(),{setIsAdjustingWidth:u}=qG([l]);if(!(!!o.active&&!s))return null;const c=NG(i,{isLeftColumn:!0});return io.jsx(Nz,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:c,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*TV))},confirmWidthCallback:r=>{if(r.type===xT.FitToContent)return void l.applyIndentModeColumnWidth({type:xT.Auto});const i=Math.min(r.pixels??t,e*TV);n(i),l.applyIndentModeColumnWidth({type:xT.Pixels,pixels:i})},setIsAdjustingWidth:u,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:r})},oU=x((e,t)=>io.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:io.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})})),aU=({cell:e,changeSortOrder:t})=>{const n=l(null),r=l(null),{app:i,interactions:o,embed:a,translator:s,model:u}=o$(),{layoutService:c,effectivePropertiesService:d}=l$(),{open:p,setOpen:f,handleOpenMenu:h}=TG();return io.jsxs(HG,{onClick:h,isActive:p,children:[io.jsx(BG,{children:e.label}),io.jsxs(GG,{className:"indent-mode-dropdown-more",visible:p,children:[io.jsx(oU,{}),e.isDim?io.jsxs(io.Fragment,{children:[io.jsx(EW,{headerData:e,translator:s,anchorRef:n,open:p,setOpen:f,interactions:o,menuAvailabilityFlags:QG,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:a,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:c.layout.qStateName},expandOrCollapseArgs:ZG({model:u,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:u&&"setActiveField"in u?u:void 0}),io.jsx(FG,{ref:r}),io.jsx(FG,{ref:n})]}):null]})]})},sU=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===f$,o=e+1<n.length&&n[e+1]?.id===f$;return!(r&&i&&o)&&(t?.id!==f$&&e<n.length-1)},lU=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=l$(),{interactions:a,translator:s}=o$(),{dataModel:u,gridSectionsData:{headersData:c}}=AV(),[d,p]=m(!1),f=l(null),{headerCellHeight:h}=o,{color:g,background:v,hoverBackground:y,activeBackground:b,fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E}=o.header,{isAdjustingWidth:I}=qG([u]),D=e=>{e.stopPropagation()},P={height:h,gridColumn:`1 / span ${c.size.x}`,gridRow:c.size.y,zIndex:c.size.x-0};return io.jsxs(jG,{isDimension:!0,background:d?b:v,interactions:a,hoverBackground:y,style:{...P,...ZF,color:g},onClick:e=>{!a.active||WB(e)||I||p(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[io.jsxs(zG,{justifyContent:"flex-start",children:[io.jsx($G,{fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E,justifyContent:"flex-start",children:io.jsx("span",{style:QF,children:s.get("SNPivotTable.IndentMode.Rows")})}),d?io.jsx(rU,{}):io.jsx(nU,{}),io.jsx(FG,{ref:f})]}),io.jsx(VG,{open:d,anchorEl:f.current,disableEnforceFocus:!0,children:e.map((n,r)=>[n&&n.id!==f$&&io.jsx("li",{role:"presentation",onClick:D,onKeyDown:D,children:io.jsx(aU,{cell:n,changeSortOrder:t})}),sU({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===c.size.y})&&io.jsx(Wz,{"data-testid":"group-divider",variant:"middle"})])}),io.jsx(iU,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},uU=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,cU={display:"grid",width:"fit-content"},dU=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=l$(),{gridSectionsData:{headersData:u}}=AV();return io.jsxs("div",{"data-testid":"HEADER_GRID",style:{...cU,gridTemplateColumns:n.map(e=>`${e}px`).join(" "),gridTemplateRows:u.data.map(()=>`${r}px`).join(" "),height:a},children:[u.size.y>1&&io.jsx(tU,{columnSpan:u.size.x-1,rowSpan:u.size.y-1}),u.data.map((a,c)=>{let d=[];if(uU({layoutService:l,headersData:u,topRowIndex:c})){const n=a.at(0);return Array.isArray(n)&&d.push(io.jsx(lU,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=a.reduce((t,a,d)=>{if(a&&!Array.isArray(a)){const p=o(d,a.isLocked,a.label),f=l.isIndentModeEnabled&&1===u.size.x;t.push(io.jsx(eU,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&u.size.x>1?2:d+1,gridRow:c+1,zIndex:u.size.x-d},isLastRow:c===u.size.y-1,isFirstColumn:0===d,isLastColumn:d===u.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:p,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:f,tableWidth:e},a.id))}return t},[]),d})]})};var pU=b(dU);const fU=(e,t,n,r)=>{const{layoutService:i}=l$();g(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!0))},[e,t,n,r,i])},hU=(e,t)=>{Lz(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!1))},[e,t])},mU=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},gU=()=>{},vU=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:u,index:c})=>{const{styleService:d,layoutService:p}=l$(),{interactions:f}=o$(),{direction:h}=n$(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:v,createPointerUpHandler:y}=UB(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,S=!(x||!f.active||!f.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||u),w=S?g(c,e=>mU(e,r)):void 0,C=S?v(c):void 0,E=S?y(c,e=>mU(e,r)):void 0,I=_V({isLeftColumn:s,layoutService:p,representation:n.representation});return io.jsx("div",{className:gT,title:f.passive?n.representation.text:void 0,style:{...t,...nz(o,a,d.grid.border,h,b),...iz({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:d.grid.divider}),...ZF,padding:"rtl"===h?"0px 0px 0px 4px":"0px 4px",cursor:oG(S),background:eG({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:s?void 0:p.size.x-n.x,justifyContent:zB(n,p,s,h,I),display:"flex",...p.isIndentModeEnabled&&s&&{["rtl"===h?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:FB(n,p)},"aria-hidden":"true",onMouseDown:w,onMouseOver:C,onPointerUp:E,onKeyUp:gU,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},yU=e=>{e.stopPropagation()},bU=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:yU,color:oN.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),xU=({href:e,text:t,interactions:n,color:r})=>io.jsx(bd,{...bU({href:e,text:t,interactions:n,color:r}),children:t}),SU=Y();SU.use(U),SU.renderer.prio(["canvas"]);const wU=(e,t)=>e&&"center"!==e&&"rtl"===t?TB(e):e,CU=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=l$(),{direction:a}=n$();return io.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[io.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:XB(e),alignItems:wU(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:io.jsx(gG,{representation:t,textStyle:n})}),io.jsx(UG,{padding:4/(o<=2?2:1),alignSelf:XB(e,!0),children:!!t.labelStructure&&hG(t.labelStructure)})]})},EU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,IU=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>io.jsxs("span",{children:[io.jsx(bd,{...bU({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&EU(n)]}),DU=({children:e,textStyle:t,shouldEnableStickyText:n})=>io.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),PU=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,RU=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=n$(),{isActive:i}=UB(),{layoutService:o,styleService:a}=l$(),{interactions:s}=o$(),l=n&&o.isIndentModeEnabled;let u=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const c=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...QF,...ez(PU({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:tG({cell:e,styleService:t,isCellSelected:n}),fontWeight:nG({cell:e,styleService:t}),fontStyle:rG({cell:e,styleService:t}),textDecoration:iG({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===mF.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?CU:vG;return io.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:c,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:zB(e,o,n,r)})}if(e.representation.type===mF.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?IU:xU;u=io.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return io.jsx(DU,{shouldEnableStickyText:l,textStyle:{...c,...e.representation.type===mF.Image&&e.isNull?{alignSelf:XB(e)}:{}},children:u})},MU=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=l$(),{isSelected:o}=UB(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:u,totalDividerIndex:c}=n,{isAdjustingWidth:d,setIsAdjustingWidth:p}=qG([n]),f=mU(e,n),h=a?e===l-1:u,m=a?u:e===l-1,g=oB(f,c,i.isIndentModeEnabled);if(void 0===f){const{background:n}=r.dimensionValues;return io.jsx(aB,{style:{...t,background:n},index:e,isLastRow:h,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const v=o(f);return io.jsxs(vU,{reactWindowStyle:t,isLeftColumn:a,isLastRow:h,isLastColumn:m,isCellSelected:v,showTotalCellDivider:g,cell:f,data:n,isAdjustingWidth:d,index:e,children:[io.jsxs(sB,{verticalAlign:XB(f),width:lB(f.representation),right:f.isLeftColumn?void 0:4,isLeftColumn:a,children:[io.jsx(lG,{isLeftColumn:a,isCellSelected:v,cell:f}),io.jsx(RU,{isLeftColumn:a,isCellSelected:v,cell:f})]}),io.jsx(_G,{cellInfo:{...f,columnWidthLocation:f.isPseudoDimension?wF.Measures:wF.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var LU=n.memo(MU,HH);const AU=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},kU=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},OU=(e,t)=>n=>{e.current&&(e.current[t]=n)},qU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...JF},TU={overflow:"hidden",willChange:"auto",flexShrink:0},NU=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=n$(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:u}}}=l$(),{qSize:c}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:p}}=AV();hU(e,d),fU(e,t,n,l);const f=o.rowsOnCurrentPage*l,h={...qU,borderColor:u,width:r.reduce((e,t)=>e+t,0)};return io.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:d.grid.map((t,u)=>{const h=u===d.columnCount-1,m=h$(p[u]),{itemCount:g,estimatedItemSize:v,listValues:y}=kU(t,f,o.rowsOnCurrentPage,h),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,y,l,h,c.qcy);return io.jsx(zH,{ref:OU(e,u),style:{...TU,flexGrow:h?1:0,direction:a},height:n,width:r[u],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:g,showLastBorder:i,listValues:y,totalDividerIndex:d.totalDividerIndex},itemKey:RG,estimatedItemSize:v,children:LU},m)})})};var _U=b(NU);const jU={overflow:"hidden",willChange:"auto"},FU=e=>({...JF,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),zU=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=n$(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:u}}=l$(),{gridSectionsData:{headersData:c,topDimensionData:d}}=AV(),p={...FU(a),borderColor:l,height:r};hU(e,d),fU(e,n,r,u);const f=s.size.x*o();return 0===d.rowCount?io.jsx("div",{style:{width:n,height:r,...FU(a)}}):io.jsx("div",{style:p,"data-section-id":"TOP_GRID",children:d.grid.map((r,l)=>{const u=l===d.rowCount-1,{itemCount:p,estimatedItemSize:h,listValues:m}=kU(r,f,s.size.x,u),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=uU({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:c,topRowIndex:l}),v=g?h$(g):`empty ${l}`;return io.jsx(zH,{ref:OU(e,l),style:jU,height:t(),width:n,itemCount:p,itemSize:AU({list:r,listValues:m,isLastRow:u,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:u,itemCount:p,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:RG,estimatedItemSize:h,direction:a,children:LU},v)})})};var WU=b(zU);const $U=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=l$(),n=iH(),r=(()=>{const{model:e}=o$(),t=f(async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}},[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:c},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:h},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:v}}=rH(),{leftGridWidth:y,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:S,showLastRightBorder:w,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:E,overrideLeftGridWidth:I}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=l$(),{gridSectionsData:{headersData:o}}=AV(),{measureText:a}=Dz(i.header,{allowLineBreaks:!1}),s=KV({tableWidth:e}),l=XV({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,c=f((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let u=!1,c=!1,d=a(n)+qV;return t&&d+OV<=l&&(c=!0,d+=OV),d+OV<=l&&(u=!0),{shouldShowMenuIcon:u,shouldShowLockIcon:c}},[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return d(()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()},[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:c}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:v}),{gridScaffoldDimensions:D,headerGridDims:P,topGridDims:R,leftGridDims:M,dataGridDims:L,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:k}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=iH(),{pageInfo:l}=n$(),{gridSectionsData:{headersData:u,topDimensionData:c}}=AV(),d=Math.min(s.height*TV,Math.max(s.height*TV-25,s.height-t-a)),p=s.width*TV,f=l.rowsOnCurrentPage*t,h=Math.max(u.size.y,c.rowCount,1),m=e*h,g=e*h,v=Math.min(p,n),y=s.width-p,b=Math.max(y,s.width-v),x=Math.min(d,m,g),{availableHeight:S,everyThingFitsInTableRectHeight:w,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+f+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,v,b),E=S-d,I=Math.max(E,S-x),D=Math.min(I,f),P=Math.min(I,f),R=m+1+f,{visibilityStatus:M,metadata:{hasLeftGridOverflowX:L,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,u=s>r,c=o>t,d=a>n,p=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:u?"scroll":"hidden"},leftGrid:{overflowX:c?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:u,hasLeftGridOverflowX:c,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:v,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:I}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${v}px ${b}px`,gridTemplateRows:`${x}px ${I}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:v,height:R-g+(!L&&A?a:0)},stickyWrapper:{width:v,height:I-1-a},self:{width:v,height:Math.max(t,D-(w?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:R-g+(!A&&L?a:0)},stickyWrapper:{width:b-1-o,height:I-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,P-(w?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:w,scrollbarsVisibilityStatus:M}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:y,leftGridOriginalWidth:b,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=f(()=>e,[e]),q=f(()=>t,[t]);return(()=>{const{downloadService:e}=l$();d(()=>{e.notifyIsDoneRendering()})})(),io.jsxs(aH,{style:D,children:[io.jsx("div",{style:{overflow:"hidden"},ref:i,children:io.jsx(pU,{tableWidth:n.width,leftGridWidth:y,columnWidths:x,getHeaderCellsIconsVisibilityStatus:E,rowHight:e,height:P.height,changeSortOrder:r,overrideLeftGridWidth:I})}),io.jsx(uH,{style:k.topGrid,origin:EF.TopGrid,ref:o,children:io.jsx(oH,{style:R.fullSizeWrapper,children:io.jsx(cH,{style:R.stickyWrapper,children:io.jsx(WU,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:w,bottom:!1},getRightGridColumnWidth:C})})})}),io.jsx(uH,{style:k.leftGrid,origin:EF.LeftGrid,ref:a,children:io.jsx(oH,{style:M.fullSizeWrapper,children:io.jsx(cH,{style:M.stickyWrapper,children:io.jsx(_U,{leftGridRef:u,...M.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),io.jsx(uH,{style:k.dataGrid,origin:EF.DataGrid,ref:s,children:io.jsx(oH,{style:L.fullSizeWrapper,children:io.jsx(cH,{style:L.stickyWrapper,children:io.jsx(kG,{dataGridRef:c,rowHightCallback:q,...L.self,showLastBorder:{right:w,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:h})})})})]})},VU=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=o$(),{pageInfo:i,updatePageInfo:o,rect:a}=n$(),{layoutService:s}=l$(),{layout:l,hasData:u}=s;return io.jsxs(io.Fragment,{children:[u?io.jsx($U,{}):null,io.jsx(c$,{}),io.jsx(e$,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const HU=(e,{selections:t,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){const t=kS();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ls({...t,direction:e})}(r.direction);e.render(io.jsx(n.StrictMode,{children:io.jsx(ml,{theme:a,children:io.jsx(a$,{...o,children:io.jsx(r$,{...r,children:io.jsx(YB,{selections:t,children:io.jsx(u$,{...i,children:io.jsx(kV,{children:io.jsx(VU,{})})})})})})})}))};var BU=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(BU||{}),GU=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(GU||{}),UU=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(UU||{}),YU=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(YU||{});const KU=e=>e?`${parseInt(e,10)}px`:void 0,XU=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?YF.Transparent:n}},JU=(e,t)=>+(parseInt(e,10)*UF*t+8).toFixed(2),ZU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?BF:"normal",QU=e=>e?.some(e=>"italic"===e)?"italic":"normal",eY=e=>e?.some(e=>"underline"===e)?"underline":"none",tY=document.createElement("textarea");function nY(e){tY.value=e,document.body.appendChild(tY),tY.select(),tY.setSelectionRange(0,tY.value.length),document.execCommand("copy"),document.body.removeChild(tY)}tY.style.position="absolute",tY.style.left="-9999px",tY.setAttribute("readonly","");function rY(e){T?.((t,n)=>{const r=n.target,i=r?.closest(`.${gT}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>{nY(t)}):nY(t))})(i)}}),e?.forEach(e=>{e(t,n,i)})})}const iY=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>hz((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:c}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(d$,0,0,!0),await e.expandLeft(d$,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:JG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:YG.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:u,label:c,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(d$,0,0,!0),await e.collapseLeft(d$,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:JG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:YG.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:u,label:c,translator:r}))},[e,t,n]),oY=(e,t)=>R(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,u=r?.content?.rowsPerPage??15e3,c={x:Math.min(e.qHyperCube.qSize.qcx,GF),y:Math.min(e.qHyperCube.qSize.qcy,u)},d=o.slice(0,i),p=e=>d.some(t=>t===e),f=p(p$),h=new Map(o.map(e=>[s[e]??p$,e])),m=a.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(f)return 0;const n=e%m.length;return t?n:a.findIndex(e=>e===m[n])},getDimensionInfo:e=>e===p$?void 0:s.at(e),getDimensionInfoIndex:e=>h.get(e)??-1,size:c,isSnapshot:l,hasLimitedData:!l&&c.x<e.qHyperCube.qSize.qcx,hasData:c.x>0&&c.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:f,leftDimensionInfoIndexes:d,isLeftDimension:p,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:xT.Auto,pixels:bT.PixelsDefault,percentage:bT.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),aY=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=gz(e);return t.current=e,t})(IV(i));return wz(async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:u}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,u)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,u))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(GF,n.qcx);if(n.qcy<a)return null;let u=0,c=a;if(e){u=t.gridColumnStartIndex,c=a+t.gridRowStartIndex;const e=c+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(c=Math.max(0,s-i)),n>l&&(u=Math.max(0,l-o))}return{qLeft:u,qTop:c,qWidth:Math.min(l-u,o),qHeight:Math.min(s-c,i)}})(s,n,o.qHyperCube.qSize,r,i,u);return t?e.getHyperCubePivotData(d$,DV(t)):[]}return t.qPivotDataPages},[o,a,e,n,r.page,r.rowsPerPage,l,s])},sY=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),lY=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:sY({rowsPerPage:n,totalRowCount:e,page:t})}),uY=15,cY=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=M();return N(async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,u=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-uY,0),u=Math.max(s+i-uY,s,0),c=GF-l,d=s+t.rowsOnCurrentPage-u;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=IV(n);return{qLeft:l,qTop:u,qWidth:Math.min(c,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:u,qWidth:Math.min(c,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),c=DV(u),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(d$,[d,...c]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o}),_(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)}),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var dY={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const pY=()=>{const e=j(),t=e.language();return R(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(dY).forEach(t=>{e.add(dY[t])})}(e)},[e]),{translator:e,language:t}},fY=e=>{const{flags:t}=e,n=F(),r=(e=>{const t=R(()=>Pz(e),[e]);return k(()=>()=>{t.unmount()},[t]),t})(n),i=z(),o=W(),a=$(),s=V(),l=H(),u=(()=>{const{viewState:e}=M(),t=gz(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=R(()=>fz(),[]),o=hz(e=>{t.current.add(e)},[t]),a=hz(j_(async()=>{await Promise.all(t.current),t.current.clear(),i()},1e3),[i,t]);return L(async()=>{await r},[r]),R(()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:a,waitForPromise:o}),[a,n,e,o])})(),c=((e,t)=>{const[n]=wz(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]);return R(()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[n])})(o,i),d=oY(i,t),p=(e=>{const t=q();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),f=B(),h=Sz(i,n),{translator:m,language:g}=pY(),{pageInfo:v,updatePageInfo:y}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=A(()=>{const a=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...lY(r.qcy,a,o)}}),l=e.layout.qHyperCube.qSize.qcy;return k(()=>{s(t=>({...t,...lY(l,t.page,o),shouldShowPagination:l>e.size.y&&!i}))},[l,e.size.y,s,i,o]),k(()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=sY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}},[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:sY({...a,...e})})}}})(d,u),b=((e,t,n)=>R(()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData),[n,e.page,t.snapshotData]))(v,i,u),x=cY({rect:G(),layoutService:d,viewService:b,model:o,pageInfo:v}),[S,w]=aY({model:o,layoutService:d,viewService:b,pageInfo:v,rect:x}),C=R(()=>((e,t)=>{const n=t.layout.components?.find(e=>"theme"===e.key),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,u=n?.grid,c=(t,n,r)=>e.getStyle(t,n,r),d=+(u?.[BU.LineClamp]??c(GU.Grid,UU.Grid,YU.LineClamp)??1),p=+(u?.[BU.ColumnLineClamp]??c(GU.Grid,UU.Grid,YU.ColumnLineClamp)??1),f=XU(e,r?.[BU.Background])??c(GU.Dimension,UU.LabelName,YU.BackgroundColor)??YF.Transparent,h={header:{fontSize:KU(r?.[BU.FontSize])??c(GU.Dimension,UU.LabelName,YU.FontSize)??VF,fontFamily:r?.[BU.FontFamily]??c(GU.Dimension,UU.LabelName,YU.FontFamily)??HF,fontWeight:ZU(r?.[BU.FontStyle],BF),fontStyle:QU(r?.[BU.FontStyle]),textDecoration:eY(r?.[BU.FontStyle]),color:XU(e,r?.[BU.FontColor])??c(GU.Dimension,UU.LabelName,YU.FontColor)??oN.TEXT,background:f,hoverBackground:Y_(f,ST),activeBackground:Y_(f,wT)},dimensionValues:{fontSize:KU(i?.[BU.FontSize])??c(GU.Dimension,UU.LabelValue,YU.FontSize)??VF,fontFamily:i?.[BU.FontFamily]??c(GU.Dimension,UU.LabelValue,YU.FontFamily)??HF,fontWeight:ZU(i?.[BU.FontStyle],void 0),fontStyle:QU(i?.[BU.FontStyle]),textDecoration:eY(i?.[BU.FontStyle]),color:XU(e,i?.[BU.FontColor])??c(GU.Dimension,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,i?.[BU.Background])??c(GU.Dimension,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},measureValues:{fontSize:KU(o?.[BU.FontSize])??c(GU.Measure,UU.LabelValue,YU.FontSize)??VF,fontFamily:o?.[BU.FontFamily]??c(GU.Measure,UU.LabelValue,YU.FontFamily)??HF,fontWeight:ZU(o?.[BU.FontStyle],"normal"),fontStyle:QU(o?.[BU.FontStyle]),textDecoration:eY(o?.[BU.FontStyle]),color:XU(e,o?.[BU.FontColor])??c(GU.Measure,UU.LabelValue,YU.FontColor)??YF.FontSecondary,background:XU(e,o?.[BU.Background])??c(GU.Measure,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},measureLabels:{fontWeight:ZU(a?.[BU.FontStyle],"normal"),fontStyle:QU(a?.[BU.FontStyle]),textDecoration:eY(a?.[BU.FontStyle]),color:XU(e,a?.[BU.FontColor])??c(GU.Measure,UU.LabelName,YU.FontColor)??YF.FontSecondary,background:XU(e,a?.[BU.Background])??c(GU.Measure,UU.LabelName,YU.BackgroundColor)??YF.Transparent},totalValues:{fontWeight:ZU(s?.[BU.FontStyle],BF),fontStyle:QU(s?.[BU.FontStyle]),textDecoration:eY(s?.[BU.FontStyle]),color:XU(e,s?.[BU.FontColor])??c(GU.Total,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,s?.[BU.Background])??c(GU.Total,UU.LabelValue,YU.BackgroundColor)??YF.Transparent},nullValues:{fontWeight:ZU(l?.[BU.FontStyle],"normal"),fontStyle:QU(l?.[BU.FontStyle]),textDecoration:eY(l?.[BU.FontStyle]),color:XU(e,l?.[BU.FontColor])??c(GU.Null,UU.LabelValue,YU.FontColor)??oN.TEXT,background:XU(e,l?.[BU.Background])??c(GU.Null,UU.LabelValue,YU.BackgroundColor)??YF.NullValueBackground},grid:{columnLineClamp:p,lineClamp:d,border:XU(e,u?.[BU.Border])??c(GU.Grid,UU.Grid,YU.BorderColor)??YF.DividerLight,divider:XU(e,u?.[BU.Divider])??c(GU.Grid,UU.Divider,YU.BorderColor)??YF.DividerDark,background:XU(e,u?.[BU.Background])??c(GU.Grid,UU.Grid,YU.BackgroundColor)??YF.Transparent},selectedColors:U_(e)};return h.headerCellHeight=Math.max(JU(h.header.fontSize,p),JU(h.dimensionValues.fontSize,p),32),h.contentCellHeight=Math.max(JU(h.measureValues.fontSize,d),JU(h.dimensionValues.fontSize,d),24),h.dimensionValueTextHeight=JU(h.dimensionValues.fontSize,1),h})(h,d),[h,d]),E=((e,t,n)=>{const[,r,i]=wz(async()=>{const t=TN(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,Mz].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(h,i,e),{direction:I}=M();rY([iY({model:o,layoutService:d,effectivePropertiesService:c,translator:m})]),k(()=>{!w&&o&&!!S&&E&&HU(r,{selections:f,baseObjects:{rect:x,pageInfo:v,qPivotDataPages:S,updatePageInfo:y,direction:I},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:h,keyboard:l,translator:m,interactions:p},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:u,effectivePropertiesService:c}})},[o,a,x,p,f,b,d,u,w,S,C,r,E,m,g,v,y,c,s,l,h,e,I])},hY={version:"7.18.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]},mY=()=>({...hY,qHyperCubeDef:{...hY.qHyperCubeDef,qIndentMode:!1}})}}});